Commit Graph

3 Commits

Author SHA1 Message Date
Blue Swirl 84803d7a27 bitops: fix error on OpenBSD and mingw32
Fix this error:
  CC    bitops.o
In file included from /src/qemu/bitops.c:14:
/src/qemu/bitops.h:69: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'unsigned'

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-25 17:21:22 +00:00
Corentin Chary 04483e150d bitops: fix test_and_change_bit()
./bitops.h:192: warning: ‘old’ is used uninitialized in this function

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-25 17:19:02 +00:00
Corentin Chary e0e53b2f1b bitmap: add a generic bitmap and bitops library
Add most used bitmap and bitops functions into bitmap.c and bitops.c.
Theses functions are mostly copied from Linux kernel source.

Some of these functions are already redefined in the VNC server. Some
of them could be used for some block stuff. The yet yo be submitted
NUMA work also need bitmaps.

bitops_ffsl() and bitops_flsl() are here because bitops/bitmap works
on unsigned long, not int, and we can't use current code because:
* ffs only works on int
* qemu_fls only works on int
* ffsl is a GNU extension

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-02-23 16:28:29 -06:00