diff options
author | Andi Kleen <ak@suse.de> | 2005-01-11 15:35:48 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-11 15:35:48 -0800 |
commit | 8f13ed2fa0cc179e1462f8d7c81dd4a62b7e0c88 (patch) | |
tree | 5303ede5fee6bbe5902fb9aa24fe42f825ada46b /include | |
parent | 04a2b7d012f4ad13f22fe001cc13e657659b0924 (diff) | |
download | history-8f13ed2fa0cc179e1462f8d7c81dd4a62b7e0c88.tar.gz |
[PATCH] x86_64: Fix ACPI SRAT NUMA parsing
Fix fallout from the recent nodemask_t changes. The node ids assigned
in the SRAT parser were off by one.
I added a new first_unset_node() function to nodemask.h to allocate
IDs sanely.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nodemask.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 4de843d94147cb..16475a23efa7ac 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h @@ -38,6 +38,8 @@ * * int first_node(mask) Number lowest set bit, or MAX_NUMNODES * int next_node(node, mask) Next node past 'node', or MAX_NUMNODES + * int first_unset_node(mask) First node not set in mask, or + * MAX_NUMNODES. * * nodemask_t nodemask_of_node(node) Return nodemask with bit 'node' set * NODE_MASK_ALL Initializer - all bits set @@ -235,6 +237,13 @@ static inline int __next_node(int n, const nodemask_t *srcp, int nbits) m; \ }) +#define first_unset_node(mask) __first_unset_node(&(mask)) +static inline int __first_unset_node(const nodemask_t *maskp) +{ + return min_t(int,MAX_NUMNODES, + find_first_zero_bit(maskp->bits, MAX_NUMNODES)); +} + #define NODE_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(MAX_NUMNODES) #if MAX_NUMNODES <= BITS_PER_LONG |