]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
cpumask: alpha: Introduce cpumask_of_{node,pcibus} to replace {node,pcibus}_to_cpumask
authorRusty Russell <rusty@rustcorp.com.au>
Fri, 26 Dec 2008 11:53:41 +0000 (22:23 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 26 Dec 2008 11:53:41 +0000 (22:23 +1030)
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>
arch/alpha/include/asm/topology.h
arch/alpha/kernel/setup.c

index 149532e162c4f4293decb64e8e73aab339c13521..b4f284c72ff3ed303425ac437df0b74f75defc90 100644 (file)
@@ -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>
index a449e999027c8e663af133f956996c94a70197fc..02bee6983ce2e7f9a91cd57a264ec189671c073e 100644 (file)
@@ -79,6 +79,11 @@ int alpha_l3_cacheshape;
 unsigned long alpha_verbose_mcheck = CONFIG_VERBOSE_MCHECK_ON;
 #endif
 
+#ifdef CONFIG_NUMA
+struct cpumask node_to_cpumask_map[MAX_NUMNODES] __read_mostly;
+EXPORT_SYMBOL(node_to_cpumask_map);
+#endif
+
 /* Which processor we booted from.  */
 int boot_cpuid;