On Thu, Nov 27, 2014 at 05:43:56PM +0100, Paolo Bonzini wrote:
>
>
> On 27/11/2014 13:29, Stefan Hajnoczi wrote:
> > +bool bitmap_test_and_clear_atomic(unsigned long *map, long start, long nr)
> > +{
> > +unsigned long *p = map + BIT_WORD(start);
> > +const long size = start + nr;
> > +
On 27/11/2014 13:29, Stefan Hajnoczi wrote:
> +bool bitmap_test_and_clear_atomic(unsigned long *map, long start, long nr)
> +{
> +unsigned long *p = map + BIT_WORD(start);
> +const long size = start + nr;
> +int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG);
> +unsigned
The new bitmap_test_and_clear_atomic() function clears a range and
returns whether or not the bits were set.
Signed-off-by: Stefan Hajnoczi
---
include/qemu/bitmap.h | 2 ++
util/bitmap.c | 26 ++
2 files changed, 28 insertions(+)
diff --git a/include/qemu/bitma