apic_64.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 u32 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 lapic_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 void lapic_shutdown(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(void);
  67. extern void setup_boot_APIC_clock(void);
  68. extern void setup_secondary_APIC_clock(void);
  69. extern int APIC_init_uniprocessor(void);
  70. extern void setup_apic_routing(void);
  71. extern void setup_APIC_extended_lvt(unsigned char lvt_off, unsigned char vector,
  72. unsigned char msg_type, unsigned char mask);
  73. extern int apic_is_clustered_box(void);
  74. #define ARCH_APICTIMER_STOPS_ON_C3 1
  75. extern unsigned boot_cpu_id;
  76. extern int local_apic_timer_c2_ok;
  77. #endif /* __ASM_APIC_H */