aboutsummaryrefslogtreecommitdiff
path: root/init/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/init/main.c b/init/main.c
index 1c5f6dce1bd..a92989e7836 100644
--- a/init/main.c
+++ b/init/main.c
@@ -387,14 +387,19 @@ static void __init setup_per_cpu_areas(void)
/* Called by boot processor to activate the rest. */
static void __init smp_init(void)
{
- unsigned int i;
+ unsigned int cpu;
+ unsigned highest = 0;
+
+ for_each_cpu_mask(cpu, cpu_possible_map)
+ highest = cpu;
+ nr_cpu_ids = highest + 1;
/* FIXME: This should be done in userspace --RR */
- for_each_present_cpu(i) {
+ for_each_present_cpu(cpu) {
if (num_online_cpus() >= max_cpus)
break;
- if (!cpu_online(i))
- cpu_up(i);
+ if (!cpu_online(cpu))
+ cpu_up(cpu);
}
/* Any cleanup work */