aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup_percpu.c
diff options
context:
space:
mode:
authorBrian Gerst <brgerst@gmail.com>2009-01-18 10:38:58 -0500
committerTejun Heo <tj@kernel.org>2009-01-18 10:38:58 -0500
commitea9279066de44053d0c20ea855bc9f4706652d84 (patch)
tree73c19b9112375ee0df8373b004105f05e1a196f4 /arch/x86/kernel/setup_percpu.c
parent92d65b2371d86d40807e1dbfdccadc4d501edcde (diff)
x86-64: Move cpu number from PDA to per-cpu and consolidate with 32-bit.
tj: moved cpu_number definition out of CONFIG_HAVE_SETUP_PER_CPU_AREA for voyager. Signed-off-by: Brian Gerst <brgerst@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'arch/x86/kernel/setup_percpu.c')
-rw-r--r--arch/x86/kernel/setup_percpu.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 8b53ef83c611..258497f93f4d 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -22,6 +22,15 @@
22# define DBG(x...) 22# define DBG(x...)
23#endif 23#endif
24 24
25/*
26 * Could be inside CONFIG_HAVE_SETUP_PER_CPU_AREA with other stuff but
27 * voyager wants cpu_number too.
28 */
29#ifdef CONFIG_SMP
30DEFINE_PER_CPU(int, cpu_number);
31EXPORT_PER_CPU_SYMBOL(cpu_number);
32#endif
33
25#ifdef CONFIG_X86_LOCAL_APIC 34#ifdef CONFIG_X86_LOCAL_APIC
26unsigned int num_processors; 35unsigned int num_processors;
27unsigned disabled_cpus __cpuinitdata; 36unsigned disabled_cpus __cpuinitdata;
@@ -193,6 +202,7 @@ void __init setup_per_cpu_areas(void)
193 memcpy(ptr, __per_cpu_load, __per_cpu_end - __per_cpu_start); 202 memcpy(ptr, __per_cpu_load, __per_cpu_end - __per_cpu_start);
194 per_cpu_offset(cpu) = ptr - __per_cpu_start; 203 per_cpu_offset(cpu) = ptr - __per_cpu_start;
195 per_cpu(this_cpu_off, cpu) = per_cpu_offset(cpu); 204 per_cpu(this_cpu_off, cpu) = per_cpu_offset(cpu);
205 per_cpu(cpu_number, cpu) = cpu;
196#ifdef CONFIG_X86_64 206#ifdef CONFIG_X86_64
197 per_cpu(irq_stack_ptr, cpu) = 207 per_cpu(irq_stack_ptr, cpu) =
198 (char *)per_cpu(irq_stack, cpu) + IRQ_STACK_SIZE - 64; 208 (char *)per_cpu(irq_stack, cpu) + IRQ_STACK_SIZE - 64;