2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

bitmap: Add new functions.

These will be used in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
This commit is contained in:
Ben Pfaff
2014-07-25 22:23:44 -07:00
parent 771c99c19c
commit 65d3b0feb2
2 changed files with 50 additions and 0 deletions

View File

@@ -104,6 +104,12 @@ size_t bitmap_scan(const unsigned long int *, bool target,
size_t start, size_t end);
size_t bitmap_count1(const unsigned long *, size_t n);
void bitmap_and(unsigned long *dst, const unsigned long *arg, size_t n);
void bitmap_or(unsigned long *dst, const unsigned long *arg, size_t n);
void bitmap_not(unsigned long *dst, size_t n);
bool bitmap_is_all_zeros(const unsigned long *, size_t n);
#define BITMAP_FOR_EACH_1(IDX, SIZE, BITMAP) \
for ((IDX) = bitmap_scan(BITMAP, 1, 0, SIZE); (IDX) < (SIZE); \
(IDX) = bitmap_scan(BITMAP, 1, (IDX) + 1, SIZE))