apic_32.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. #ifndef __ASM_APIC_H
  2. #define __ASM_APIC_H
  3. #include <linux/pm.h>
  4. #include <linux/delay.h>
  5. #include <asm/fixmap.h>
  6. #include <asm/apicdef.h>
  7. #include <asm/processor.h>
  8. #include <asm/system.h>
  9. #define Dprintk(x...)
  10. /*
  11. * Debugging macros
  12. */
  13. #define APIC_QUIET 0
  14. #define APIC_VERBOSE 1
  15. #define APIC_DEBUG 2
  16. extern int apic_verbosity;
  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. extern void generic_apic_probe(void);
  28. #ifdef CONFIG_X86_LOCAL_APIC
  29. /*
  30. * Basic functions accessing APICs.
  31. */
  32. #ifdef CONFIG_PARAVIRT
  33. #include <asm/paravirt.h>
  34. #else
  35. #define apic_write native_apic_write
  36. #define apic_write_atomic native_apic_write_atomic
  37. #define apic_read native_apic_read
  38. #define setup_boot_clock setup_boot_APIC_clock
  39. #define setup_secondary_clock setup_secondary_APIC_clock
  40. #endif
  41. static __inline fastcall void native_apic_write(unsigned long reg,
  42. unsigned long v)
  43. {
  44. *((volatile unsigned long *)(APIC_BASE+reg)) = v;
  45. }
  46. static __inline fastcall void native_apic_write_atomic(unsigned long reg,
  47. unsigned long v)
  48. {
  49. xchg((volatile unsigned long *)(APIC_BASE+reg), v);
  50. }
  51. static __inline fastcall unsigned long native_apic_read(unsigned long reg)
  52. {
  53. return *((volatile unsigned long *)(APIC_BASE+reg));
  54. }
  55. void apic_wait_icr_idle(void);
  56. unsigned long safe_apic_wait_icr_idle(void);
  57. int get_physical_broadcast(void);
  58. #ifdef CONFIG_X86_GOOD_APIC
  59. # define FORCE_READ_AROUND_WRITE 0
  60. # define apic_read_around(x)
  61. # define apic_write_around(x,y) apic_write((x),(y))
  62. #else
  63. # define FORCE_READ_AROUND_WRITE 1
  64. # define apic_read_around(x) apic_read(x)
  65. # define apic_write_around(x,y) apic_write_atomic((x),(y))
  66. #endif
  67. static inline void ack_APIC_irq(void)
  68. {
  69. /*
  70. * ack_APIC_irq() actually gets compiled as a single instruction:
  71. * - a single rmw on Pentium/82489DX
  72. * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC)
  73. * ... yummie.
  74. */
  75. /* Docs say use 0 for future compatibility */
  76. apic_write_around(APIC_EOI, 0);
  77. }
  78. extern int lapic_get_maxlvt(void);
  79. extern void clear_local_APIC(void);
  80. extern void connect_bsp_APIC (void);
  81. extern void disconnect_bsp_APIC (int virt_wire_setup);
  82. extern void disable_local_APIC (void);
  83. extern void lapic_shutdown (void);
  84. extern int verify_local_APIC (void);
  85. extern void cache_APIC_registers (void);
  86. extern void sync_Arb_IDs (void);
  87. extern void init_bsp_APIC (void);
  88. extern void setup_local_APIC (void);
  89. extern void init_apic_mappings (void);
  90. extern void smp_local_timer_interrupt (void);
  91. extern void setup_boot_APIC_clock (void);
  92. extern void setup_secondary_APIC_clock (void);
  93. extern int APIC_init_uniprocessor (void);
  94. extern void enable_NMI_through_LVT0 (void * dummy);
  95. #define ARCH_APICTIMER_STOPS_ON_C3 1
  96. extern int timer_over_8254;
  97. extern int local_apic_timer_c2_ok;
  98. extern int local_apic_timer_disabled;
  99. #else /* !CONFIG_X86_LOCAL_APIC */
  100. static inline void lapic_shutdown(void) { }
  101. #endif /* !CONFIG_X86_LOCAL_APIC */
  102. #endif /* __ASM_APIC_H */