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>
This commit is contained in:
Mike Travis
2008-03-25 15:06:51 -07:00
committed by Ingo Molnar
parent a24eae88ad
commit b447a468fc
4 changed files with 30 additions and 22 deletions

View File

@@ -38,8 +38,13 @@ extern int cpu_to_node_map[];
#endif
DECLARE_PER_CPU(int, x86_cpu_to_node_map);
#ifdef CONFIG_SMP
extern int x86_cpu_to_node_map_init[];
extern void *x86_cpu_to_node_map_early_ptr;
#else
#define x86_cpu_to_node_map_early_ptr NULL
#endif
extern cpumask_t node_to_cpumask_map[];
@@ -54,6 +59,8 @@ static inline int cpu_to_node(int cpu)
}
#else /* CONFIG_X86_64 */
#ifdef CONFIG_SMP
static inline int early_cpu_to_node(int cpu)
{
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)
else
return NUMA_NO_NODE;
}
#else
#define early_cpu_to_node(cpu) cpu_to_node(cpu)
#endif
static inline int cpu_to_node(int cpu)
{
@@ -76,10 +86,7 @@ static inline int cpu_to_node(int cpu)
return ((int *)x86_cpu_to_node_map_early_ptr)[cpu];
}
#endif
if (per_cpu_offset(cpu))
return per_cpu(x86_cpu_to_node_map, cpu);
else
return NUMA_NO_NODE;
return per_cpu(x86_cpu_to_node_map, cpu);
}
#endif /* CONFIG_X86_64 */