From: Andrew Cooper Date: Wed, 10 Sep 2014 17:10:42 +0000 (+0100) Subject: libxc/bitops: Add or() to the available bitmap operations X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4423 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=89f5ca3b5f16a1418b1ae4b2e36a6453a1dce309;p=xen.git libxc/bitops: Add or() to the available bitmap operations Signed-off-by: Andrew Cooper CC: Ian Campbell CC: Ian Jackson Acked-by: Ian Campbell --- diff --git a/tools/libxc/xc_bitops.h b/tools/libxc/xc_bitops.h index d8e0c168d7..dfce3b8695 100644 --- a/tools/libxc/xc_bitops.h +++ b/tools/libxc/xc_bitops.h @@ -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 */