Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Bit Arrays

Macros

#define FAIL_ALLOC_MSG_FMT   "sys_bitarray_alloc with region size %i allocated incorrectly"
 
#define FAIL_ALLOC_RET_MSG_FMT   "sys_bitarray_alloc with region size %i returned incorrect result"
 
#define FAIL_ALLOC_OFFSET_MSG_FMT   "sys_bitarray_alloc with region size %i gave incorrect offset"
 
#define FAIL_FREE_MSG_FMT   "sys_bitarray_free with region size %i and offset %i failed"
 
#define FREE   0U
 

Functions

static bool cmp_u32_arrays (uint32_t *a1, uint32_t *a2, size_t sz)
 
void validate_bitarray_define (sys_bitarray_t *ba, size_t num_bits)
 
void test_bitarray_declare (void)
 Test defining of bitarrays.
 
bool bitarray_bundles_is_zero (sys_bitarray_t *ba)
 
void test_bitarray_set_clear (void)
 Test bitarrays set and clear.
 
void alloc_and_free_predefined (void)
 
static size_t count_bits (uint32_t val)
 
size_t get_bitarray_popcnt (sys_bitarray_t *ba)
 
void alloc_and_free_loop (int divisor)
 
void alloc_and_free_interval (void)
 
void test_bitarray_alloc_free (void)
 Test bitarrays allocation and free.
 
void test_bitarray_popcount_region (void)
 
void test_bitarray_xor (void)
 
void test_bitarray_find_nth_set (void)
 
void test_bitarray_region_set_clear (void)
 
void test_ffs (void)
 Test find MSB and LSB operations.
 

Detailed Description

Macro Definition Documentation

◆ FAIL_ALLOC_MSG_FMT

#define FAIL_ALLOC_MSG_FMT   "sys_bitarray_alloc with region size %i allocated incorrectly"

◆ FAIL_ALLOC_OFFSET_MSG_FMT

#define FAIL_ALLOC_OFFSET_MSG_FMT   "sys_bitarray_alloc with region size %i gave incorrect offset"

◆ FAIL_ALLOC_RET_MSG_FMT

#define FAIL_ALLOC_RET_MSG_FMT   "sys_bitarray_alloc with region size %i returned incorrect result"

◆ FAIL_FREE_MSG_FMT

#define FAIL_FREE_MSG_FMT   "sys_bitarray_free with region size %i and offset %i failed"

◆ FREE

Function Documentation

◆ alloc_and_free_interval()

void alloc_and_free_interval ( void )

◆ alloc_and_free_loop()

void alloc_and_free_loop ( int divisor)

◆ alloc_and_free_predefined()

void alloc_and_free_predefined ( void )

◆ bitarray_bundles_is_zero()

◆ cmp_u32_arrays()

static bool cmp_u32_arrays ( uint32_t * a1,
uint32_t * a2,
size_t sz )
static

◆ count_bits()

◆ get_bitarray_popcnt()

◆ test_bitarray_alloc_free()

void test_bitarray_alloc_free ( void )

◆ test_bitarray_declare()

void test_bitarray_declare ( void )

◆ test_bitarray_find_nth_set()

void test_bitarray_find_nth_set ( void )

◆ test_bitarray_popcount_region()

void test_bitarray_popcount_region ( void )

◆ test_bitarray_region_set_clear()

void test_bitarray_region_set_clear ( void )

◆ test_bitarray_set_clear()

◆ test_bitarray_xor()

◆ test_ffs()

void test_ffs ( void )

#include </home/runner/work/safety-doc/zephyr/tests/kernel/common/src/bitarray.c>

Test find MSB and LSB operations.

Verify the functions that find out the most significant bit and least significant bit work as expected.

See also
find_msb_set(), find_lsb_set()

◆ validate_bitarray_define()

void validate_bitarray_define ( sys_bitarray_t * ba,
size_t num_bits )