apic_64.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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/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. extern int ioapic_force;
  18. extern int disable_apic_timer;
  19. /*
  20. * Define the default level of output to be very little
  21. * This can be turned up by using apic=verbose for more
  22. * information and apic=debug for _lots_ of information.
  23. * apic_verbosity is defined in apic.c
  24. */
  25. #define apic_printk(v, s, a...) do { \
  26. if ((v) <= apic_verbosity) \
  27. printk(s, ##a); \
  28. } while (0)
  29. struct pt_regs;
  30. /*
  31. * Basic functions accessing APICs.
  32. */
  33. static __inline void apic_write(unsigned long reg, unsigned int v)
  34. {
  35. *((volatile unsigned int *)(APIC_BASE+reg)) = v;
  36. }
  37. static __inline unsigned int apic_read(unsigned long reg)
  38. {
  39. return *((volatile unsigned int *)(APIC_BASE+reg));
  40. }
  41. extern void apic_wait_icr_idle(void);
  42. extern unsigned int safe_apic_wait_icr_idle(void);
  43. static inline void ack_APIC_irq(void)
  44. {
  45. /*
  46. * ack_APIC_irq() actually gets compiled as a single instruction:
  47. * - a single rmw on Pentium/82489DX
  48. * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC)
  49. * ... yummie.
  50. */
  51. /* Docs say use 0 for future compatibility */
  52. apic_write(APIC_EOI, 0);
  53. }
  54. extern int get_maxlvt (void);
  55. extern void clear_local_APIC (void);
  56. extern void connect_bsp_APIC (void);
  57. extern void disconnect_bsp_APIC (int virt_wire_setup);
  58. extern void disable_local_APIC (void);
  59. extern int verify_local_APIC (void);
  60. extern void cache_APIC_registers (void);
  61. extern void sync_Arb_IDs (void);
  62. extern void init_bsp_APIC (void);
  63. extern void setup_local_APIC (void);
  64. extern void init_apic_mappings (void);
  65. extern void smp_local_timer_interrupt (void);
  66. extern void setup_boot_APIC_clock (void);
  67. extern void setup_secondary_APIC_clock (void);
  68. extern int APIC_init_uniprocessor (void);
  69. extern void setup_apic_routing(void);
  70. extern void setup_APIC_extended_lvt(unsigned char lvt_off, unsigned char vector,
  71. unsigned char msg_type, unsigned char mask);
  72. extern int apic_is_clustered_box(void);
  73. #define K8_APIC_EXT_LVT_BASE 0x500
  74. #define K8_APIC_EXT_INT_MSG_FIX 0x0
  75. #define K8_APIC_EXT_INT_MSG_SMI 0x2
  76. #define K8_APIC_EXT_INT_MSG_NMI 0x4
  77. #define K8_APIC_EXT_INT_MSG_EXT 0x7
  78. #define K8_APIC_EXT_LVT_ENTRY_THRESHOLD 0
  79. #define ARCH_APICTIMER_STOPS_ON_C3 1
  80. extern unsigned boot_cpu_id;
  81. extern int local_apic_timer_c2_ok;
  82. #endif /* __ASM_APIC_H */