mirror of
https://github.com/ipxe/ipxe
synced 2025-12-22 04:50:25 +03:00
[bitmap] Fix bitmaps on 64-bit
Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
committed by
Michael Brown
parent
0d108681ac
commit
83efb3d750
@@ -76,7 +76,7 @@ int bitmap_test ( struct bitmap *bitmap, unsigned int bit ) {
|
|||||||
|
|
||||||
if ( bit >= bitmap->length )
|
if ( bit >= bitmap->length )
|
||||||
return 0;
|
return 0;
|
||||||
return ( bitmap->blocks[index] & mask );
|
return ( ( bitmap->blocks[index] & mask ) != 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ typedef unsigned long bitmap_block_t;
|
|||||||
* @v bit Bit index
|
* @v bit Bit index
|
||||||
* @ret mask Block mask
|
* @ret mask Block mask
|
||||||
*/
|
*/
|
||||||
#define BITMAP_MASK( bit ) ( 1 << ( (bit) % BITMAP_BLKSIZE ) )
|
#define BITMAP_MASK( bit ) ( 1UL << ( (bit) % BITMAP_BLKSIZE ) )
|
||||||
|
|
||||||
/** A bitmap */
|
/** A bitmap */
|
||||||
struct bitmap {
|
struct bitmap {
|
||||||
|
|||||||
Reference in New Issue
Block a user