aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/topology.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-03-13 00:19:52 -0400
committerRusty Russell <rusty@rustcorp.com.au>2009-03-13 00:19:52 -0400
commit71ee73e72228775a076a502b3c92028fa59e2889 (patch)
treee83e89f01fc7e1ae22719bd8e84092002c28b2b0 /arch/x86/include/asm/topology.h
parentb9c4398ed43a7ed023e091610c23ba7412aec2a8 (diff)
x86: unify 32 and 64-bit node_to_cpumask_map
Impact: cleanup We take the 64-bit code and use it on 32-bit as well. The new file is called mm/numa.c. In a minor cleanup, we use cpu_none_mask instead of declaring a local cpu_mask_none. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'arch/x86/include/asm/topology.h')
-rw-r--r--arch/x86/include/asm/topology.h30
1 files changed, 11 insertions, 19 deletions
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index 216a960d4f10..dc31d929da04 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -44,9 +44,6 @@
44 44
45#ifdef CONFIG_X86_32 45#ifdef CONFIG_X86_32
46 46
47/* Mappings between node number and cpus on that node. */
48extern cpumask_t node_to_cpumask_map[];
49
50/* Mappings between logical cpu number and node number */ 47/* Mappings between logical cpu number and node number */
51extern int cpu_to_node_map[]; 48extern int cpu_to_node_map[];
52 49
@@ -57,19 +54,8 @@ static inline int cpu_to_node(int cpu)
57} 54}
58#define early_cpu_to_node(cpu) cpu_to_node(cpu) 55#define early_cpu_to_node(cpu) cpu_to_node(cpu)
59 56
60/* Returns a bitmask of CPUs on Node 'node'. */
61static inline const struct cpumask *cpumask_of_node(int node)
62{
63 return &node_to_cpumask_map[node];
64}
65
66static inline void setup_node_to_cpumask_map(void) { }
67
68#else /* CONFIG_X86_64 */ 57#else /* CONFIG_X86_64 */
69 58
70/* Mappings between node number and cpus on that node. */
71extern cpumask_t *node_to_cpumask_map;
72
73/* Mappings between logical cpu number and node number */ 59/* Mappings between logical cpu number and node number */
74DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map); 60DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map);
75 61
@@ -80,7 +66,6 @@ DECLARE_PER_CPU(int, node_number);
80#ifdef CONFIG_DEBUG_PER_CPU_MAPS 66#ifdef CONFIG_DEBUG_PER_CPU_MAPS
81extern int cpu_to_node(int cpu); 67extern int cpu_to_node(int cpu);
82extern int early_cpu_to_node(int cpu); 68extern int early_cpu_to_node(int cpu);
83extern const cpumask_t *cpumask_of_node(int node);
84 69
85#else /* !CONFIG_DEBUG_PER_CPU_MAPS */ 70#else /* !CONFIG_DEBUG_PER_CPU_MAPS */
86 71
@@ -96,18 +81,25 @@ static inline int early_cpu_to_node(int cpu)
96 return early_per_cpu(x86_cpu_to_node_map, cpu); 81 return early_per_cpu(x86_cpu_to_node_map, cpu);
97} 82}
98 83
84#endif /* !CONFIG_DEBUG_PER_CPU_MAPS */
85
86#endif /* CONFIG_X86_64 */
87
88/* Mappings between node number and cpus on that node. */
89extern cpumask_t *node_to_cpumask_map;
90
91#ifdef CONFIG_DEBUG_PER_CPU_MAPS
92extern const cpumask_t *cpumask_of_node(int node);
93#else
99/* Returns a pointer to the cpumask of CPUs on Node 'node'. */ 94/* Returns a pointer to the cpumask of CPUs on Node 'node'. */
100static inline const cpumask_t *cpumask_of_node(int node) 95static inline const cpumask_t *cpumask_of_node(int node)
101{ 96{
102 return &node_to_cpumask_map[node]; 97 return &node_to_cpumask_map[node];
103} 98}
104 99#endif
105#endif /* !CONFIG_DEBUG_PER_CPU_MAPS */
106 100
107extern void setup_node_to_cpumask_map(void); 101extern void setup_node_to_cpumask_map(void);
108 102
109#endif /* CONFIG_X86_64 */
110
111/* 103/*
112 * Returns the number of the node containing Node 'node'. This 104 * Returns the number of the node containing Node 'node'. This
113 * architecture is flat, so it is a pretty simple function! 105 * architecture is flat, so it is a pretty simple function!