diff options
Diffstat (limited to 'arch/x86/include/asm/apic.h')
-rw-r--r-- | arch/x86/include/asm/apic.h | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 42f2f837742..bb7d4792584 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
@@ -107,8 +107,7 @@ extern u32 native_safe_apic_wait_icr_idle(void); | |||
107 | extern void native_apic_icr_write(u32 low, u32 id); | 107 | extern void native_apic_icr_write(u32 low, u32 id); |
108 | extern u64 native_apic_icr_read(void); | 108 | extern u64 native_apic_icr_read(void); |
109 | 109 | ||
110 | #define EIM_8BIT_APIC_ID 0 | 110 | extern int x2apic_mode; |
111 | #define EIM_32BIT_APIC_ID 1 | ||
112 | 111 | ||
113 | #ifdef CONFIG_X86_X2APIC | 112 | #ifdef CONFIG_X86_X2APIC |
114 | /* | 113 | /* |
@@ -166,10 +165,9 @@ static inline u64 native_x2apic_icr_read(void) | |||
166 | return val; | 165 | return val; |
167 | } | 166 | } |
168 | 167 | ||
169 | extern int x2apic, x2apic_phys; | 168 | extern int x2apic_phys; |
170 | extern void check_x2apic(void); | 169 | extern void check_x2apic(void); |
171 | extern void enable_x2apic(void); | 170 | extern void enable_x2apic(void); |
172 | extern void enable_IR_x2apic(void); | ||
173 | extern void x2apic_icr_write(u32 low, u32 id); | 171 | extern void x2apic_icr_write(u32 low, u32 id); |
174 | static inline int x2apic_enabled(void) | 172 | static inline int x2apic_enabled(void) |
175 | { | 173 | { |
@@ -183,6 +181,8 @@ static inline int x2apic_enabled(void) | |||
183 | return 1; | 181 | return 1; |
184 | return 0; | 182 | return 0; |
185 | } | 183 | } |
184 | |||
185 | #define x2apic_supported() (cpu_has_x2apic) | ||
186 | #else | 186 | #else |
187 | static inline void check_x2apic(void) | 187 | static inline void check_x2apic(void) |
188 | { | 188 | { |
@@ -190,28 +190,20 @@ static inline void check_x2apic(void) | |||
190 | static inline void enable_x2apic(void) | 190 | static inline void enable_x2apic(void) |
191 | { | 191 | { |
192 | } | 192 | } |
193 | static inline void enable_IR_x2apic(void) | ||
194 | { | ||
195 | } | ||
196 | static inline int x2apic_enabled(void) | 193 | static inline int x2apic_enabled(void) |
197 | { | 194 | { |
198 | return 0; | 195 | return 0; |
199 | } | 196 | } |
200 | 197 | ||
201 | #define x2apic 0 | 198 | #define x2apic_preenabled 0 |
202 | 199 | #define x2apic_supported() 0 | |
203 | #endif | 200 | #endif |
204 | 201 | ||
205 | extern int get_physical_broadcast(void); | 202 | extern void enable_IR_x2apic(void); |
206 | 203 | ||
207 | #ifdef CONFIG_X86_X2APIC | 204 | extern int get_physical_broadcast(void); |
208 | static inline void ack_x2APIC_irq(void) | ||
209 | { | ||
210 | /* Docs say use 0 for future compatibility */ | ||
211 | native_apic_msr_write(APIC_EOI, 0); | ||
212 | } | ||
213 | #endif | ||
214 | 205 | ||
206 | extern void apic_disable(void); | ||
215 | extern int lapic_get_maxlvt(void); | 207 | extern int lapic_get_maxlvt(void); |
216 | extern void clear_local_APIC(void); | 208 | extern void clear_local_APIC(void); |
217 | extern void connect_bsp_APIC(void); | 209 | extern void connect_bsp_APIC(void); |
@@ -252,7 +244,7 @@ static inline void lapic_shutdown(void) { } | |||
252 | #define local_apic_timer_c2_ok 1 | 244 | #define local_apic_timer_c2_ok 1 |
253 | static inline void init_apic_mappings(void) { } | 245 | static inline void init_apic_mappings(void) { } |
254 | static inline void disable_local_APIC(void) { } | 246 | static inline void disable_local_APIC(void) { } |
255 | 247 | static inline void apic_disable(void) { } | |
256 | #endif /* !CONFIG_X86_LOCAL_APIC */ | 248 | #endif /* !CONFIG_X86_LOCAL_APIC */ |
257 | 249 | ||
258 | #ifdef CONFIG_X86_64 | 250 | #ifdef CONFIG_X86_64 |
@@ -410,7 +402,7 @@ static inline unsigned default_get_apic_id(unsigned long x) | |||
410 | { | 402 | { |
411 | unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR)); | 403 | unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR)); |
412 | 404 | ||
413 | if (APIC_XAPIC(ver)) | 405 | if (APIC_XAPIC(ver) || boot_cpu_has(X86_FEATURE_EXTD_APICID)) |
414 | return (x >> 24) & 0xFF; | 406 | return (x >> 24) & 0xFF; |
415 | else | 407 | else |
416 | return (x >> 24) & 0x0F; | 408 | return (x >> 24) & 0x0F; |
@@ -478,6 +470,9 @@ static inline unsigned int read_apic_id(void) | |||
478 | extern void default_setup_apic_routing(void); | 470 | extern void default_setup_apic_routing(void); |
479 | 471 | ||
480 | #ifdef CONFIG_X86_32 | 472 | #ifdef CONFIG_X86_32 |
473 | |||
474 | extern struct apic apic_default; | ||
475 | |||
481 | /* | 476 | /* |
482 | * Set up the logical destination ID. | 477 | * Set up the logical destination ID. |
483 | * | 478 | * |