aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/numa_64.h2
-rw-r--r--include/asm-x86/topology.h15
2 files changed, 13 insertions, 4 deletions
diff --git a/include/asm-x86/numa_64.h b/include/asm-x86/numa_64.h
index 941889471b52..c797cd523d2b 100644
--- a/include/asm-x86/numa_64.h
+++ b/include/asm-x86/numa_64.h
@@ -40,6 +40,4 @@ static inline void clear_node_cpumask(int cpu)
40#define clear_node_cpumask(cpu) do {} while (0) 40#define clear_node_cpumask(cpu) do {} while (0)
41#endif 41#endif
42 42
43#define NUMA_NO_NODE 0xffff
44
45#endif 43#endif
diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h
index f8706b2a3d88..e612ed8d2bc7 100644
--- a/include/asm-x86/topology.h
+++ b/include/asm-x86/topology.h
@@ -30,13 +30,24 @@
30#include <asm/mpspec.h> 30#include <asm/mpspec.h>
31 31
32/* Mappings between logical cpu number and node number */ 32/* Mappings between logical cpu number and node number */
33extern u16 cpu_to_node_map[]; 33DECLARE_PER_CPU(u16, x86_cpu_to_node_map);
34extern u16 __initdata x86_cpu_to_node_map_init[];
35extern void *x86_cpu_to_node_map_early_ptr;
34extern cpumask_t node_to_cpumask_map[]; 36extern cpumask_t node_to_cpumask_map[];
35 37
38#define NUMA_NO_NODE ((u16)(~0))
39
36/* Returns the number of the node containing CPU 'cpu' */ 40/* Returns the number of the node containing CPU 'cpu' */
37static inline int cpu_to_node(int cpu) 41static inline int cpu_to_node(int cpu)
38{ 42{
39 return cpu_to_node_map[cpu]; 43 u16 *cpu_to_node_map = (u16 *)x86_cpu_to_node_map_early_ptr;
44
45 if (cpu_to_node_map)
46 return cpu_to_node_map[cpu];
47 else if (per_cpu_offset(cpu))
48 return per_cpu(x86_cpu_to_node_map, cpu);
49 else
50 return NUMA_NO_NODE;
40} 51}
41 52
42/* 53/*