Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:Update
qemu-testsuite.19799
0315-bitmap-add-bitmap_copy_and_clear_at.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0315-bitmap-add-bitmap_copy_and_clear_at.patch of Package qemu-testsuite.19799
From: Gerd Hoffmann <kraxel@redhat.com> Date: Fri, 21 Apr 2017 11:16:24 +0200 Subject: bitmap: add bitmap_copy_and_clear_atomic Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170421091632.30900-2-kraxel@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit d6eb1413920affb7be3df9982682dd183a805dd7) [BR: Support for BSC#1084604 (and other useful vga fixes)] Signed-off-by: Bruce Rogers <brogers@suse.com> --- include/qemu/bitmap.h | 2 ++ util/bitmap.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/qemu/bitmap.h b/include/qemu/bitmap.h index 0e33fa5d9d6090e007b18003eb1d..45f2274a7ceaf3dd6e1ec1aa8014 100644 --- a/include/qemu/bitmap.h +++ b/include/qemu/bitmap.h @@ -228,6 +228,8 @@ void bitmap_set(unsigned long *map, long i, long len); void bitmap_set_atomic(unsigned long *map, long i, long len); void bitmap_clear(unsigned long *map, long start, long nr); bool bitmap_test_and_clear_atomic(unsigned long *map, long start, long nr); +void bitmap_copy_and_clear_atomic(unsigned long *dst, unsigned long *src, + long nr); unsigned long bitmap_find_next_zero_area(unsigned long *map, unsigned long size, unsigned long start, diff --git a/util/bitmap.c b/util/bitmap.c index 40aadfb4f32ee1dae896f0bc25c7..9465129d1a0014b260c927ad9f73 100644 --- a/util/bitmap.c +++ b/util/bitmap.c @@ -281,6 +281,17 @@ bool bitmap_test_and_clear_atomic(unsigned long *map, long start, long nr) return dirty != 0; } +void bitmap_copy_and_clear_atomic(unsigned long *dst, unsigned long *src, + long nr) +{ + while (nr > 0) { + *dst = atomic_xchg(src, 0); + dst++; + src++; + nr -= BITS_PER_LONG; + } +} + #define ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) /**
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor