diff options
author | Geoff Lywood <glywood@vmware.com> | 2010-05-27 00:39:17 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2010-05-27 01:18:17 +0100 |
commit | 83efb3d7503d5948fae42d64f95597182045ca04 (patch) | |
tree | b2e8cddc706632ceb63d84064fa968bddacfc016 | |
parent | 0d108681ac5b1e1d652c28b44377a151041ea425 (diff) | |
download | ipxe-83efb3d7503d5948fae42d64f95597182045ca04.tar.gz |
[bitmap] Fix bitmaps on 64-bit
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r-- | src/core/bitmap.c | 2 | ||||
-rw-r--r-- | src/include/ipxe/bitmap.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/core/bitmap.c b/src/core/bitmap.c index 76fcef67b..e9b6d9041 100644 --- a/src/core/bitmap.c +++ b/src/core/bitmap.c @@ -76,7 +76,7 @@ int bitmap_test ( struct bitmap *bitmap, unsigned int bit ) { if ( bit >= bitmap->length ) return 0; - return ( bitmap->blocks[index] & mask ); + return ( ( bitmap->blocks[index] & mask ) != 0 ); } /** diff --git a/src/include/ipxe/bitmap.h b/src/include/ipxe/bitmap.h index 38d1f221d..b18584c1f 100644 --- a/src/include/ipxe/bitmap.h +++ b/src/include/ipxe/bitmap.h @@ -33,7 +33,7 @@ typedef unsigned long bitmap_block_t; * @v bit Bit index * @ret mask Block mask */ -#define BITMAP_MASK( bit ) ( 1 << ( (bit) % BITMAP_BLKSIZE ) ) +#define BITMAP_MASK( bit ) ( 1UL << ( (bit) % BITMAP_BLKSIZE ) ) /** A bitmap */ struct bitmap { |