From d18860197248185a91e3f6e0a846eab738b65b92 Mon Sep 17 00:00:00 2001 From: Mike Travis Date: Mon, 31 Mar 2008 08:41:55 -0700 Subject: [PATCH] --- yaml --- r: 91067 b: refs/heads/master c: aa6b54461cc5c0019b9d792adf3176b444c10763 h: refs/heads/master i: 91065: 5125f94e8c011170ff102db6b5aae420793d57b8 91063: 9bf353c16d3d9393a985bd17f405c62c199880a4 v: v3 --- [refs] | 2 +- trunk/include/asm-alpha/topology.h | 3 +-- trunk/include/asm-frv/topology.h | 4 +--- trunk/include/asm-generic/topology.h | 14 ++++++++++++++ trunk/include/asm-ia64/topology.h | 5 +++++ trunk/include/asm-powerpc/topology.h | 3 +-- trunk/include/asm-x86/topology.h | 15 +++++++++++++-- 7 files changed, 36 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index a75bc1e272f7..1dcc0a7a1410 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d18d00f5dbcd1a95811617e9812cf0560bd465ee +refs/heads/master: aa6b54461cc5c0019b9d792adf3176b444c10763 diff --git a/trunk/include/asm-alpha/topology.h b/trunk/include/asm-alpha/topology.h index 420ccde6b916..149532e162c4 100644 --- a/trunk/include/asm-alpha/topology.h +++ b/trunk/include/asm-alpha/topology.h @@ -41,8 +41,7 @@ static inline cpumask_t node_to_cpumask(int node) #define pcibus_to_cpumask(bus) (cpu_online_map) -#else /* CONFIG_NUMA */ -# include #endif /* !CONFIG_NUMA */ +# include #endif /* _ASM_ALPHA_TOPOLOGY_H */ diff --git a/trunk/include/asm-frv/topology.h b/trunk/include/asm-frv/topology.h index abe7298742ac..942724352705 100644 --- a/trunk/include/asm-frv/topology.h +++ b/trunk/include/asm-frv/topology.h @@ -5,10 +5,8 @@ #error NUMA not supported yet -#else /* !CONFIG_NUMA */ +#endif /* CONFIG_NUMA */ #include -#endif /* CONFIG_NUMA */ - #endif /* _ASM_TOPOLOGY_H */ diff --git a/trunk/include/asm-generic/topology.h b/trunk/include/asm-generic/topology.h index 342a2a0105c4..a6aea79bca4f 100644 --- a/trunk/include/asm-generic/topology.h +++ b/trunk/include/asm-generic/topology.h @@ -27,6 +27,8 @@ #ifndef _ASM_GENERIC_TOPOLOGY_H #define _ASM_GENERIC_TOPOLOGY_H +#ifndef CONFIG_NUMA + /* Other architectures wishing to use this simple topology API should fill in the below functions as appropriate in their own file. */ #ifndef cpu_to_node @@ -52,4 +54,16 @@ ) #endif +#endif /* CONFIG_NUMA */ + +/* returns pointer to cpumask for specified node */ +#ifndef node_to_cpumask_ptr + +#define node_to_cpumask_ptr(v, node) \ + cpumask_t _##v = node_to_cpumask(node), *v = &_##v + +#define node_to_cpumask_ptr_next(v, node) \ + _##v = node_to_cpumask(node) +#endif + #endif /* _ASM_GENERIC_TOPOLOGY_H */ diff --git a/trunk/include/asm-ia64/topology.h b/trunk/include/asm-ia64/topology.h index 2d67b72b18d0..f929dde85343 100644 --- a/trunk/include/asm-ia64/topology.h +++ b/trunk/include/asm-ia64/topology.h @@ -116,6 +116,11 @@ void build_cpu_to_node_map(void); #define smt_capable() (smp_num_siblings > 1) #endif +#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \ + CPU_MASK_ALL : \ + node_to_cpumask(pcibus_to_node(bus)) \ + ) + #include #endif /* _ASM_IA64_TOPOLOGY_H */ diff --git a/trunk/include/asm-powerpc/topology.h b/trunk/include/asm-powerpc/topology.h index ca23b681ad05..100c6fbfc587 100644 --- a/trunk/include/asm-powerpc/topology.h +++ b/trunk/include/asm-powerpc/topology.h @@ -96,11 +96,10 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev, { } +#endif /* CONFIG_NUMA */ #include -#endif /* CONFIG_NUMA */ - #ifdef CONFIG_SMP #include #define smt_capable() (cpu_has_feature(CPU_FTR_SMT)) diff --git a/trunk/include/asm-x86/topology.h b/trunk/include/asm-x86/topology.h index 81a29eb08ac4..b167ca90f96f 100644 --- a/trunk/include/asm-x86/topology.h +++ b/trunk/include/asm-x86/topology.h @@ -88,6 +88,17 @@ static inline int cpu_to_node(int cpu) #endif return per_cpu(x86_cpu_to_node_map, cpu); } + +#ifdef CONFIG_NUMA + +/* Returns a pointer to the cpumask of CPUs on Node 'node'. */ +#define node_to_cpumask_ptr(v, node) \ + cpumask_t *v = &(node_to_cpumask_map[node]) + +#define node_to_cpumask_ptr_next(v, node) \ + v = &(node_to_cpumask_map[node]) +#endif + #endif /* CONFIG_X86_64 */ /* @@ -174,10 +185,10 @@ extern int __node_distance(int, int); #else /* CONFIG_NUMA */ -#include - #endif +#include + extern cpumask_t cpu_coregroup_map(int cpu); #ifdef ENABLE_TOPO_DEFINES