From: Ben Gras Date: Tue, 20 Jun 2006 09:50:26 +0000 (+0000) Subject: Move bitmap manipulation macros to X-Git-Tag: v3.1.3~322 X-Git-Url: http://zhaoyanbai.com/repos/%22/xml/v3/zones/static/mdoc.3.ps?a=commitdiff_plain;h=831bc7ecd1718a0a0dd4f7b9af52604fd377b9df;p=minix.git Move bitmap manipulation macros to --- diff --git a/kernel/const.h b/kernel/const.h index 1c5bc88ee..af4b7c95d 100755 --- a/kernel/const.h +++ b/kernel/const.h @@ -7,6 +7,8 @@ #include /* BIOS addresses, sizes and magic numbers */ #include /* BIOS addresses, sizes and magic numbers */ #include +#include + #include "config.h" /* To translate an address in kernel space to a physical address. This is @@ -34,15 +36,6 @@ /* Number of random sources */ #define RANDOM_SOURCES 16 -/* Constants and macros for bit map manipulation. */ -#define BITCHUNK_BITS (sizeof(bitchunk_t) * CHAR_BIT) -#define BITMAP_CHUNKS(nr_bits) (((nr_bits)+BITCHUNK_BITS-1)/BITCHUNK_BITS) -#define MAP_CHUNK(map,bit) (map)[((bit)/BITCHUNK_BITS)] -#define CHUNK_OFFSET(bit) ((bit)%BITCHUNK_BITS)) -#define GET_BIT(map,bit) ( MAP_CHUNK(map,bit) & (1 << CHUNK_OFFSET(bit) ) -#define SET_BIT(map,bit) ( MAP_CHUNK(map,bit) |= (1 << CHUNK_OFFSET(bit) ) -#define UNSET_BIT(map,bit) ( MAP_CHUNK(map,bit) &= ~(1 << CHUNK_OFFSET(bit) ) - #define get_sys_bit(map,bit) \ ( MAP_CHUNK(map.chunk,bit) & (1 << CHUNK_OFFSET(bit) ) #define set_sys_bit(map,bit) \