x86: change NR_CPUS arrays in numa_64
[deliverable/linux.git] / include / asm-x86 / topology.h
index f8706b2a3d888ec6239a7d9ed022f5af265eddcb..e612ed8d2bc74b147edd4bbd330cfb9a4afb02f5 100644 (file)
 #include <asm/mpspec.h>
 
 /* Mappings between logical cpu number and node number */
-extern u16 cpu_to_node_map[];
+DECLARE_PER_CPU(u16, x86_cpu_to_node_map);
+extern u16 __initdata x86_cpu_to_node_map_init[];
+extern void *x86_cpu_to_node_map_early_ptr;
 extern cpumask_t node_to_cpumask_map[];
 
+#define NUMA_NO_NODE   ((u16)(~0))
+
 /* Returns the number of the node containing CPU 'cpu' */
 static inline int cpu_to_node(int cpu)
 {
-       return cpu_to_node_map[cpu];
+       u16 *cpu_to_node_map = (u16 *)x86_cpu_to_node_map_early_ptr;
+
+       if (cpu_to_node_map)
+               return cpu_to_node_map[cpu];
+       else if (per_cpu_offset(cpu))
+               return per_cpu(x86_cpu_to_node_map, cpu);
+       else
+               return NUMA_NO_NODE;
 }
 
 /*
This page took 0.024908 seconds and 5 git commands to generate.