mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
asm-generic: add node_to_cpumask_ptr macro
Create a simple macro to always return a pointer to the node_to_cpumask(node)
value. This relies on compiler optimization to remove the extra indirection:
#define node_to_cpumask_ptr(v, node) \
cpumask_t _##v = node_to_cpumask(node), *v = &_##v
For those systems with a large cpumask size, then a true pointer
to the array element can be used:
#define node_to_cpumask_ptr(v, node) \
cpumask_t *v = &(node_to_cpumask_map[node])
A node_to_cpumask_ptr_next() macro is provided to access another
node_to_cpumask value.
The other change is to always include asm-generic/topology.h moving the
ifdef CONFIG_NUMA to this same file.
Note: there are no references to either of these new macros in this patch,
only the definition.
Based on 2.6.25-rc5-mm1
# alpha
Cc: Richard Henderson <[email protected]>
# fujitsu
Cc: David Howells <[email protected]>
# ia64
Cc: Tony Luck <[email protected]>
# powerpc
Cc: Paul Mackerras <[email protected]>
Cc: Anton Blanchard <[email protected]>
# sparc
Cc: David S. Miller <[email protected]>
Cc: William L. Irwin <[email protected]>
# x86
Cc: H. Peter Anvin <[email protected]>
Signed-off-by: Mike Travis <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
d18d00f5db
commit
aa6b54461c
6 changed files with 35 additions and 9 deletions
|
|
@ -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 <asm/topology.h> 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 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue