diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-26 22:23:41 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-26 22:23:41 +1030 |
commit | 2258a5bb1064351b552aceaff29393967d694fa3 (patch) | |
tree | ddfe5c19232e0dd73963360089cb7dc6c3ea4f53 /arch/alpha/include | |
parent | b4a2f916a8326065816a0743dd1b0ca2ffd18f5f (diff) |
cpumask: alpha: Introduce cpumask_of_{node,pcibus} to replace {node,pcibus}_to_cpumask
Impact: New APIs
The old node_to_cpumask/node_to_pcibus returned a cpumask_t: these
return a pointer to a struct cpumask. Part of removing cpumasks from
the stack.
I'm not sure the existing code even compiles, but new version is
straightforward.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'arch/alpha/include')
-rw-r--r-- | arch/alpha/include/asm/topology.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/alpha/include/asm/topology.h b/arch/alpha/include/asm/topology.h index 149532e162c..b4f284c72ff 100644 --- a/arch/alpha/include/asm/topology.h +++ b/arch/alpha/include/asm/topology.h @@ -39,7 +39,24 @@ static inline cpumask_t node_to_cpumask(int node) return node_cpu_mask; } +extern struct cpumask node_to_cpumask_map[]; +/* FIXME: This is dumb, recalculating every time. But simple. */ +static const struct cpumask *cpumask_of_node(int node) +{ + int cpu; + + cpumask_clear(&node_to_cpumask_map[node]); + + for_each_online_cpu(cpu) { + if (cpu_to_node(cpu) == node) + cpumask_set_cpu(cpu, node_to_cpumask_map[node]); + } + + return &node_to_cpumask_map[node]; +} + #define pcibus_to_cpumask(bus) (cpu_online_map) +#define cpumask_of_pcibus(bus) (cpu_online_mask) #endif /* !CONFIG_NUMA */ # include <asm-generic/topology.h> |