8#ifndef ZEPHYR_INCLUDE_SYS_ATOMIC_H_
9#define ZEPHYR_INCLUDE_SYS_ATOMIC_H_
28#if defined(CONFIG_ATOMIC_OPERATIONS_C)
31#elif defined(CONFIG_ATOMIC_OPERATIONS_ARCH)
61#define ATOMIC_INIT(i) (i)
72#define ATOMIC_PTR_INIT(p) (p)
78#define ATOMIC_BITS (sizeof(atomic_val_t) * 8)
79#define ATOMIC_MASK(bit) (1U << ((uint32_t)(bit) & (ATOMIC_BITS - 1U)))
80#define ATOMIC_ELEM(addr, bit) ((addr) + ((bit) / ATOMIC_BITS))
92#define ATOMIC_BITMAP_SIZE(num_bits) (1 + ((num_bits) - 1) / ATOMIC_BITS)
113#define ATOMIC_DEFINE(name, num_bits) \
114 atomic_t name[ATOMIC_BITMAP_SIZE(num_bits)]
131 return (1 & (val >> (bit & (ATOMIC_BITS - 1)))) != 0;
152 return (old & mask) != 0;
173 return (old & mask) != 0;
atomic_t atomic_val_t
Definition: atomic.h:22
atomic_ptr_t atomic_ptr_val_t
Definition: atomic.h:24
void * atomic_ptr_t
Definition: atomic.h:23
int atomic_t
Definition: atomic.h:21
static ALWAYS_INLINE atomic_val_t atomic_and(atomic_t *target, atomic_val_t value)
Definition: atomic_xtensa.h:111
static ALWAYS_INLINE atomic_val_t atomic_get(const atomic_t *target)
Definition: atomic_xtensa.h:16
static ALWAYS_INLINE atomic_val_t atomic_or(atomic_t *target, atomic_val_t value)
Definition: atomic_xtensa.h:99
void
Definition: eswifi_shell.c:15
static void atomic_set_bit(atomic_t *target, int bit)
Atomically set a bit.
Definition: atomic.h:205
static bool atomic_test_bit(const atomic_t *target, int bit)
Atomically test a bit.
Definition: atomic.h:127
static void atomic_clear_bit(atomic_t *target, int bit)
Atomically clear a bit.
Definition: atomic.h:187
static bool atomic_test_and_clear_bit(atomic_t *target, int bit)
Atomically test and clear a bit.
Definition: atomic.h:145
static bool atomic_test_and_set_bit(atomic_t *target, int bit)
Atomically set a bit.
Definition: atomic.h:166
static void atomic_set_bit_to(atomic_t *target, int bit, bool val)
Atomically set a bit to a given value.
Definition: atomic.h:224
int target
Definition: main.c:68