diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-18 17:00:05 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-18 17:00:05 -0400 |
commit | 453c1404c5273a30d715e5a83372a78cff70b6d9 (patch) | |
tree | 94a5a3abd85137c4def416a84a45989751260f20 /include/asm-x86/apic.h | |
parent | a208f37a465e222218974ab20a31b42b7b4893b2 (diff) | |
parent | 35b680557f95564f70f21a8d3f5c72e101fab260 (diff) |
Merge branch 'x86/apic' into x86/x2apic
Conflicts:
arch/x86/kernel/paravirt.c
arch/x86/kernel/smpboot.c
arch/x86/kernel/vmi_32.c
arch/x86/lguest/boot.c
arch/x86/xen/enlighten.c
include/asm-x86/apic.h
include/asm-x86/paravirt.h
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/apic.h')
-rw-r--r-- | include/asm-x86/apic.h | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/include/asm-x86/apic.h b/include/asm-x86/apic.h index fcd2f01277b6..300b65e57240 100644 --- a/include/asm-x86/apic.h +++ b/include/asm-x86/apic.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/pm.h> | 4 | #include <linux/pm.h> |
5 | #include <linux/delay.h> | 5 | #include <linux/delay.h> |
6 | |||
7 | #include <asm/alternative.h> | ||
6 | #include <asm/fixmap.h> | 8 | #include <asm/fixmap.h> |
7 | #include <asm/apicdef.h> | 9 | #include <asm/apicdef.h> |
8 | #include <asm/processor.h> | 10 | #include <asm/processor.h> |
@@ -12,7 +14,7 @@ | |||
12 | 14 | ||
13 | #define ARCH_APICTIMER_STOPS_ON_C3 1 | 15 | #define ARCH_APICTIMER_STOPS_ON_C3 1 |
14 | 16 | ||
15 | #define Dprintk(x...) | 17 | #define Dprintk printk |
16 | 18 | ||
17 | /* | 19 | /* |
18 | * Debugging macros | 20 | * Debugging macros |
@@ -37,7 +39,7 @@ extern void generic_apic_probe(void); | |||
37 | 39 | ||
38 | #ifdef CONFIG_X86_LOCAL_APIC | 40 | #ifdef CONFIG_X86_LOCAL_APIC |
39 | 41 | ||
40 | extern int apic_verbosity; | 42 | extern unsigned int apic_verbosity; |
41 | extern int local_apic_timer_c2_ok; | 43 | extern int local_apic_timer_c2_ok; |
42 | 44 | ||
43 | extern int ioapic_force; | 45 | extern int ioapic_force; |
@@ -57,12 +59,11 @@ extern int is_vsmp_box(void); | |||
57 | 59 | ||
58 | static inline void native_apic_mem_write(u32 reg, u32 v) | 60 | static inline void native_apic_mem_write(u32 reg, u32 v) |
59 | { | 61 | { |
60 | *((volatile u32 *)(APIC_BASE + reg)) = v; | 62 | volatile u32 *addr = (volatile u32 *)(APIC_BASE + reg); |
61 | } | ||
62 | 63 | ||
63 | static inline void native_apic_mem_write_atomic(u32 reg, u32 v) | 64 | alternative_io("movl %0, %1", "xchgl %0, %1", X86_FEATURE_11AP, |
64 | { | 65 | ASM_OUTPUT2("=r" (v), "=m" (*addr)), |
65 | (void)xchg((u32 *)(APIC_BASE + reg), v); | 66 | ASM_OUTPUT2("0" (v), "m" (*addr))); |
66 | } | 67 | } |
67 | 68 | ||
68 | static inline u32 native_apic_mem_read(u32 reg) | 69 | static inline u32 native_apic_mem_read(u32 reg) |
@@ -101,7 +102,6 @@ extern void x2apic_icr_write(u32 low, u32 id); | |||
101 | struct apic_ops { | 102 | struct apic_ops { |
102 | u32 (*read)(u32 reg); | 103 | u32 (*read)(u32 reg); |
103 | void (*write)(u32 reg, u32 v); | 104 | void (*write)(u32 reg, u32 v); |
104 | void (*write_atomic)(u32 reg, u32 v); | ||
105 | u64 (*icr_read)(void); | 105 | u64 (*icr_read)(void); |
106 | void (*icr_write)(u32 low, u32 high); | 106 | void (*icr_write)(u32 low, u32 high); |
107 | void (*wait_icr_idle)(void); | 107 | void (*wait_icr_idle)(void); |
@@ -112,7 +112,6 @@ extern struct apic_ops *apic_ops; | |||
112 | 112 | ||
113 | #define apic_read (apic_ops->read) | 113 | #define apic_read (apic_ops->read) |
114 | #define apic_write (apic_ops->write) | 114 | #define apic_write (apic_ops->write) |
115 | #define apic_write_atomic (apic_ops->write_atomic) | ||
116 | #define apic_icr_read (apic_ops->icr_read) | 115 | #define apic_icr_read (apic_ops->icr_read) |
117 | #define apic_icr_write (apic_ops->icr_write) | 116 | #define apic_icr_write (apic_ops->icr_write) |
118 | #define apic_wait_icr_idle (apic_ops->wait_icr_idle) | 117 | #define apic_wait_icr_idle (apic_ops->wait_icr_idle) |
@@ -120,16 +119,6 @@ extern struct apic_ops *apic_ops; | |||
120 | 119 | ||
121 | extern int get_physical_broadcast(void); | 120 | extern int get_physical_broadcast(void); |
122 | 121 | ||
123 | #ifdef CONFIG_X86_GOOD_APIC | ||
124 | # define FORCE_READ_AROUND_WRITE 0 | ||
125 | # define apic_read_around(x) | ||
126 | # define apic_write_around(x, y) apic_write((x), (y)) | ||
127 | #else | ||
128 | # define FORCE_READ_AROUND_WRITE 1 | ||
129 | # define apic_read_around(x) apic_read(x) | ||
130 | # define apic_write_around(x, y) apic_write_atomic((x), (y)) | ||
131 | #endif | ||
132 | |||
133 | #ifdef CONFIG_X86_64 | 122 | #ifdef CONFIG_X86_64 |
134 | static inline void ack_x2APIC_irq(void) | 123 | static inline void ack_x2APIC_irq(void) |
135 | { | 124 | { |
@@ -150,7 +139,7 @@ static inline void ack_APIC_irq(void) | |||
150 | 139 | ||
151 | /* Docs say use 0 for future compatibility */ | 140 | /* Docs say use 0 for future compatibility */ |
152 | #ifdef CONFIG_X86_32 | 141 | #ifdef CONFIG_X86_32 |
153 | apic_write_around(APIC_EOI, 0); | 142 | apic_write(APIC_EOI, 0); |
154 | #else | 143 | #else |
155 | native_apic_mem_write(APIC_EOI, 0); | 144 | native_apic_mem_write(APIC_EOI, 0); |
156 | #endif | 145 | #endif |