History | View | Annotate | Download (9.5 kB)
bitops: drop volatile qualifier
Qualifier 'volatile' is not useful for applications, it's too strictfor single threaded code but does not give the real atomicity guaranteesneeded for multithreaded code.
Drop them and now useless casts.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
bitops: Fix documentation
Signed-off-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
bitops.h: Add functions to extract and deposit bitfields
Add functions deposit32(), deposit64(), extract32() and extract64()to extract and deposit bitfields in 32 and 64 bit words. Based onideas by Jia Liu and Avi Kivity.
Suggested-by: Jia Liu <proljc@gmail.com>...
bitops: fix error on OpenBSD and mingw32
Fix this error: CC bitops.oIn file included from /src/qemu/bitops.c:14:/src/qemu/bitops.h:69: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'unsigned'
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>
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. Someof them could be used for some block stuff. The yet yo be submitted...