machdep.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:5k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. #ifdef __KERNEL__
  2. #ifndef _PPC_MACHDEP_H
  3. #define _PPC_MACHDEP_H
  4. /*
  5.  * This program is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU General Public License
  7.  * as published by the Free Software Foundation; either version
  8.  * 2 of the License, or (at your option) any later version.
  9.  */
  10. #include <linux/config.h>
  11. struct pt_regs;
  12. struct pci_bus;
  13. struct pci_dev;
  14. struct kbd_repeat;
  15. struct device_node;
  16. struct TceTable;
  17. struct rtc_time;
  18. struct machdep_calls {
  19. void            (*hpte_invalidate)(unsigned long slot,
  20.    unsigned long secondary,  
  21.    unsigned long va, 
  22.    int large, int local);
  23. long            (*hpte_updatepp)(unsigned long slot,
  24.  unsigned long secondary,  
  25.  unsigned long newpp, 
  26.  unsigned long va,
  27.  int large);
  28. void            (*hpte_updateboltedpp)(unsigned long newpp, 
  29.        unsigned long ea);
  30. long (*hpte_insert)(unsigned long vpn,
  31.        unsigned long prpn,
  32.        unsigned long hpteflags, 
  33.        int bolted,
  34.        int large);
  35. long (*hpte_remove)(unsigned long hpte_group);
  36. void (*tce_build)(struct TceTable * tbl,
  37.      long tcenum,
  38.      unsigned long uaddr,
  39.      int direction);
  40. void (*tce_free_one)(struct TceTable *tbl,
  41.         long tcenum);    
  42. void (*smp_message_pass)(int target,
  43.     int msg, 
  44.     unsigned long data,
  45.     int wait);
  46. int (*smp_probe)(void);
  47. void (*smp_kick_cpu)(int nr);
  48. void (*smp_setup_cpu)(int nr);
  49. void (*setup_arch)(void);
  50. /* Optional, may be NULL. */
  51. void (*setup_residual)(struct seq_file *m, int cpu_id);
  52. /* Optional, may be NULL. */
  53. void (*get_cpuinfo)(struct seq_file *m);
  54. /* Optional, may be NULL. */
  55. unsigned int (*irq_cannonicalize)(unsigned int irq);
  56. void (*init_IRQ)(void);
  57. void (*init_ras_IRQ)(void);
  58. int (*get_irq)(struct pt_regs *);
  59. /* A general init function, called by ppc_init in init/main.c.
  60.    May be NULL. */
  61. void (*init)(void);
  62. void (*restart)(char *cmd);
  63. void (*power_off)(void);
  64. void (*halt)(void);
  65. long (*time_init)(void); /* Optional, may be NULL */
  66. int (*set_rtc_time)(struct rtc_time *);
  67. void (*get_rtc_time)(struct rtc_time *);
  68. void (*get_boot_time)(struct rtc_time *);
  69. void (*calibrate_decr)(void);
  70.    void (*progress)(char *, unsigned short);
  71. unsigned char  (*nvram_read_val)(int addr);
  72. void (*nvram_write_val)(int addr, unsigned char val);
  73. /* Tons of keyboard stuff. */
  74. int (*kbd_setkeycode)(unsigned int scancode,
  75. unsigned int keycode);
  76. int (*kbd_getkeycode)(unsigned int scancode);
  77. int (*kbd_translate)(unsigned char scancode,
  78. unsigned char *keycode,
  79. char raw_mode);
  80. char (*kbd_unexpected_up)(unsigned char keycode);
  81. void (*kbd_leds)(unsigned char leds);
  82. void (*kbd_init_hw)(void);
  83. #ifdef CONFIG_MAGIC_SYSRQ
  84. unsigned char  *ppc_kbd_sysrq_xlate;
  85. #endif
  86. /* Debug interface.  Low level I/O to some terminal device */
  87. void (*udbg_putc)(unsigned char c);
  88. unsigned char (*udbg_getc)(void);
  89. int (*udbg_getc_poll)(void);
  90. /* PCI interfaces */
  91. int (*pcibios_read_config_byte)(struct device_node *dn, int offset, u8 *val);
  92. int (*pcibios_read_config_word)(struct device_node *dn, int offset, u16 *val);
  93. int (*pcibios_read_config_dword)(struct device_node *dn, int offset, u32 *val);
  94. int (*pcibios_write_config_byte)(struct device_node *dn, int offset, u8 val);
  95. int (*pcibios_write_config_word)(struct device_node *dn, int offset, u16 val);
  96. int (*pcibios_write_config_dword)(struct device_node *dn, int offset, u32 val);
  97. /* Called after scanning the bus, before allocating
  98.  * resources
  99.  */
  100. void (*pcibios_fixup)(void);
  101.        /* Called for each PCI bus in the system
  102.         * when it's probed
  103.         */
  104. void (*pcibios_fixup_bus)(struct pci_bus *);
  105.        /* Called when pci_enable_device() is called (initial=0) or
  106.         * when a device with no assigned resource is found (initial=1).
  107.         * Returns 0 to allow assignement/enabling of the device
  108.         */
  109.         int  (*pcibios_enable_device_hook)(struct pci_dev *, int initial);
  110. void* (*pci_dev_io_base)(unsigned char bus, unsigned char devfn, int physical);
  111. void* (*pci_dev_mem_base)(unsigned char bus, unsigned char devfn);
  112. int (*pci_dev_root_bridge)(unsigned char bus, unsigned char devfn);
  113. /* this is for modules, since _machine can be a define -- Cort */
  114. int ppc_machine;
  115. };
  116. extern struct machdep_calls ppc_md;
  117. extern char cmd_line[512];
  118. extern void setup_pci_ptrs(void);
  119. /* Functions to produce codes on the leds.
  120.  * The SRC code should be unique for the message category and should
  121.  * be limited to the lower 24 bits (the upper 8 are set by these funcs),
  122.  * and (for boot & dump) should be sorted numerically in the order
  123.  * the events occur.
  124.  */
  125. /* Print a boot progress message. */
  126. void ppc64_boot_msg(unsigned int src, const char *msg);
  127. /* Print a termination message (print only -- does not stop the kernel) */
  128. void ppc64_terminate_msg(unsigned int src, const char *msg);
  129. /* Print something that needs attention (device error, etc) */
  130. void ppc64_attention_msg(unsigned int src, const char *msg);
  131. /* Print a dump progress message. */
  132. void ppc64_dump_msg(unsigned int src, const char *msg);
  133. #endif /* _PPC_MACHDEP_H */
  134. #endif /* __KERNEL__ */