summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGeoff Lywood2010-05-27 01:39:17 +0200
committerMichael Brown2010-05-27 02:18:17 +0200
commit83efb3d7503d5948fae42d64f95597182045ca04 (patch)
treeb2e8cddc706632ceb63d84064fa968bddacfc016 /src
parent[comboot] Propagate carry flag from COMBOOT API (diff)
downloadipxe-83efb3d7503d5948fae42d64f95597182045ca04.tar.gz
ipxe-83efb3d7503d5948fae42d64f95597182045ca04.tar.xz
ipxe-83efb3d7503d5948fae42d64f95597182045ca04.zip
[bitmap] Fix bitmaps on 64-bit
Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
-rw-r--r--src/core/bitmap.c2
-rw-r--r--src/include/ipxe/bitmap.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/core/bitmap.c b/src/core/bitmap.c
index 76fcef67..e9b6d904 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 38d1f221..b18584c1 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 {