Merge with Linux 2.3.40.
[linux-2.6/linux-mips.git] / include / asm-i386 / apic.h
blob3c6e6aa4bbfcb1e3c3f9a80cdfa305173ce34cda
1 #ifndef __ASM_APIC_H
2 #define __ASM_APIC_H
4 #include <linux/config.h>
5 #include <asm/apicdef.h>
7 #define APIC_DEBUG 1
9 #ifdef CONFIG_X86_LOCAL_APIC
11 #if APIC_DEBUG
12 #define Dprintk(x...) printk(##x)
13 #else
14 #define Dprintk(x...)
15 #endif
18 * Basic functions accessing APICs.
21 extern __inline void apic_write(unsigned long reg, unsigned long v)
23 *((volatile unsigned long *)(APIC_BASE+reg))=v;
26 extern __inline unsigned long apic_read(unsigned long reg)
28 return *((volatile unsigned long *)(APIC_BASE+reg));
31 extern unsigned int apic_timer_irqs [NR_CPUS];
33 #ifdef CONFIG_X86_GOOD_APIC
34 # define FORCE_READ_AROUND_WRITE 0
35 # define apic_readaround(x)
36 #else
37 # define FORCE_READ_AROUND_WRITE 1
38 # define apic_readaround(x) apic_read(x)
39 #endif
41 #define apic_write_around(x,y) \
42 do { apic_readaround(x); apic_write(x,y); } while (0)
44 extern inline void ack_APIC_irq(void)
46 /* Clear the IPI */
48 apic_readaround(APIC_EOI);
50 * on P6+ cores (CONFIG_X86_GOOD_APIC) ack_APIC_irq() actually
51 * gets compiled as a single instruction ... yummie.
53 apic_write(APIC_EOI, 0); /* Docs say use 0 for future compatibility */
56 extern int get_maxlvt(void);
57 extern void disable_local_APIC (void);
58 extern void cache_APIC_registers (void);
59 extern void setup_local_APIC (void);
60 extern void init_apic_mappings(void);
61 extern void smp_local_timer_interrupt(struct pt_regs * regs);
62 extern void setup_APIC_clocks(void);
63 #endif
65 #endif