lib/cpumask: add FORCE_NR_CPUS config option
[linux-2.6-microblaze.git] / kernel / smp.c
index 650810a..661d09a 100644 (file)
@@ -1070,7 +1070,7 @@ static int __init nrcpus(char *str)
        int nr_cpus;
 
        if (get_option(&str, &nr_cpus) && nr_cpus > 0 && nr_cpus < nr_cpu_ids)
-               nr_cpu_ids = nr_cpus;
+               set_nr_cpu_ids(nr_cpus);
 
        return 0;
 }
@@ -1088,14 +1088,16 @@ static int __init maxcpus(char *str)
 
 early_param("maxcpus", maxcpus);
 
+#if (NR_CPUS > 1) && !defined(CONFIG_FORCE_NR_CPUS)
 /* Setup number of possible processor ids */
 unsigned int nr_cpu_ids __read_mostly = NR_CPUS;
 EXPORT_SYMBOL(nr_cpu_ids);
+#endif
 
 /* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */
 void __init setup_nr_cpu_ids(void)
 {
-       nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1;
+       set_nr_cpu_ids(find_last_bit(cpumask_bits(cpu_possible_mask), NR_CPUS) + 1);
 }
 
 /* Called by boot processor to activate the rest. */