Browse Source

[bitmap] Fix bitmaps on 64-bit

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Geoff Lywood 14 years ago
parent
commit
83efb3d750
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      src/core/bitmap.c
  2. 1
    1
      src/include/ipxe/bitmap.h

+ 1
- 1
src/core/bitmap.c View File

76
 
76
 
77
 	if ( bit >= bitmap->length )
77
 	if ( bit >= bitmap->length )
78
 		return 0;
78
 		return 0;
79
-	return ( bitmap->blocks[index] & mask );
79
+	return ( ( bitmap->blocks[index] & mask ) != 0 );
80
 }
80
 }
81
 
81
 
82
 /**
82
 /**

+ 1
- 1
src/include/ipxe/bitmap.h View File

33
  * @v bit		Bit index
33
  * @v bit		Bit index
34
  * @ret mask		Block mask
34
  * @ret mask		Block mask
35
  */
35
  */
36
-#define BITMAP_MASK( bit ) ( 1 << ( (bit) % BITMAP_BLKSIZE ) )
36
+#define BITMAP_MASK( bit ) ( 1UL << ( (bit) % BITMAP_BLKSIZE ) )
37
 
37
 
38
 /** A bitmap */
38
 /** A bitmap */
39
 struct bitmap {
39
 struct bitmap {

Loading…
Cancel
Save