7#ifndef ZEPHYR_INCLUDE_SYS_BITARRAY_H_
8#define ZEPHYR_INCLUDE_SYS_BITARRAY_H_
43#define SYS_BITARRAY_DEFINE(name, total_bits) \
44 uint32_t _sys_bitarray_bundles_##name \
45 [(((total_bits + 8 - 1) / 8) + sizeof(uint32_t) - 1) \
46 / sizeof(uint32_t)] = {0U}; \
47 sys_bitarray_t name = { \
48 .num_bits = total_bits, \
49 .num_bundles = (((total_bits + 8 - 1) / 8) \
50 + sizeof(uint32_t) - 1) \
52 .bundles = _sys_bitarray_bundles_##name, \
bool sys_bitarray_is_region_cleared(sys_bitarray_t *bitarray, size_t num_bits, size_t offset)
bool sys_bitarray_is_region_set(sys_bitarray_t *bitarray, size_t num_bits, size_t offset)
int sys_bitarray_test_and_clear_bit(sys_bitarray_t *bitarray, size_t bit, int *prev_val)
int sys_bitarray_set_bit(sys_bitarray_t *bitarray, size_t bit)
int sys_bitarray_clear_bit(sys_bitarray_t *bitarray, size_t bit)
int sys_bitarray_set_region(sys_bitarray_t *bitarray, size_t num_bits, size_t offset)
int sys_bitarray_alloc(sys_bitarray_t *bitarray, size_t num_bits, size_t *offset)
int sys_bitarray_clear_region(sys_bitarray_t *bitarray, size_t num_bits, size_t offset)
int sys_bitarray_test_and_set_bit(sys_bitarray_t *bitarray, size_t bit, int *prev_val)
int sys_bitarray_test_bit(sys_bitarray_t *bitarray, size_t bit, int *val)
int sys_bitarray_free(sys_bitarray_t *bitarray, size_t num_bits, size_t offset)
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
Kernel Spin Lock.
Definition: spinlock.h:29
Definition: bitarray.h:19
uint32_t num_bits
Definition: bitarray.h:21
struct k_spinlock lock
Definition: bitarray.h:30
uint32_t * bundles
Definition: bitarray.h:27
uint32_t num_bundles
Definition: bitarray.h:24