aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/topology.h
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2008-03-25 18:06:51 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:34 -0400
commitb447a468fcd130aa8951672b6115c673c274e888 (patch)
tree3824624df1191cb1e6abbf9f9dbeca3f9d8c17f8 /include/asm-x86/topology.h
parenta24eae88ad3767d0a4a940a10e4a9cec849b7778 (diff)
x86: clean up non-smp usage of cpu maps
Cleanup references to the early cpu maps for the non-SMP configuration and remove some functions called for SMP configurations only. Cc: Andi Kleen <ak@suse.de> Cc: Christoph Lameter <clameter@sgi.com> Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/topology.h')
-rw-r--r--include/asm-x86/topology.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h
index 8d1a1f3d21b4..81a29eb08ac4 100644
--- a/include/asm-x86/topology.h
+++ b/include/asm-x86/topology.h
@@ -38,8 +38,13 @@ extern int cpu_to_node_map[];
38#endif 38#endif
39 39
40DECLARE_PER_CPU(int, x86_cpu_to_node_map); 40DECLARE_PER_CPU(int, x86_cpu_to_node_map);
41
42#ifdef CONFIG_SMP
41extern int x86_cpu_to_node_map_init[]; 43extern int x86_cpu_to_node_map_init[];
42extern void *x86_cpu_to_node_map_early_ptr; 44extern void *x86_cpu_to_node_map_early_ptr;
45#else
46#define x86_cpu_to_node_map_early_ptr NULL
47#endif
43 48
44extern cpumask_t node_to_cpumask_map[]; 49extern cpumask_t node_to_cpumask_map[];
45 50
@@ -54,6 +59,8 @@ static inline int cpu_to_node(int cpu)
54} 59}
55 60
56#else /* CONFIG_X86_64 */ 61#else /* CONFIG_X86_64 */
62
63#ifdef CONFIG_SMP
57static inline int early_cpu_to_node(int cpu) 64static inline int early_cpu_to_node(int cpu)
58{ 65{
59 int *cpu_to_node_map = x86_cpu_to_node_map_early_ptr; 66 int *cpu_to_node_map = x86_cpu_to_node_map_early_ptr;
@@ -65,6 +72,9 @@ static inline int early_cpu_to_node(int cpu)
65 else 72 else
66 return NUMA_NO_NODE; 73 return NUMA_NO_NODE;
67} 74}
75#else
76#define early_cpu_to_node(cpu) cpu_to_node(cpu)
77#endif
68 78
69static inline int cpu_to_node(int cpu) 79static inline int cpu_to_node(int cpu)
70{ 80{
@@ -76,10 +86,7 @@ static inline int cpu_to_node(int cpu)
76 return ((int *)x86_cpu_to_node_map_early_ptr)[cpu]; 86 return ((int *)x86_cpu_to_node_map_early_ptr)[cpu];
77 } 87 }
78#endif 88#endif
79 if (per_cpu_offset(cpu)) 89 return per_cpu(x86_cpu_to_node_map, cpu);
80 return per_cpu(x86_cpu_to_node_map, cpu);
81 else
82 return NUMA_NO_NODE;
83} 90}
84#endif /* CONFIG_X86_64 */ 91#endif /* CONFIG_X86_64 */
85 92