- patches.rt/0001-sched-count-of-queued-RT-tasks.patch: Delete.
[linux-flexiantxendom0-3.2.10.git] / include / asm-x86 / apic_32.h
1 #ifndef __ASM_APIC_H
2 #define __ASM_APIC_H
3
4 #include <linux/pm.h>
5 #include <linux/delay.h>
6 #ifndef CONFIG_XEN
7 #include <asm/fixmap.h>
8 #endif
9 #include <asm/apicdef.h>
10 #include <asm/processor.h>
11 #include <asm/system.h>
12
13 #define Dprintk(x...)
14
15 /*
16  * Debugging macros
17  */
18 #define APIC_QUIET   0
19 #define APIC_VERBOSE 1
20 #define APIC_DEBUG   2
21
22 extern int apic_verbosity;
23
24 /*
25  * Define the default level of output to be very little
26  * This can be turned up by using apic=verbose for more
27  * information and apic=debug for _lots_ of information.
28  * apic_verbosity is defined in apic.c
29  */
30 #define apic_printk(v, s, a...) do {       \
31                 if ((v) <= apic_verbosity) \
32                         printk(s, ##a);    \
33         } while (0)
34
35
36 extern void generic_apic_probe(void);
37
38 #if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_XEN)
39
40 /*
41  * Basic functions accessing APICs.
42  */
43 #ifdef CONFIG_PARAVIRT
44 #include <asm/paravirt.h>
45 #else
46 #define apic_write native_apic_write
47 #define apic_write_atomic native_apic_write_atomic
48 #define apic_read native_apic_read
49 #define setup_boot_clock setup_boot_APIC_clock
50 #define setup_secondary_clock setup_secondary_APIC_clock
51 #endif
52
53 static __inline fastcall void native_apic_write(unsigned long reg,
54                                                 unsigned long v)
55 {
56         *((volatile unsigned long *)(APIC_BASE+reg)) = v;
57 }
58
59 static __inline fastcall void native_apic_write_atomic(unsigned long reg,
60                                                        unsigned long v)
61 {
62         xchg((volatile unsigned long *)(APIC_BASE+reg), v);
63 }
64
65 static __inline fastcall unsigned long native_apic_read(unsigned long reg)
66 {
67         return *((volatile unsigned long *)(APIC_BASE+reg));
68 }
69
70 void apic_wait_icr_idle(void);
71 unsigned long safe_apic_wait_icr_idle(void);
72 int get_physical_broadcast(void);
73
74 #ifdef CONFIG_X86_GOOD_APIC
75 # define FORCE_READ_AROUND_WRITE 0
76 # define apic_read_around(x)
77 # define apic_write_around(x,y) apic_write((x),(y))
78 #else
79 # define FORCE_READ_AROUND_WRITE 1
80 # define apic_read_around(x) apic_read(x)
81 # define apic_write_around(x,y) apic_write_atomic((x),(y))
82 #endif
83
84 static inline void ack_APIC_irq(void)
85 {
86         /*
87          * ack_APIC_irq() actually gets compiled as a single instruction:
88          * - a single rmw on Pentium/82489DX
89          * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC)
90          * ... yummie.
91          */
92
93         /* Docs say use 0 for future compatibility */
94         apic_write_around(APIC_EOI, 0);
95 }
96
97 extern int lapic_get_maxlvt(void);
98 extern void clear_local_APIC(void);
99 extern void connect_bsp_APIC (void);
100 extern void disconnect_bsp_APIC (int virt_wire_setup);
101 extern void disable_local_APIC (void);
102 extern void lapic_shutdown (void);
103 extern int verify_local_APIC (void);
104 extern void cache_APIC_registers (void);
105 extern void sync_Arb_IDs (void);
106 extern void init_bsp_APIC (void);
107 extern void setup_local_APIC (void);
108 extern void init_apic_mappings (void);
109 extern void smp_local_timer_interrupt (void);
110 extern void setup_boot_APIC_clock (void);
111 extern void setup_secondary_APIC_clock (void);
112 extern int APIC_init_uniprocessor (void);
113
114 extern void enable_NMI_through_LVT0 (void * dummy);
115
116 #define ARCH_APICTIMER_STOPS_ON_C3      1
117
118 extern int timer_over_8254;
119 extern int local_apic_timer_c2_ok;
120
121 extern int local_apic_timer_disabled;
122
123 #else /* !CONFIG_X86_LOCAL_APIC || CONFIG_XEN */
124
125 static inline void lapic_shutdown(void) { }
126 #define local_apic_timer_c2_ok          1
127
128 #ifdef CONFIG_X86_LOCAL_APIC
129 extern int APIC_init_uniprocessor (void);
130 #endif
131
132 #endif /* !CONFIG_X86_LOCAL_APIC */
133
134 #endif /* __ASM_APIC_H */