apic_32.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. /*
  17. * Define the default level of output to be very little
  18. * This can be turned up by using apic=verbose for more
  19. * information and apic=debug for _lots_ of information.
  20. * apic_verbosity is defined in apic.c
  21. */
  22. #define apic_printk(v, s, a...) do { \
  23. if ((v) <= apic_verbosity) \
  24. printk(s, ##a); \
  25. } while (0)
  26. extern void generic_apic_probe(void);
  27. #ifdef CONFIG_X86_LOCAL_APIC
  28. extern int apic_verbosity;
  29. extern int timer_over_8254;
  30. extern int local_apic_timer_c2_ok;
  31. extern int local_apic_timer_disabled;
  32. /*
  33. * Basic functions accessing APICs.
  34. */
  35. #ifdef CONFIG_PARAVIRT
  36. #include <asm/paravirt.h>
  37. #else
  38. #define apic_write native_apic_write
  39. #define apic_write_atomic native_apic_write_atomic
  40. #define apic_read native_apic_read
  41. #define setup_boot_clock setup_boot_APIC_clock
  42. #define setup_secondary_clock setup_secondary_APIC_clock
  43. #endif
  44. static __inline fastcall void native_apic_write(unsigned long reg, u32 v)
  45. {
  46. *((volatile u32 *)(APIC_BASE + reg)) = v;
  47. }
  48. static __inline fastcall void native_apic_write_atomic(unsigned long reg, u32 v)
  49. {
  50. (void) xchg((u32 *)(APIC_BASE + reg), v);
  51. }
  52. static __inline fastcall u32 native_apic_read(unsigned long reg)
  53. {
  54. return *((volatile u32 *)(APIC_BASE + reg));
  55. }
  56. extern void apic_wait_icr_idle(void);
  57. extern u32 safe_apic_wait_icr_idle(void);
  58. extern int get_physical_broadcast(void);
  59. #ifdef CONFIG_X86_GOOD_APIC
  60. # define FORCE_READ_AROUND_WRITE 0
  61. # define apic_read_around(x)
  62. # define apic_write_around(x,y) apic_write((x),(y))
  63. #else
  64. # define FORCE_READ_AROUND_WRITE 1
  65. # define apic_read_around(x) apic_read(x)
  66. # define apic_write_around(x,y) apic_write_atomic((x),(y))
  67. #endif
  68. static inline void ack_APIC_irq(void)
  69. {
  70. /*
  71. * ack_APIC_irq() actually gets compiled as a single instruction:
  72. * - a single rmw on Pentium/82489DX
  73. * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC)
  74. * ... yummie.
  75. */
  76. /* Docs say use 0 for future compatibility */
  77. apic_write_around(APIC_EOI, 0);
  78. }
  79. extern int lapic_get_maxlvt(void);
  80. extern void clear_local_APIC(void);
  81. extern void connect_bsp_APIC(void);
  82. extern void disconnect_bsp_APIC(int virt_wire_setup);
  83. extern void disable_local_APIC(void);
  84. extern void lapic_shutdown(void);
  85. extern int verify_local_APIC(void);
  86. extern void cache_APIC_registers(void);
  87. extern void sync_Arb_IDs(void);
  88. extern void init_bsp_APIC(void);
  89. extern void setup_local_APIC(void);
  90. extern void init_apic_mappings(void);
  91. extern void smp_local_timer_interrupt(void);
  92. extern void setup_boot_APIC_clock(void);
  93. extern void setup_secondary_APIC_clock(void);
  94. extern int APIC_init_uniprocessor(void);
  95. extern void enable_NMI_through_LVT0(void *dummy);
  96. #define ARCH_APICTIMER_STOPS_ON_C3 1
  97. #else /* !CONFIG_X86_LOCAL_APIC */
  98. static inline void lapic_shutdown(void) { }
  99. #define local_apic_timer_c2_ok 1
  100. #endif /* !CONFIG_X86_LOCAL_APIC */
  101. #endif /* __ASM_APIC_H */