Skip to content

Commit

Permalink
cpumask: Introduce cpumask_of_{node,pcibus} to replace {node,pcibus}_…
Browse files Browse the repository at this point in the history
…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.

This defines them in the generic non-NUMA case.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Richard Henderson <rth@twiddle.net>
  • Loading branch information
Rusty Russell committed Dec 13, 2008
1 parent aab46da commit f0b848c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion include/asm-generic/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
#ifndef node_to_cpumask
#define node_to_cpumask(node) ((void)node, cpu_online_map)
#endif
#ifndef cpumask_of_node
#define cpumask_of_node(node) ((void)node, cpu_online_mask)
#endif
#ifndef node_to_first_cpu
#define node_to_first_cpu(node) ((void)(node),0)
#endif
Expand All @@ -54,9 +57,18 @@
)
#endif

#ifndef cpumask_of_pcibus
#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \
cpu_all_mask : \
cpumask_of_node(pcibus_to_node(bus)))
#endif

#endif /* CONFIG_NUMA */

/* returns pointer to cpumask for specified node */
/*
* returns pointer to cpumask for specified node
* Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)"
*/
#ifndef node_to_cpumask_ptr

#define node_to_cpumask_ptr(v, node) \
Expand Down

0 comments on commit f0b848c

Please sign in to comment.