aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/mpparse.c
diff options
context:
space:
mode:
authorAshok Raj <ashok.raj@intel.com>2006-03-25 10:29:28 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 12:10:53 -0500
commit51f62e186b78f8743246a349b09be370c8735479 (patch)
treee8b4f95445a581c3844beafb45654cefff5c490d /arch/x86_64/kernel/mpparse.c
parent45948d7720e8bd0104696087c6305fdd90e3b298 (diff)
[PATCH] x86_64: cleanup allocating logical cpu numbers in x86_64
Minor cleanup to lend better for physical CPU hotplug. Earlier way of using num_processors as index doesnt fit if CPUs come and go. This makes the code little bit better to read, and helps physical hotplug use the same functions as boot. Reserving CPU0 for BSP is too late to be done in smp_prepare_boot_cpu(). Since logical assignments from MADT is already done via setup_arch()->acpi_boot_init()->parse lapic Signed-off-by: Ashok Raj <ashok.raj@intel.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/mpparse.c')
-rw-r--r--arch/x86_64/kernel/mpparse.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
index 9013a90b5c2e..b17cf3eba359 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86_64/kernel/mpparse.c
@@ -106,11 +106,11 @@ static int __init mpf_checksum(unsigned char *mp, int len)
106 return sum & 0xFF; 106 return sum & 0xFF;
107} 107}
108 108
109static void __init MP_processor_info (struct mpc_config_processor *m) 109static void __cpuinit MP_processor_info (struct mpc_config_processor *m)
110{ 110{
111 int cpu; 111 int cpu;
112 unsigned char ver; 112 unsigned char ver;
113 static int found_bsp=0; 113 cpumask_t tmp_map;
114 114
115 if (!(m->mpc_cpuflag & CPU_ENABLED)) { 115 if (!(m->mpc_cpuflag & CPU_ENABLED)) {
116 disabled_cpus++; 116 disabled_cpus++;
@@ -133,8 +133,10 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
133 return; 133 return;
134 } 134 }
135 135
136 cpu = num_processors++; 136 num_processors++;
137 137 cpus_complement(tmp_map, cpu_present_map);
138 cpu = first_cpu(tmp_map);
139
138#if MAX_APICS < 255 140#if MAX_APICS < 255
139 if ((int)m->mpc_apicid > MAX_APICS) { 141 if ((int)m->mpc_apicid > MAX_APICS) {
140 printk(KERN_ERR "Processor #%d INVALID. (Max ID: %d).\n", 142 printk(KERN_ERR "Processor #%d INVALID. (Max ID: %d).\n",
@@ -160,12 +162,7 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
160 * entry is BSP, and so on. 162 * entry is BSP, and so on.
161 */ 163 */
162 cpu = 0; 164 cpu = 0;
163 165 }
164 bios_cpu_apicid[0] = m->mpc_apicid;
165 x86_cpu_to_apicid[0] = m->mpc_apicid;
166 found_bsp = 1;
167 } else
168 cpu = num_processors - found_bsp;
169 bios_cpu_apicid[cpu] = m->mpc_apicid; 166 bios_cpu_apicid[cpu] = m->mpc_apicid;
170 x86_cpu_to_apicid[cpu] = m->mpc_apicid; 167 x86_cpu_to_apicid[cpu] = m->mpc_apicid;
171 168
@@ -691,7 +688,7 @@ void __init mp_register_lapic_address (
691} 688}
692 689
693 690
694void __init mp_register_lapic ( 691void __cpuinit mp_register_lapic (
695 u8 id, 692 u8 id,
696 u8 enabled) 693 u8 enabled)
697{ 694{