summaryrefslogtreecommitdiffstats
path: root/include/qemu/bitmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/qemu/bitmap.h')
-rw-r--r--include/qemu/bitmap.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/include/qemu/bitmap.h b/include/qemu/bitmap.h
index ec5146f84e..63ea2d0b1e 100644
--- a/include/qemu/bitmap.h
+++ b/include/qemu/bitmap.h
@@ -57,11 +57,8 @@
* find_next_bit(addr, nbits, bit) Position next set bit in *addr >= bit
*/
-#define BITMAP_LAST_WORD_MASK(nbits) \
- ( \
- ((nbits) % BITS_PER_LONG) ? \
- (1UL<<((nbits) % BITS_PER_LONG))-1 : ~0UL \
- )
+#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) & (BITS_PER_LONG - 1)))
+#define BITMAP_LAST_WORD_MASK(nbits) (~0UL >> (-(nbits) & (BITS_PER_LONG - 1)))
#define DECLARE_BITMAP(name,bits) \
unsigned long name[BITS_TO_LONGS(bits)]
@@ -75,10 +72,6 @@ int slow_bitmap_equal(const unsigned long *bitmap1,
const unsigned long *bitmap2, long bits);
void slow_bitmap_complement(unsigned long *dst, const unsigned long *src,
long bits);
-void slow_bitmap_shift_right(unsigned long *dst,
- const unsigned long *src, int shift, long bits);
-void slow_bitmap_shift_left(unsigned long *dst,
- const unsigned long *src, int shift, long bits);
int slow_bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
const unsigned long *bitmap2, long bits);
void slow_bitmap_or(unsigned long *dst, const unsigned long *bitmap1,