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