]> xenbits.xensource.com Git - xen.git/commitdiff
libxc/bitops: Add or() to the available bitmap operations
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 10 Sep 2014 17:10:42 +0000 (18:10 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 11 Sep 2014 10:58:02 +0000 (11:58 +0100)
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxc/xc_bitops.h

index d8e0c168d7034b64d65504cd55f301fe40261b69..dfce3b869520d3c7042ecbaa9aebc7894df6cb2d 100644 (file)
@@ -60,4 +60,12 @@ static inline int test_and_set_bit(int nr, unsigned long *addr)
     return oldbit;
 }
 
+static inline void bitmap_or(unsigned long *dst, const unsigned long *other,
+                             int nr_bits)
+{
+    int i, nr_longs = (bitmap_size(nr_bits) / sizeof(unsigned long));
+    for ( i = 0; i < nr_longs; ++i )
+        dst[i] |= other[i];
+}
+
 #endif  /* XC_BITOPS_H */