diff options
Diffstat (limited to 'include/asm-x86/smp.h')
-rw-r--r-- | include/asm-x86/smp.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/asm-x86/smp.h b/include/asm-x86/smp.h index 04f84f4e2c8b..29324c103341 100644 --- a/include/asm-x86/smp.h +++ b/include/asm-x86/smp.h | |||
@@ -167,30 +167,33 @@ extern int safe_smp_processor_id(void); | |||
167 | 167 | ||
168 | #ifdef CONFIG_X86_LOCAL_APIC | 168 | #ifdef CONFIG_X86_LOCAL_APIC |
169 | 169 | ||
170 | #ifndef CONFIG_X86_64 | ||
170 | static inline int logical_smp_processor_id(void) | 171 | static inline int logical_smp_processor_id(void) |
171 | { | 172 | { |
172 | /* we don't want to mark this access volatile - bad code generation */ | 173 | /* we don't want to mark this access volatile - bad code generation */ |
173 | return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR)); | 174 | return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR)); |
174 | } | 175 | } |
175 | 176 | ||
176 | #ifndef CONFIG_X86_64 | 177 | #include <mach_apicdef.h> |
177 | static inline unsigned int read_apic_id(void) | 178 | static inline unsigned int read_apic_id(void) |
178 | { | 179 | { |
179 | return *(u32 *)(APIC_BASE + APIC_ID); | 180 | unsigned int reg; |
181 | |||
182 | reg = *(u32 *)(APIC_BASE + APIC_ID); | ||
183 | |||
184 | return GET_APIC_ID(reg); | ||
180 | } | 185 | } |
181 | #else | ||
182 | extern unsigned int read_apic_id(void); | ||
183 | #endif | 186 | #endif |
184 | 187 | ||
185 | 188 | ||
186 | # ifdef APIC_DEFINITION | 189 | # if defined(APIC_DEFINITION) || defined(CONFIG_X86_64) |
187 | extern int hard_smp_processor_id(void); | 190 | extern int hard_smp_processor_id(void); |
188 | # else | 191 | # else |
189 | # include <mach_apicdef.h> | 192 | #include <mach_apicdef.h> |
190 | static inline int hard_smp_processor_id(void) | 193 | static inline int hard_smp_processor_id(void) |
191 | { | 194 | { |
192 | /* we don't want to mark this access volatile - bad code generation */ | 195 | /* we don't want to mark this access volatile - bad code generation */ |
193 | return GET_APIC_ID(read_apic_id()); | 196 | return read_apic_id(); |
194 | } | 197 | } |
195 | # endif /* APIC_DEFINITION */ | 198 | # endif /* APIC_DEFINITION */ |
196 | 199 | ||