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 cd3c5f03fca..88b075c6fe8 100644 --- a/include/asm-x86/smp.h +++ b/include/asm-x86/smp.h | |||
@@ -165,30 +165,33 @@ extern int safe_smp_processor_id(void); | |||
165 | 165 | ||
166 | #ifdef CONFIG_X86_LOCAL_APIC | 166 | #ifdef CONFIG_X86_LOCAL_APIC |
167 | 167 | ||
168 | #ifndef CONFIG_X86_64 | ||
168 | static inline int logical_smp_processor_id(void) | 169 | static inline int logical_smp_processor_id(void) |
169 | { | 170 | { |
170 | /* we don't want to mark this access volatile - bad code generation */ | 171 | /* we don't want to mark this access volatile - bad code generation */ |
171 | return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR)); | 172 | return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR)); |
172 | } | 173 | } |
173 | 174 | ||
174 | #ifndef CONFIG_X86_64 | 175 | #include <mach_apicdef.h> |
175 | static inline unsigned int read_apic_id(void) | 176 | static inline unsigned int read_apic_id(void) |
176 | { | 177 | { |
177 | return *(u32 *)(APIC_BASE + APIC_ID); | 178 | unsigned int reg; |
179 | |||
180 | reg = *(u32 *)(APIC_BASE + APIC_ID); | ||
181 | |||
182 | return GET_APIC_ID(reg); | ||
178 | } | 183 | } |
179 | #else | ||
180 | extern unsigned int read_apic_id(void); | ||
181 | #endif | 184 | #endif |
182 | 185 | ||
183 | 186 | ||
184 | # ifdef APIC_DEFINITION | 187 | # if defined(APIC_DEFINITION) || defined(CONFIG_X86_64) |
185 | extern int hard_smp_processor_id(void); | 188 | extern int hard_smp_processor_id(void); |
186 | # else | 189 | # else |
187 | # include <mach_apicdef.h> | 190 | #include <mach_apicdef.h> |
188 | static inline int hard_smp_processor_id(void) | 191 | static inline int hard_smp_processor_id(void) |
189 | { | 192 | { |
190 | /* we don't want to mark this access volatile - bad code generation */ | 193 | /* we don't want to mark this access volatile - bad code generation */ |
191 | return GET_APIC_ID(read_apic_id()); | 194 | return read_apic_id(); |
192 | } | 195 | } |
193 | # endif /* APIC_DEFINITION */ | 196 | # endif /* APIC_DEFINITION */ |
194 | 197 | ||