Line data Source code
1 0 : /* 2 : * Copyright (c) 2021 Demant A/S 3 : * Copyright (c) 2023 Nordic Semiconductor ASA 4 : * 5 : * SPDX-License-Identifier: Apache-2.0 6 : */ 7 : 8 : #ifndef ZEPHYR_INCLUDE_SYS_ATOMIC_ARCH_H_ 9 : #define ZEPHYR_INCLUDE_SYS_ATOMIC_ARCH_H_ 10 : 11 : #include <stdbool.h> 12 : #include <zephyr/sys/atomic_types.h> 13 : 14 : /* Included from <atomic.h> */ 15 : 16 : /* Arch specific atomic primitives */ 17 : 18 0 : bool atomic_cas(atomic_t *target, atomic_val_t old_value, 19 : atomic_val_t new_value); 20 : 21 0 : bool atomic_ptr_cas(atomic_ptr_t *target, void *old_value, 22 : void *new_value); 23 : 24 0 : atomic_val_t atomic_add(atomic_t *target, atomic_val_t value); 25 : 26 0 : atomic_val_t atomic_sub(atomic_t *target, atomic_val_t value); 27 : 28 0 : atomic_val_t atomic_inc(atomic_t *target); 29 : 30 0 : atomic_val_t atomic_dec(atomic_t *target); 31 : 32 0 : atomic_val_t atomic_get(const atomic_t *target); 33 : 34 0 : void *atomic_ptr_get(const atomic_ptr_t *target); 35 : 36 0 : atomic_val_t atomic_set(atomic_t *target, atomic_val_t value); 37 : 38 0 : void *atomic_ptr_set(atomic_ptr_t *target, void *value); 39 : 40 0 : atomic_val_t atomic_clear(atomic_t *target); 41 : 42 0 : void *atomic_ptr_clear(atomic_ptr_t *target); 43 : 44 0 : atomic_val_t atomic_or(atomic_t *target, atomic_val_t value); 45 : 46 0 : atomic_val_t atomic_xor(atomic_t *target, atomic_val_t value); 47 : 48 0 : atomic_val_t atomic_and(atomic_t *target, atomic_val_t value); 49 : 50 0 : atomic_val_t atomic_nand(atomic_t *target, atomic_val_t value); 51 : 52 : 53 : #endif /* ZEPHYR_INCLUDE_SYS_ATOMIC_ARCH_H_ */