diff options
Diffstat (limited to 'include/asm-x86/topology.h')
-rw-r--r-- | include/asm-x86/topology.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h index c0e6ff7671ea..1f97758de4ab 100644 --- a/include/asm-x86/topology.h +++ b/include/asm-x86/topology.h | |||
@@ -57,10 +57,16 @@ static inline int cpu_to_node(int cpu) | |||
57 | } | 57 | } |
58 | #define early_cpu_to_node(cpu) cpu_to_node(cpu) | 58 | #define early_cpu_to_node(cpu) cpu_to_node(cpu) |
59 | 59 | ||
60 | /* Returns a bitmask of CPUs on Node 'node'. */ | ||
61 | static inline cpumask_t node_to_cpumask(int node) | ||
62 | { | ||
63 | return node_to_cpumask_map[node]; | ||
64 | } | ||
65 | |||
60 | #else /* CONFIG_X86_64 */ | 66 | #else /* CONFIG_X86_64 */ |
61 | 67 | ||
62 | /* Mappings between node number and cpus on that node. */ | 68 | /* Mappings between node number and cpus on that node. */ |
63 | extern cpumask_t node_to_cpumask_map[]; | 69 | extern cpumask_t *node_to_cpumask_map; |
64 | 70 | ||
65 | /* Mappings between logical cpu number and node number */ | 71 | /* Mappings between logical cpu number and node number */ |
66 | DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map); | 72 | DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map); |
@@ -104,7 +110,6 @@ static inline cpumask_t node_to_cpumask(int node) | |||
104 | } | 110 | } |
105 | 111 | ||
106 | #endif /* !CONFIG_DEBUG_PER_CPU_MAPS */ | 112 | #endif /* !CONFIG_DEBUG_PER_CPU_MAPS */ |
107 | #endif /* CONFIG_X86_64 */ | ||
108 | 113 | ||
109 | /* Replace default node_to_cpumask_ptr with optimized version */ | 114 | /* Replace default node_to_cpumask_ptr with optimized version */ |
110 | #define node_to_cpumask_ptr(v, node) \ | 115 | #define node_to_cpumask_ptr(v, node) \ |
@@ -113,12 +118,7 @@ static inline cpumask_t node_to_cpumask(int node) | |||
113 | #define node_to_cpumask_ptr_next(v, node) \ | 118 | #define node_to_cpumask_ptr_next(v, node) \ |
114 | v = _node_to_cpumask_ptr(node) | 119 | v = _node_to_cpumask_ptr(node) |
115 | 120 | ||
116 | /* Returns the number of the first CPU on Node 'node'. */ | 121 | #endif /* CONFIG_X86_64 */ |
117 | static inline int node_to_first_cpu(int node) | ||
118 | { | ||
119 | node_to_cpumask_ptr(mask, node); | ||
120 | return first_cpu(*mask); | ||
121 | } | ||
122 | 122 | ||
123 | /* | 123 | /* |
124 | * Returns the number of the node containing Node 'node'. This | 124 | * Returns the number of the node containing Node 'node'. This |
@@ -204,6 +204,15 @@ static inline int node_to_first_cpu(int node) | |||
204 | 204 | ||
205 | #include <asm-generic/topology.h> | 205 | #include <asm-generic/topology.h> |
206 | 206 | ||
207 | #ifdef CONFIG_NUMA | ||
208 | /* Returns the number of the first CPU on Node 'node'. */ | ||
209 | static inline int node_to_first_cpu(int node) | ||
210 | { | ||
211 | node_to_cpumask_ptr(mask, node); | ||
212 | return first_cpu(*mask); | ||
213 | } | ||
214 | #endif | ||
215 | |||
207 | extern cpumask_t cpu_coregroup_map(int cpu); | 216 | extern cpumask_t cpu_coregroup_map(int cpu); |
208 | 217 | ||
209 | #ifdef ENABLE_TOPO_DEFINES | 218 | #ifdef ENABLE_TOPO_DEFINES |