vlib: add vlib_frame_bitmap_{set,clear}_bit_at_index
Type: improvement Change-Id: I5703728f680f0c8431e4099b398827bd094b60df Signed-off-by: Damjan Marion <damarion@cisco.com>
This commit is contained in:
committed by
Neale Ranns
parent
2c03879ce4
commit
156d452750
@@ -1403,6 +1403,22 @@ vlib_frame_bitmap_init (uword *bmp, u32 n_first_bits_set)
|
||||
bmp++[0] = 0;
|
||||
}
|
||||
|
||||
static_always_inline void
|
||||
vlib_frame_bitmap_set_bit_at_index (uword *bmp, uword bit_index)
|
||||
{
|
||||
bmp += bit_index / uword_bits;
|
||||
bit_index %= uword_bits;
|
||||
bmp[0] |= 1 << bit_index;
|
||||
}
|
||||
|
||||
static_always_inline void
|
||||
_vlib_frame_bitmap_clear_bit_at_index (uword *bmp, uword bit_index)
|
||||
{
|
||||
bmp += bit_index / uword_bits;
|
||||
bit_index %= uword_bits;
|
||||
bmp[0] &= ~((uword) 1 << bit_index);
|
||||
}
|
||||
|
||||
static_always_inline void
|
||||
vlib_frame_bitmap_clear (uword *bmp)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user