Commit 3b419089 authored by travis@sgi.com's avatar travis@sgi.com Committed by Ingo Molnar

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: default avatarMike Travis <travis@sgi.com>
Reviewed-by: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 30964d54
...@@ -24,17 +24,10 @@ ...@@ -24,17 +24,10 @@
#include <acpi/acpi_bus.h> #include <acpi/acpi_bus.h>
#endif #endif
/* /* which logical CPU number maps to which CPU (physical APIC ID) */
* which logical CPU number maps to which CPU (physical APIC ID)
*
* The following static array is used during kernel startup
* and the x86_cpu_to_apicid_ptr contains the address of the
* array during this time. Is it zeroed when the per_cpu
* data area is removed.
*/
u16 x86_cpu_to_apicid_init[NR_CPUS] __initdata u16 x86_cpu_to_apicid_init[NR_CPUS] __initdata
= { [0 ... NR_CPUS-1] = BAD_APICID }; = { [0 ... NR_CPUS-1] = BAD_APICID };
void *x86_cpu_to_apicid_ptr; void *x86_cpu_to_apicid_early_ptr;
DEFINE_PER_CPU(u16, x86_cpu_to_apicid) = BAD_APICID; DEFINE_PER_CPU(u16, x86_cpu_to_apicid) = BAD_APICID;
EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid); EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid);
......
...@@ -125,14 +125,9 @@ static void __cpuinit MP_processor_info(struct mpc_config_processor *m) ...@@ -125,14 +125,9 @@ static void __cpuinit MP_processor_info(struct mpc_config_processor *m)
cpu = 0; cpu = 0;
} }
bios_cpu_apicid[cpu] = m->mpc_apicid; bios_cpu_apicid[cpu] = m->mpc_apicid;
/* /* are we being called early in kernel startup? */
* We get called early in the the start_kernel initialization if (x86_cpu_to_apicid_early_ptr) {
* process when the per_cpu data area is not yet setup, so we u16 *x86_cpu_to_apicid = (u16 *)x86_cpu_to_apicid_early_ptr;
* use a static array that is removed after the per_cpu data
* area is created.
*/
if (x86_cpu_to_apicid_ptr) {
u16 *x86_cpu_to_apicid = (u16 *)x86_cpu_to_apicid_ptr;
x86_cpu_to_apicid[cpu] = m->mpc_apicid; x86_cpu_to_apicid[cpu] = m->mpc_apicid;
} else { } else {
per_cpu(x86_cpu_to_apicid, cpu) = m->mpc_apicid; per_cpu(x86_cpu_to_apicid, cpu) = m->mpc_apicid;
......
...@@ -360,7 +360,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -360,7 +360,7 @@ void __init setup_arch(char **cmdline_p)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* setup to use the static apicid table during kernel startup */ /* setup to use the static apicid table during kernel startup */
x86_cpu_to_apicid_ptr = (void *)&x86_cpu_to_apicid_init; x86_cpu_to_apicid_early_ptr = (void *)&x86_cpu_to_apicid_init;
#endif #endif
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
......
...@@ -91,15 +91,10 @@ static cpumask_t smp_commenced_mask; ...@@ -91,15 +91,10 @@ static cpumask_t smp_commenced_mask;
DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info); DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info);
EXPORT_PER_CPU_SYMBOL(cpu_info); EXPORT_PER_CPU_SYMBOL(cpu_info);
/* /* which logical CPU number maps to which CPU (physical APIC ID) */
* The following static array is used during kernel startup
* and the x86_cpu_to_apicid_ptr contains the address of the
* array during this time. Is it zeroed when the per_cpu
* data area is removed.
*/
u8 x86_cpu_to_apicid_init[NR_CPUS] __initdata = u8 x86_cpu_to_apicid_init[NR_CPUS] __initdata =
{ [0 ... NR_CPUS-1] = BAD_APICID }; { [0 ... NR_CPUS-1] = BAD_APICID };
void *x86_cpu_to_apicid_ptr; void *x86_cpu_to_apicid_early_ptr;
DEFINE_PER_CPU(u8, x86_cpu_to_apicid) = BAD_APICID; DEFINE_PER_CPU(u8, x86_cpu_to_apicid) = BAD_APICID;
EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid); EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid);
......
...@@ -852,23 +852,25 @@ static int __init smp_sanity_check(unsigned max_cpus) ...@@ -852,23 +852,25 @@ static int __init smp_sanity_check(unsigned max_cpus)
} }
/* /*
* Copy apicid's found by MP_processor_info from initial array to the per cpu * Copy data used in early init routines from the initial arrays to the
* data area. The x86_cpu_to_apicid_init array is then expendable and the * per cpu data areas. These arrays then become expendable and the
* x86_cpu_to_apicid_ptr is zeroed indicating that the static array is no * *_ptrs are zeroed indicating that the static arrays are gone.
* longer available.
*/ */
void __init smp_set_apicids(void) void __init smp_set_apicids(void)
{ {
int cpu; int cpu;
for_each_cpu_mask(cpu, cpu_possible_map) { for_each_possible_cpu(cpu) {
if (per_cpu_offset(cpu)) if (per_cpu_offset(cpu))
per_cpu(x86_cpu_to_apicid, cpu) = per_cpu(x86_cpu_to_apicid, cpu) =
x86_cpu_to_apicid_init[cpu]; x86_cpu_to_apicid_init[cpu];
else
printk(KERN_NOTICE "per_cpu_offset zero for cpu %d\n",
cpu);
} }
/* indicate the static array will be going away soon */ /* indicate the early static arrays are gone */
x86_cpu_to_apicid_ptr = NULL; x86_cpu_to_apicid_early_ptr = NULL;
} }
static void __init smp_cpu_index_default(void) static void __init smp_cpu_index_default(void)
......
...@@ -30,7 +30,7 @@ extern void (*mtrr_hook) (void); ...@@ -30,7 +30,7 @@ extern void (*mtrr_hook) (void);
extern void zap_low_mappings (void); extern void zap_low_mappings (void);
extern u8 __initdata x86_cpu_to_apicid_init[]; extern u8 __initdata x86_cpu_to_apicid_init[];
extern void *x86_cpu_to_apicid_ptr; extern void *x86_cpu_to_apicid_early_ptr;
DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
DECLARE_PER_CPU(cpumask_t, cpu_core_map); DECLARE_PER_CPU(cpumask_t, cpu_core_map);
......
...@@ -27,7 +27,7 @@ extern int smp_call_function_mask(cpumask_t mask, void (*func)(void *), ...@@ -27,7 +27,7 @@ extern int smp_call_function_mask(cpumask_t mask, void (*func)(void *),
void *info, int wait); void *info, int wait);
extern u16 __initdata x86_cpu_to_apicid_init[]; extern u16 __initdata x86_cpu_to_apicid_init[];
extern void *x86_cpu_to_apicid_ptr; extern void *x86_cpu_to_apicid_early_ptr;
extern u16 bios_cpu_apicid[]; extern u16 bios_cpu_apicid[];
DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment