apic.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #ifndef __ASM_APIC_H
  2. #define __ASM_APIC_H
  3. #include <linux/config.h>
  4. #include <linux/pm.h>
  5. #include <asm/fixmap.h>
  6. #include <asm/apicdef.h>
  7. #include <asm/system.h>
  8. #define Dprintk(x...)
  9. /*
  10. * Debugging macros
  11. */
  12. #define APIC_QUIET 0
  13. #define APIC_VERBOSE 1
  14. #define APIC_DEBUG 2
  15. extern int apic_verbosity;
  16. extern int apic_runs_main_timer;
  17. /*
  18. * Define the default level of output to be very little
  19. * This can be turned up by using apic=verbose for more
  20. * information and apic=debug for _lots_ of information.
  21. * apic_verbosity is defined in apic.c
  22. */
  23. #define apic_printk(v, s, a...) do { \
  24. if ((v) <= apic_verbosity) \
  25. printk(s, ##a); \
  26. } while (0)
  27. #ifdef CONFIG_X86_LOCAL_APIC
  28. struct pt_regs;
  29. /*
  30. * Basic functions accessing APICs.
  31. */
  32. static __inline void apic_write(unsigned long reg, unsigned int v)
  33. {
  34. *((volatile unsigned int *)(APIC_BASE+reg)) = v;
  35. }
  36. static __inline unsigned int apic_read(unsigned long reg)
  37. {
  38. return *((volatile unsigned int *)(APIC_BASE+reg));
  39. }
  40. static __inline__ void apic_wait_icr_idle(void)
  41. {
  42. while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY );
  43. }
  44. static inline void ack_APIC_irq(void)
  45. {
  46. /*
  47. * ack_APIC_irq() actually gets compiled as a single instruction:
  48. * - a single rmw on Pentium/82489DX
  49. * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC)
  50. * ... yummie.
  51. */
  52. /* Docs say use 0 for future compatibility */
  53. apic_write(APIC_EOI, 0);
  54. }
  55. extern int get_maxlvt (void);
  56. extern void clear_local_APIC (void);
  57. extern void connect_bsp_APIC (void);
  58. extern void disconnect_bsp_APIC (int virt_wire_setup);
  59. extern void disable_local_APIC (void);
  60. extern int verify_local_APIC (void);
  61. extern void cache_APIC_registers (void);
  62. extern void sync_Arb_IDs (void);
  63. extern void init_bsp_APIC (void);
  64. extern void setup_local_APIC (void);
  65. extern void init_apic_mappings (void);
  66. extern void smp_local_timer_interrupt (struct pt_regs * regs);
  67. extern void setup_boot_APIC_clock (void);
  68. extern void setup_secondary_APIC_clock (void);
  69. extern void setup_apic_nmi_watchdog (void);
  70. extern int reserve_lapic_nmi(void);
  71. extern void release_lapic_nmi(void);
  72. extern void disable_timer_nmi_watchdog(void);
  73. extern void enable_timer_nmi_watchdog(void);
  74. extern void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason);
  75. extern int APIC_init_uniprocessor (void);
  76. extern void disable_APIC_timer(void);
  77. extern void enable_APIC_timer(void);
  78. extern void clustered_apic_check(void);
  79. extern void nmi_watchdog_default(void);
  80. extern int setup_nmi_watchdog(char *);
  81. extern unsigned int nmi_watchdog;
  82. #define NMI_DEFAULT -1
  83. #define NMI_NONE 0
  84. #define NMI_IO_APIC 1
  85. #define NMI_LOCAL_APIC 2
  86. #define NMI_INVALID 3
  87. extern int disable_timer_pin_1;
  88. extern void setup_threshold_lvt(unsigned long lvt_off);
  89. void smp_send_timer_broadcast_ipi(void);
  90. void switch_APIC_timer_to_ipi(void *cpumask);
  91. void switch_ipi_to_APIC_timer(void *cpumask);
  92. #define ARCH_APICTIMER_STOPS_ON_C3 1
  93. #endif /* CONFIG_X86_LOCAL_APIC */
  94. extern unsigned boot_cpu_id;
  95. #endif /* __ASM_APIC_H */