aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/smp.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-10-12 06:35:23 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-12 06:37:32 -0400
commit365d46dc9be9b3c833990a06f3994b1987eda578 (patch)
tree9397d1304144a288411f2118707f44ff5e862fa6 /include/asm-x86/smp.h
parent5dc64a3442b98eaa0e3730c35fcf00cf962a93e7 (diff)
parentfd048088306656824958e7783ffcee27e241b361 (diff)
Merge branch 'linus' into x86/xen
Conflicts: arch/x86/kernel/cpu/common.c arch/x86/kernel/process_64.c arch/x86/xen/enlighten.c
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 30b5146cc436..6df2615f9138 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);
@@ -164,7 +167,6 @@ extern unsigned disabled_cpus __cpuinitdata;
164 * from the initial startup. We map APIC_BASE very early in page_setup(), 167 * from the initial startup. We map APIC_BASE very early in page_setup(),
165 * so this is correct in the x86 case. 168 * so this is correct in the x86 case.
166 */ 169 */
167DECLARE_PER_CPU(int, cpu_number);
168#define raw_smp_processor_id() (x86_read_percpu(cpu_number)) 170#define raw_smp_processor_id() (x86_read_percpu(cpu_number))
169extern int safe_smp_processor_id(void); 171extern int safe_smp_processor_id(void);
170 172
@@ -187,30 +189,33 @@ extern int safe_smp_processor_id(void);
187 189
188#ifdef CONFIG_X86_LOCAL_APIC 190#ifdef CONFIG_X86_LOCAL_APIC
189 191
192#ifndef CONFIG_X86_64
190static inline int logical_smp_processor_id(void) 193static inline int logical_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_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR)); 196 return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
194} 197}
195 198
196#ifndef CONFIG_X86_64 199#include <mach_apicdef.h>
197static inline unsigned int read_apic_id(void) 200static inline unsigned int read_apic_id(void)
198{ 201{
199 return *(u32 *)(APIC_BASE + APIC_ID); 202 unsigned int reg;
203
204 reg = *(u32 *)(APIC_BASE + APIC_ID);
205
206 return GET_APIC_ID(reg);
200} 207}
201#else
202extern unsigned int read_apic_id(void);
203#endif 208#endif
204 209
205 210
206# ifdef APIC_DEFINITION 211# if defined(APIC_DEFINITION) || defined(CONFIG_X86_64)
207extern int hard_smp_processor_id(void); 212extern int hard_smp_processor_id(void);
208# else 213# else
209# include <mach_apicdef.h> 214#include <mach_apicdef.h>
210static inline int hard_smp_processor_id(void) 215static inline int hard_smp_processor_id(void)
211{ 216{
212 /* we don't want to mark this access volatile - bad code generation */ 217 /* we don't want to mark this access volatile - bad code generation */
213 return GET_APIC_ID(read_apic_id()); 218 return read_apic_id();
214} 219}
215# endif /* APIC_DEFINITION */ 220# endif /* APIC_DEFINITION */
216 221
@@ -223,4 +228,4 @@ static inline int hard_smp_processor_id(void)
223#endif /* CONFIG_X86_LOCAL_APIC */ 228#endif /* CONFIG_X86_LOCAL_APIC */
224 229
225#endif /* __ASSEMBLY__ */ 230#endif /* __ASSEMBLY__ */
226#endif 231#endif /* ASM_X86__SMP_H */