]> err.no Git - linux-2.6/blobdiff - arch/x86/kernel/setup.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6] / arch / x86 / kernel / setup.c
index 01119d9b013e903c4fc79dce59b7395208810b57..c0c68c18a788dff30e0103b144cb0b76a09ec775 100644 (file)
@@ -9,11 +9,21 @@
 #include <asm/processor.h>
 #include <asm/setup.h>
 #include <asm/topology.h>
+#include <asm/mpspec.h>
 #include <asm/apicdef.h>
 
+unsigned int num_processors;
+unsigned disabled_cpus __cpuinitdata;
+/* Processor that is doing the boot up */
+unsigned int boot_cpu_physical_apicid = -1U;
+EXPORT_SYMBOL(boot_cpu_physical_apicid);
+
 DEFINE_PER_CPU(u16, x86_cpu_to_apicid) = BAD_APICID;
 EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid);
 
+/* Bitmask of physically existing CPUs */
+physid_mask_t phys_cpu_present_map;
+
 #if defined(CONFIG_HAVE_SETUP_PER_CPU_AREA) && defined(CONFIG_SMP)
 /*
  * Copy data used in early init routines from the initial arrays to the
@@ -42,6 +52,24 @@ static void __init setup_per_cpu_maps(void)
 #endif
 }
 
+#ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP
+cpumask_t *cpumask_of_cpu_map __read_mostly;
+EXPORT_SYMBOL(cpumask_of_cpu_map);
+
+/* requires nr_cpu_ids to be initialized */
+static void __init setup_cpumask_of_cpu(void)
+{
+       int i;
+
+       /* alloc_bootmem zeroes memory */
+       cpumask_of_cpu_map = alloc_bootmem_low(sizeof(cpumask_t) * nr_cpu_ids);
+       for (i = 0; i < nr_cpu_ids; i++)
+               cpu_set(i, cpumask_of_cpu_map[i]);
+}
+#else
+static inline void setup_cpumask_of_cpu(void) { }
+#endif
+
 #ifdef CONFIG_X86_32
 /*
  * Great future not-so-futuristic plan: make i386 and x86_64 do it
@@ -58,7 +86,7 @@ EXPORT_SYMBOL(__per_cpu_offset);
  */
 void __init setup_per_cpu_areas(void)
 {
-       int i;
+       int i, highest_cpu = 0;
        unsigned long size;
 
 #ifdef CONFIG_HOTPLUG_CPU
@@ -92,10 +120,18 @@ void __init setup_per_cpu_areas(void)
                __per_cpu_offset[i] = ptr - __per_cpu_start;
 #endif
                memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
+
+               highest_cpu = i;
        }
 
+       nr_cpu_ids = highest_cpu + 1;
+       printk(KERN_DEBUG "NR_CPUS: %d, nr_cpu_ids: %d\n", NR_CPUS, nr_cpu_ids);
+
        /* Setup percpu data maps */
        setup_per_cpu_maps();
+
+       /* Setup cpumask_of_cpu map */
+       setup_cpumask_of_cpu();
 }
 
 #endif