x86: move this_cpu_offset
authorBrian Gerst <brgerst@gmail.com>
Tue, 27 Jan 2009 03:56:48 +0000 (12:56 +0900)
committerTejun Heo <tj@kernel.org>
Tue, 27 Jan 2009 03:56:48 +0000 (12:56 +0900)
Impact: Small cleanup

Define BOOT_PERCPU_OFFSET and use it for this_cpu_offset and
__per_cpu_offset initializers.

Signed-off-by: Brian Gerst <brgerst@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
arch/x86/kernel/setup_percpu.c
arch/x86/kernel/smpcommon.c

index f30ff691c34de780bf052ef4b8d2f7b966254595..36c2e81dfc3c5c0a435dbc8b77fec1449977ab57 100644 (file)
 DEFINE_PER_CPU(int, cpu_number);
 EXPORT_PER_CPU_SYMBOL(cpu_number);
 
+#ifdef CONFIG_X86_64
+#define BOOT_PERCPU_OFFSET ((unsigned long)__per_cpu_load)
+#else
+#define BOOT_PERCPU_OFFSET 0
+#endif
+
+DEFINE_PER_CPU(unsigned long, this_cpu_off) = BOOT_PERCPU_OFFSET;
+EXPORT_PER_CPU_SYMBOL(this_cpu_off);
+
 #ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA
 
-#ifdef CONFIG_X86_64
 unsigned long __per_cpu_offset[NR_CPUS] __read_mostly = {
-       [0] = (unsigned long)__per_cpu_load,
+       [0] = BOOT_PERCPU_OFFSET,
 };
-#else
-unsigned long __per_cpu_offset[NR_CPUS] __read_mostly;
-#endif
 EXPORT_SYMBOL(__per_cpu_offset);
 
 /*
index add36b4e37c92d00eabe22f25ab0148febfcb2e2..5ec29a1a846558861ac64a69a6a4971583191ff3 100644 (file)
@@ -5,13 +5,6 @@
 #include <asm/smp.h>
 #include <asm/sections.h>
 
-#ifdef CONFIG_X86_64
-DEFINE_PER_CPU(unsigned long, this_cpu_off) = (unsigned long)__per_cpu_load;
-#else
-DEFINE_PER_CPU(unsigned long, this_cpu_off);
-#endif
-EXPORT_PER_CPU_SYMBOL(this_cpu_off);
-
 #ifdef CONFIG_X86_32
 /*
  * Initialize the CPU's GDT.  This is either the boot CPU doing itself