diff options
author | travis@sgi.com <travis@sgi.com> | 2008-01-30 13:33:11 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 13:33:11 +0100 |
commit | df3825c56dd70a4d7796041388f3cfe51c1db832 (patch) | |
tree | 6110ef6ce26704679b9d13399e2aa368f3430126 /include | |
parent | 3b41908902df1dba141cd7de1a727bb03718a654 (diff) |
x86: change NR_CPUS arrays in numa_64
Change the following static arrays sized by NR_CPUS to
per_cpu data variables:
char cpu_to_node_map[NR_CPUS];
Signed-off-by: Mike Travis <travis@sgi.com>
Reviewed-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86/numa_64.h | 2 | ||||
-rw-r--r-- | include/asm-x86/topology.h | 15 |
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) #define clear_node_cpumask(cpu) do {} while (0) #endif -#define NUMA_NO_NODE 0xffff - #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 @@ #include <asm/mpspec.h> /* Mappings between logical cpu number and node number */ -extern u16 cpu_to_node_map[]; +DECLARE_PER_CPU(u16, x86_cpu_to_node_map); +extern u16 __initdata x86_cpu_to_node_map_init[]; +extern void *x86_cpu_to_node_map_early_ptr; extern cpumask_t node_to_cpumask_map[]; +#define NUMA_NO_NODE ((u16)(~0)) + /* Returns the number of the node containing CPU 'cpu' */ static inline int cpu_to_node(int cpu) { - return cpu_to_node_map[cpu]; + u16 *cpu_to_node_map = (u16 *)x86_cpu_to_node_map_early_ptr; + + if (cpu_to_node_map) + return cpu_to_node_map[cpu]; + else if (per_cpu_offset(cpu)) + return per_cpu(x86_cpu_to_node_map, cpu); + else + return NUMA_NO_NODE; } /* |