aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authortravis@sgi.com <travis@sgi.com>2008-01-30 07:33:11 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:11 -0500
commit3b41908902df1dba141cd7de1a727bb03718a654 (patch)
tree988d687ff1a2636bcca32cb303d58421e0aa7926 /arch
parent30964d54e94229f567a7312a0e6666f9deb6a488 (diff)
x86: cleanup x86_cpu_to_apicid references
Clean up references to x86_cpu_to_apicid. Removes extraneous comments and standardizes on "x86_*_early_ptr" for the early kernel init references. Signed-off-by: Mike Travis <travis@sgi.com> Reviewed-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/genapic_64.c11
-rw-r--r--arch/x86/kernel/mpparse_64.c11
-rw-r--r--arch/x86/kernel/setup_64.c2
-rw-r--r--arch/x86/kernel/smpboot_32.c9
-rw-r--r--arch/x86/kernel/smpboot_64.c16
5 files changed, 17 insertions, 32 deletions
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c
index ac2b78f24074..4ae7b6440260 100644
--- a/arch/x86/kernel/genapic_64.c
+++ b/arch/x86/kernel/genapic_64.c
@@ -24,17 +24,10 @@
24#include <acpi/acpi_bus.h> 24#include <acpi/acpi_bus.h>
25#endif 25#endif
26 26
27/* 27/* which logical CPU number maps to which CPU (physical APIC ID) */
28 * which logical CPU number maps to which CPU (physical APIC ID)
29 *
30 * The following static array is used during kernel startup
31 * and the x86_cpu_to_apicid_ptr contains the address of the
32 * array during this time. Is it zeroed when the per_cpu
33 * data area is removed.
34 */
35u16 x86_cpu_to_apicid_init[NR_CPUS] __initdata 28u16 x86_cpu_to_apicid_init[NR_CPUS] __initdata
36 = { [0 ... NR_CPUS-1] = BAD_APICID }; 29 = { [0 ... NR_CPUS-1] = BAD_APICID };
37void *x86_cpu_to_apicid_ptr; 30void *x86_cpu_to_apicid_early_ptr;
38DEFINE_PER_CPU(u16, x86_cpu_to_apicid) = BAD_APICID; 31DEFINE_PER_CPU(u16, x86_cpu_to_apicid) = BAD_APICID;
39EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid); 32EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid);
40 33
diff --git a/arch/x86/kernel/mpparse_64.c b/arch/x86/kernel/mpparse_64.c
index 17d21e5b22d6..528ad9696d96 100644
--- a/arch/x86/kernel/mpparse_64.c
+++ b/arch/x86/kernel/mpparse_64.c
@@ -125,14 +125,9 @@ static void __cpuinit MP_processor_info(struct mpc_config_processor *m)
125 cpu = 0; 125 cpu = 0;
126 } 126 }
127 bios_cpu_apicid[cpu] = m->mpc_apicid; 127 bios_cpu_apicid[cpu] = m->mpc_apicid;
128 /* 128 /* are we being called early in kernel startup? */
129 * We get called early in the the start_kernel initialization 129 if (x86_cpu_to_apicid_early_ptr) {
130 * process when the per_cpu data area is not yet setup, so we 130 u16 *x86_cpu_to_apicid = (u16 *)x86_cpu_to_apicid_early_ptr;
131 * use a static array that is removed after the per_cpu data
132 * area is created.
133 */
134 if (x86_cpu_to_apicid_ptr) {
135 u16 *x86_cpu_to_apicid = (u16 *)x86_cpu_to_apicid_ptr;
136 x86_cpu_to_apicid[cpu] = m->mpc_apicid; 131 x86_cpu_to_apicid[cpu] = m->mpc_apicid;
137 } else { 132 } else {
138 per_cpu(x86_cpu_to_apicid, cpu) = m->mpc_apicid; 133 per_cpu(x86_cpu_to_apicid, cpu) = m->mpc_apicid;
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 12bad27d66f8..e2beb4cba15f 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -360,7 +360,7 @@ void __init setup_arch(char **cmdline_p)
360 360
361#ifdef CONFIG_SMP 361#ifdef CONFIG_SMP
362 /* setup to use the static apicid table during kernel startup */ 362 /* setup to use the static apicid table during kernel startup */
363 x86_cpu_to_apicid_ptr = (void *)&x86_cpu_to_apicid_init; 363 x86_cpu_to_apicid_early_ptr = (void *)&x86_cpu_to_apicid_init;
364#endif 364#endif
365 365
366#ifdef CONFIG_ACPI 366#ifdef CONFIG_ACPI
diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c
index 2034332ad080..915ec6267326 100644
--- a/arch/x86/kernel/smpboot_32.c
+++ b/arch/x86/kernel/smpboot_32.c
@@ -91,15 +91,10 @@ static cpumask_t smp_commenced_mask;
91DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info); 91DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info);
92EXPORT_PER_CPU_SYMBOL(cpu_info); 92EXPORT_PER_CPU_SYMBOL(cpu_info);
93 93
94/* 94/* which logical CPU number maps to which CPU (physical APIC ID) */
95 * The following static array is used during kernel startup
96 * and the x86_cpu_to_apicid_ptr contains the address of the
97 * array during this time. Is it zeroed when the per_cpu
98 * data area is removed.
99 */
100u8 x86_cpu_to_apicid_init[NR_CPUS] __initdata = 95u8 x86_cpu_to_apicid_init[NR_CPUS] __initdata =
101 { [0 ... NR_CPUS-1] = BAD_APICID }; 96 { [0 ... NR_CPUS-1] = BAD_APICID };
102void *x86_cpu_to_apicid_ptr; 97void *x86_cpu_to_apicid_early_ptr;
103DEFINE_PER_CPU(u8, x86_cpu_to_apicid) = BAD_APICID; 98DEFINE_PER_CPU(u8, x86_cpu_to_apicid) = BAD_APICID;
104EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid); 99EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid);
105 100
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c
index 50e207a8261f..a2076b5f12af 100644
--- a/arch/x86/kernel/smpboot_64.c
+++ b/arch/x86/kernel/smpboot_64.c
@@ -852,23 +852,25 @@ static int __init smp_sanity_check(unsigned max_cpus)
852} 852}
853 853
854/* 854/*
855 * Copy apicid's found by MP_processor_info from initial array to the per cpu 855 * Copy data used in early init routines from the initial arrays to the
856 * data area. The x86_cpu_to_apicid_init array is then expendable and the 856 * per cpu data areas. These arrays then become expendable and the
857 * x86_cpu_to_apicid_ptr is zeroed indicating that the static array is no 857 * *_ptrs are zeroed indicating that the static arrays are gone.
858 * longer available.
859 */ 858 */
860void __init smp_set_apicids(void) 859void __init smp_set_apicids(void)
861{ 860{
862 int cpu; 861 int cpu;
863 862
864 for_each_cpu_mask(cpu, cpu_possible_map) { 863 for_each_possible_cpu(cpu) {
865 if (per_cpu_offset(cpu)) 864 if (per_cpu_offset(cpu))
866 per_cpu(x86_cpu_to_apicid, cpu) = 865 per_cpu(x86_cpu_to_apicid, cpu) =
867 x86_cpu_to_apicid_init[cpu]; 866 x86_cpu_to_apicid_init[cpu];
867 else
868 printk(KERN_NOTICE "per_cpu_offset zero for cpu %d\n",
869 cpu);
868 } 870 }
869 871
870 /* indicate the static array will be going away soon */ 872 /* indicate the early static arrays are gone */
871 x86_cpu_to_apicid_ptr = NULL; 873 x86_cpu_to_apicid_early_ptr = NULL;
872} 874}
873 875
874static void __init smp_cpu_index_default(void) 876static void __init smp_cpu_index_default(void)