diff options
author | Mike Travis <travis@sgi.com> | 2007-10-19 14:35:03 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2007-10-19 14:35:03 -0400 |
commit | 71fff5e6ca1b738ac4742580e4c0ff79d906f6c8 (patch) | |
tree | 390e67123d684ab7f490291db987e097e5b3c728 /include/asm-x86/smp_64.h | |
parent | dbeb2be21d678c49a8d8bbf774903df15dd55474 (diff) |
x86: convert cpu_to_apicid to be a per cpu variable
This patch converts the x86_cpu_to_apicid array to be a per cpu
variable. This saves sizeof(apicid) * NR unused cpus. Access is mostly
from startup and CPU HOTPLUG functions.
MP_processor_info() is one of the functions that require access to the
x86_cpu_to_apicid array before the per_cpu data area is setup. For this
case, a pointer to the __initdata array is initialized in setup_arch()
and removed in smp_prepare_cpus() after the per_cpu data area is
initialized.
A second change is included to change the initial array value of ARCH
i386 from 0xff to BAD_APICID to be consistent with ARCH x86_64.
Signed-off-by: Mike Travis <travis@sgi.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/smp_64.h')
-rw-r--r-- | include/asm-x86/smp_64.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/asm-x86/smp_64.h b/include/asm-x86/smp_64.h index 9d35018e54fe..f1545704e24e 100644 --- a/include/asm-x86/smp_64.h +++ b/include/asm-x86/smp_64.h | |||
@@ -86,7 +86,9 @@ static inline int hard_smp_processor_id(void) | |||
86 | * Some lowlevel functions might want to know about | 86 | * Some lowlevel functions might want to know about |
87 | * the real APIC ID <-> CPU # mapping. | 87 | * the real APIC ID <-> CPU # mapping. |
88 | */ | 88 | */ |
89 | extern u8 x86_cpu_to_apicid[NR_CPUS]; /* physical ID */ | 89 | extern u8 __initdata x86_cpu_to_apicid_init[]; |
90 | extern void *x86_cpu_to_apicid_ptr; | ||
91 | DECLARE_PER_CPU(u8, x86_cpu_to_apicid); /* physical ID */ | ||
90 | extern u8 bios_cpu_apicid[]; | 92 | extern u8 bios_cpu_apicid[]; |
91 | 93 | ||
92 | static inline int cpu_present_to_apicid(int mps_cpu) | 94 | static inline int cpu_present_to_apicid(int mps_cpu) |
@@ -117,7 +119,7 @@ static __inline int logical_smp_processor_id(void) | |||
117 | } | 119 | } |
118 | 120 | ||
119 | #ifdef CONFIG_SMP | 121 | #ifdef CONFIG_SMP |
120 | #define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu] | 122 | #define cpu_physical_id(cpu) per_cpu(x86_cpu_to_apicid, cpu) |
121 | #else | 123 | #else |
122 | #define cpu_physical_id(cpu) boot_cpu_id | 124 | #define cpu_physical_id(cpu) boot_cpu_id |
123 | #endif /* !CONFIG_SMP */ | 125 | #endif /* !CONFIG_SMP */ |