diff --git a/include/asm-alpha/topology.h b/include/asm-alpha/topology.h index 420ccde6b916a31f8d601d46e601a3062bfc658b..149532e162c4f4293decb64e8e73aab339c13521 100644 --- a/include/asm-alpha/topology.h +++ b/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/include/asm-frv/topology.h b/include/asm-frv/topology.h index abe7298742ac23f59ffa65c0e3e51f3638a35b9d..94272435270552b4fe0b266c00796ec1aa4fbd9c 100644 --- a/include/asm-frv/topology.h +++ b/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/include/asm-generic/topology.h b/include/asm-generic/topology.h index 342a2a0105c4c070f988d39afc90f46d52dca12d..a6aea79bca4f369b51f0e384e15bfabcdd7e13c5 100644 --- a/include/asm-generic/topology.h +++ b/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/include/asm-ia64/topology.h b/include/asm-ia64/topology.h index 2d67b72b18d07049d5ba0f46fea96369605a39ba..f929dde8534324fa9544d6041716b741a03f2377 100644 --- a/include/asm-ia64/topology.h +++ b/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/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h index ca23b681ad058e7f984d9bffff2f1b71af52382e..100c6fbfc587058d889b657e61e2b180ae1b2e13 100644 --- a/include/asm-powerpc/topology.h +++ b/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/include/asm-x86/topology.h b/include/asm-x86/topology.h index 81a29eb08ac4113f5a5f5d57752fef9b390ae153..b167ca90f96fdeb16998fd09ea30e3ff554eb6a2 100644 --- a/include/asm-x86/topology.h +++ b/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