FD.io VPP  v16.06
Vector Packet Processing
bitmap.h File Reference
+ Include dependency graph for bitmap.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define clib_bitmap_dup(v)   vec_dup(v)
 
#define clib_bitmap_free(v)   vec_free(v)
 
#define clib_bitmap_bytes(v)   vec_bytes(v)
 
#define clib_bitmap_zero(v)   vec_zero(v)
 
#define clib_bitmap_alloc(v, n_bits)   v = vec_new (uword, ((n_bits) + BITS (uword) - 1) / BITS (uword))
 
#define clib_bitmap_vec_validate(v, i)   vec_validate_aligned((v),(i),sizeof(uword))
 
#define clib_bitmap_validate(v, n_bits)   clib_bitmap_vec_validate ((v), ((n_bits) - 1) / BITS (uword))
 
#define clib_bitmap_foreach(i, ai, body)
 

Functions

always_inline uword clib_bitmap_is_zero (uword *ai)
 
always_inline uword clib_bitmap_is_equal (uword *a, uword *b)
 
always_inline uword clib_bitmap_set_no_check (uword *a, uword i, uword new_value)
 
always_inline uwordclib_bitmap_set (uword *ai, uword i, uword value)
 
always_inline uword clib_bitmap_get (uword *ai, uword i)
 
always_inline uword clib_bitmap_get_no_check (uword *ai, uword i)
 
always_inline uword clib_bitmap_get_multiple_no_check (uword *ai, uword i, uword n_bits)
 
always_inline uword clib_bitmap_get_multiple (uword *bitmap, uword i, uword n_bits)
 
always_inline uwordclib_bitmap_set_multiple (uword *bitmap, uword i, uword value, uword n_bits)
 
always_inline uwordclib_bitmap_set_region (uword *bitmap, uword i, uword value, uword n_bits)
 
always_inline uword clib_bitmap_first_set (uword *ai)
 
always_inline uword clib_bitmap_first_clear (uword *ai)
 
always_inline uword clib_bitmap_count_set_bits (uword *ai)
 
always_inline uwordclib_bitmap_random (uword *ai, uword n_bits, u32 *seed)
 
always_inline uword clib_bitmap_next_set (uword *ai, uword i)
 
always_inline uword clib_bitmap_next_clear (uword *ai, uword i)
 
static uword unformat_bitmap_list (unformat_input_t *input, va_list *va)
 
static u8format_bitmap_hex (u8 *s, va_list *args)
 

Variables

 a = a &~ b
 

Macro Definition Documentation

#define clib_bitmap_alloc (   v,
  n_bits 
)    v = vec_new (uword, ((n_bits) + BITS (uword) - 1) / BITS (uword))

Definition at line 85 of file bitmap.h.

#define clib_bitmap_bytes (   v)    vec_bytes(v)

Definition at line 79 of file bitmap.h.

#define clib_bitmap_dup (   v)    vec_dup(v)

Definition at line 73 of file bitmap.h.

#define clib_bitmap_foreach (   i,
  ai,
  body 
)
Value:
do { \
uword __bitmap_i, __bitmap_ai, __bitmap_len, __bitmap_first_set; \
__bitmap_len = vec_len ((ai)); \
for (__bitmap_i = 0; __bitmap_i < __bitmap_len; __bitmap_i++) \
{ \
__bitmap_ai = (ai)[__bitmap_i]; \
while (__bitmap_ai != 0) \
{ \
__bitmap_first_set = first_set (__bitmap_ai); \
(i) = (__bitmap_i * BITS ((ai)[0]) \
+ min_log2 (__bitmap_first_set)); \
do { body; } while (0); \
__bitmap_ai ^= __bitmap_first_set; \
} \
} \
} while (0)
sll srl srl sll sra u16x4 i
Definition: vector_sse2.h:267
always_inline uword first_set(uword x)
Definition: clib.h:265
u64 uword
Definition: types.h:112
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
always_inline uword min_log2(uword x)
Definition: clib.h:181
#define BITS(x)
Definition: clib.h:58

Definition at line 308 of file bitmap.h.

#define clib_bitmap_free (   v)    vec_free(v)

Definition at line 76 of file bitmap.h.

#define clib_bitmap_validate (   v,
  n_bits 
)    clib_bitmap_vec_validate ((v), ((n_bits) - 1) / BITS (uword))

Definition at line 91 of file bitmap.h.

#define clib_bitmap_vec_validate (   v,
  i 
)    vec_validate_aligned((v),(i),sizeof(uword))

Definition at line 88 of file bitmap.h.

#define clib_bitmap_zero (   v)    vec_zero(v)

Definition at line 82 of file bitmap.h.

Function Documentation

always_inline uword clib_bitmap_count_set_bits ( uword ai)

Definition at line 357 of file bitmap.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword clib_bitmap_first_clear ( uword ai)

Definition at line 343 of file bitmap.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword clib_bitmap_first_set ( uword ai)

Definition at line 329 of file bitmap.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword clib_bitmap_get ( uword ai,
uword  i 
)

Definition at line 158 of file bitmap.h.

+ Here is the caller graph for this function:

always_inline uword clib_bitmap_get_multiple ( uword bitmap,
uword  i,
uword  n_bits 
)

Definition at line 192 of file bitmap.h.

+ Here is the caller graph for this function:

always_inline uword clib_bitmap_get_multiple_no_check ( uword ai,
uword  i,
uword  n_bits 
)

Definition at line 182 of file bitmap.h.

+ Here is the call graph for this function:

always_inline uword clib_bitmap_get_no_check ( uword ai,
uword  i 
)

Definition at line 170 of file bitmap.h.

+ Here is the caller graph for this function:

always_inline uword clib_bitmap_is_equal ( uword a,
uword b 
)

Definition at line 61 of file bitmap.h.

always_inline uword clib_bitmap_is_zero ( uword ai)

Definition at line 50 of file bitmap.h.

+ Here is the caller graph for this function:

always_inline uword clib_bitmap_next_clear ( uword ai,
uword  i 
)

Definition at line 495 of file bitmap.h.

+ Here is the call graph for this function:

always_inline uword clib_bitmap_next_set ( uword ai,
uword  i 
)

Definition at line 470 of file bitmap.h.

+ Here is the call graph for this function:

always_inline uword* clib_bitmap_random ( uword ai,
uword  n_bits,
u32 seed 
)

Definition at line 440 of file bitmap.h.

+ Here is the call graph for this function:

always_inline uword* clib_bitmap_set ( uword ai,
uword  i,
uword  value 
)

Definition at line 132 of file bitmap.h.

+ Here is the caller graph for this function:

always_inline uword* clib_bitmap_set_multiple ( uword bitmap,
uword  i,
uword  value,
uword  n_bits 
)

Definition at line 226 of file bitmap.h.

+ Here is the caller graph for this function:

always_inline uword clib_bitmap_set_no_check ( uword a,
uword  i,
uword  new_value 
)

Definition at line 112 of file bitmap.h.

+ Here is the caller graph for this function:

always_inline uword* clib_bitmap_set_region ( uword bitmap,
uword  i,
uword  value,
uword  n_bits 
)

Definition at line 269 of file bitmap.h.

+ Here is the call graph for this function:

static u8* format_bitmap_hex ( u8 s,
va_list *  args 
)
inlinestatic

Definition at line 559 of file bitmap.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword unformat_bitmap_list ( unformat_input_t input,
va_list *  va 
)
inlinestatic

Definition at line 519 of file bitmap.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

a = a &~ b

Definition at line 393 of file bitmap.h.