diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-26 06:53:41 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-26 06:53:41 -0500 |
commit | 2258a5bb1064351b552aceaff29393967d694fa3 (patch) | |
tree | ddfe5c19232e0dd73963360089cb7dc6c3ea4f53 /arch/alpha | |
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')
-rw-r--r-- | arch/alpha/include/asm/topology.h | 17 | ||||
-rw-r--r-- | arch/alpha/kernel/setup.c | 5 |
2 files changed, 22 insertions, 0 deletions
diff --git a/arch/alpha/include/asm/topology.h b/arch/alpha/include/asm/topology.h index 149532e162c4..b4f284c72ff3 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) | |||
39 | return node_cpu_mask; | 39 | return node_cpu_mask; |
40 | } | 40 | } |
41 | 41 | ||
42 | extern struct cpumask node_to_cpumask_map[]; | ||
43 | /* FIXME: This is dumb, recalculating every time. But simple. */ | ||
44 | static const struct cpumask *cpumask_of_node(int node) | ||
45 | { | ||
46 | int cpu; | ||
47 | |||
48 | cpumask_clear(&node_to_cpumask_map[node]); | ||
49 | |||
50 | for_each_online_cpu(cpu) { | ||
51 | if (cpu_to_node(cpu) == node) | ||
52 | cpumask_set_cpu(cpu, node_to_cpumask_map[node]); | ||
53 | } | ||
54 | |||
55 | return &node_to_cpumask_map[node]; | ||
56 | } | ||
57 | |||
42 | #define pcibus_to_cpumask(bus) (cpu_online_map) | 58 | #define pcibus_to_cpumask(bus) (cpu_online_map) |
59 | #define cpumask_of_pcibus(bus) (cpu_online_mask) | ||
43 | 60 | ||
44 | #endif /* !CONFIG_NUMA */ | 61 | #endif /* !CONFIG_NUMA */ |
45 | # include <asm-generic/topology.h> | 62 | # include <asm-generic/topology.h> |
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index a449e999027c..02bee6983ce2 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c | |||
@@ -79,6 +79,11 @@ int alpha_l3_cacheshape; | |||
79 | unsigned long alpha_verbose_mcheck = CONFIG_VERBOSE_MCHECK_ON; | 79 | unsigned long alpha_verbose_mcheck = CONFIG_VERBOSE_MCHECK_ON; |
80 | #endif | 80 | #endif |
81 | 81 | ||
82 | #ifdef CONFIG_NUMA | ||
83 | struct cpumask node_to_cpumask_map[MAX_NUMNODES] __read_mostly; | ||
84 | EXPORT_SYMBOL(node_to_cpumask_map); | ||
85 | #endif | ||
86 | |||
82 | /* Which processor we booted from. */ | 87 | /* Which processor we booted from. */ |
83 | int boot_cpuid; | 88 | int boot_cpuid; |
84 | 89 | ||