aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/smp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/smp.h')
-rw-r--r--include/asm-x86/smp.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/include/asm-x86/smp.h b/include/asm-x86/smp.h
index 3c877f74f279..29324c103341 100644
--- a/include/asm-x86/smp.h
+++ b/include/asm-x86/smp.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_SMP_H_ 1#ifndef ASM_X86__SMP_H
2#define _ASM_X86_SMP_H_ 2#define ASM_X86__SMP_H
3#ifndef __ASSEMBLY__ 3#ifndef __ASSEMBLY__
4#include <linux/cpumask.h> 4#include <linux/cpumask.h>
5#include <linux/init.h> 5#include <linux/init.h>
@@ -34,6 +34,9 @@ extern cpumask_t cpu_initialized;
34DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); 34DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
35DECLARE_PER_CPU(cpumask_t, cpu_core_map); 35DECLARE_PER_CPU(cpumask_t, cpu_core_map);
36DECLARE_PER_CPU(u16, cpu_llc_id); 36DECLARE_PER_CPU(u16, cpu_llc_id);
37#ifdef CONFIG_X86_32
38DECLARE_PER_CPU(int, cpu_number);
39#endif
37 40
38DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid); 41DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid);
39DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid); 42DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid);
@@ -142,7 +145,6 @@ extern unsigned disabled_cpus __cpuinitdata;
142 * from the initial startup. We map APIC_BASE very early in page_setup(), 145 * from the initial startup. We map APIC_BASE very early in page_setup(),
143 * so this is correct in the x86 case. 146 * so this is correct in the x86 case.
144 */ 147 */
145DECLARE_PER_CPU(int, cpu_number);
146#define raw_smp_processor_id() (x86_read_percpu(cpu_number)) 148#define raw_smp_processor_id() (x86_read_percpu(cpu_number))
147extern int safe_smp_processor_id(void); 149extern int safe_smp_processor_id(void);
148 150
@@ -165,30 +167,33 @@ extern int safe_smp_processor_id(void);
165 167
166#ifdef CONFIG_X86_LOCAL_APIC 168#ifdef CONFIG_X86_LOCAL_APIC
167 169
170#ifndef CONFIG_X86_64
168static inline int logical_smp_processor_id(void) 171static inline int logical_smp_processor_id(void)
169{ 172{
170 /* 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 */
171 return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR)); 174 return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
172} 175}
173 176
174#ifndef CONFIG_X86_64 177#include <mach_apicdef.h>
175static inline unsigned int read_apic_id(void) 178static inline unsigned int read_apic_id(void)
176{ 179{
177 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);
178} 185}
179#else
180extern unsigned int read_apic_id(void);
181#endif 186#endif
182 187
183 188
184# ifdef APIC_DEFINITION 189# if defined(APIC_DEFINITION) || defined(CONFIG_X86_64)
185extern int hard_smp_processor_id(void); 190extern int hard_smp_processor_id(void);
186# else 191# else
187# include <mach_apicdef.h> 192#include <mach_apicdef.h>
188static inline int hard_smp_processor_id(void) 193static inline int hard_smp_processor_id(void)
189{ 194{
190 /* 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 */
191 return GET_APIC_ID(read_apic_id()); 196 return read_apic_id();
192} 197}
193# endif /* APIC_DEFINITION */ 198# endif /* APIC_DEFINITION */
194 199
@@ -205,4 +210,4 @@ extern void cpu_uninit(void);
205#endif 210#endif
206 211
207#endif /* __ASSEMBLY__ */ 212#endif /* __ASSEMBLY__ */
208#endif 213#endif /* ASM_X86__SMP_H */