4 #include <linux/config.h>
6 #include <asm/fixmap.h>
7 #include <asm/apicdef.h>
8 #include <asm/system.h>
13 #define Dprintk(x...) printk(x)
18 #ifdef CONFIG_X86_LOCAL_APIC
21 * Basic functions accessing APICs.
24 static __inline void apic_write(unsigned long reg, unsigned long v)
26 *((volatile unsigned long *)(APIC_BASE+reg)) = v;
29 static __inline void apic_write_atomic(unsigned long reg, unsigned long v)
31 xchg((volatile unsigned long *)(APIC_BASE+reg), v);
34 static __inline unsigned long apic_read(unsigned long reg)
36 return *((volatile unsigned long *)(APIC_BASE+reg));
39 static __inline__ void apic_wait_icr_idle(void)
41 do { } while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY );
44 #ifdef CONFIG_X86_GOOD_APIC
45 # define FORCE_READ_AROUND_WRITE 0
46 # define apic_read_around(x)
47 # define apic_write_around(x,y) apic_write((x),(y))
49 # define FORCE_READ_AROUND_WRITE 1
50 # define apic_read_around(x) apic_read(x)
51 # define apic_write_around(x,y) apic_write_atomic((x),(y))
54 static inline void ack_APIC_irq(void)
57 * ack_APIC_irq() actually gets compiled as a single instruction:
58 * - a single rmw on Pentium/82489DX
59 * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC)
63 /* Docs say use 0 for future compatibility */
64 apic_write_around(APIC_EOI, 0);
67 extern void (*wait_timer_tick)(void);
69 extern int get_maxlvt(void);
70 extern void clear_local_APIC(void);
71 extern void connect_bsp_APIC (void);
72 extern void disconnect_bsp_APIC (void);
73 extern void disable_local_APIC (void);
74 extern int verify_local_APIC (void);
75 extern void cache_APIC_registers (void);
76 extern void sync_Arb_IDs (void);
77 extern void init_bsp_APIC (void);
78 extern void setup_local_APIC (void);
79 extern void init_apic_mappings (void);
80 extern void smp_local_timer_interrupt (struct pt_regs * regs);
81 extern void setup_boot_APIC_clock (void);
82 extern void setup_secondary_APIC_clock (void);
83 extern void setup_apic_nmi_watchdog (void);
84 extern int reserve_lapic_nmi(void);
85 extern void release_lapic_nmi(void);
86 extern void disable_timer_nmi_watchdog(void);
87 extern void enable_timer_nmi_watchdog(void);
88 extern void nmi_watchdog_tick (struct pt_regs * regs);
89 extern int APIC_init_uniprocessor (void);
90 extern void disable_APIC_timer(void);
91 extern void enable_APIC_timer(void);
93 extern int check_nmi_watchdog (void);
94 extern void enable_NMI_through_LVT0 (void * dummy);
96 extern unsigned int nmi_watchdog;
99 #define NMI_LOCAL_APIC 2
100 #define NMI_INVALID 3
102 #endif /* CONFIG_X86_LOCAL_APIC */
104 #endif /* __ASM_APIC_H */