Zephyr API 3.6.99
Loading...
Searching...
No Matches
atomic_xtensa.h File Reference

Go to the source code of this file.

Functions

static ALWAYS_INLINE atomic_val_t atomic_get (const atomic_t *target)
 Implementation of atomic_get.
 
static ALWAYS_INLINE atomic_val_t xtensa_cas (atomic_t *addr, atomic_val_t oldval, atomic_val_t newval)
 Xtensa specific atomic compare-and-set (CAS).
 
static ALWAYS_INLINE bool atomic_cas (atomic_t *target, atomic_val_t oldval, atomic_val_t newval)
 Implementation of atomic_cas.
 
static ALWAYS_INLINE bool atomic_ptr_cas (atomic_ptr_t *target, void *oldval, void *newval)
 Implementation of atomic_ptr_cas.
 
static ALWAYS_INLINE atomic_val_t atomic_set (atomic_t *target, atomic_val_t value)
 Implementation of atomic_set.
 
static ALWAYS_INLINE atomic_val_t atomic_add (atomic_t *target, atomic_val_t value)
 Implementation of atomic_add.
 
static ALWAYS_INLINE atomic_val_t atomic_sub (atomic_t *target, atomic_val_t value)
 Implementation of atomic_sub.
 
static ALWAYS_INLINE atomic_val_t atomic_inc (atomic_t *target)
 Implementation of atomic_inc.
 
static ALWAYS_INLINE atomic_val_t atomic_dec (atomic_t *target)
 Implementation of atomic_dec.
 
static ALWAYS_INLINE atomic_val_t atomic_or (atomic_t *target, atomic_val_t value)
 Implementation of atomic_or.
 
static ALWAYS_INLINE atomic_val_t atomic_xor (atomic_t *target, atomic_val_t value)
 Implementation of atomic_xor.
 
static ALWAYS_INLINE atomic_val_t atomic_and (atomic_t *target, atomic_val_t value)
 Implementation of atomic_and.
 
static ALWAYS_INLINE atomic_val_t atomic_nand (atomic_t *target, atomic_val_t value)
 Implementation of atomic_nand.
 
static ALWAYS_INLINE void * atomic_ptr_get (const atomic_ptr_t *target)
 Implementation of atomic_ptr_get.
 
static ALWAYS_INLINE void * atomic_ptr_set (atomic_ptr_t *target, void *value)
 Implementation of atomic_ptr_set.
 
static ALWAYS_INLINE atomic_val_t atomic_clear (atomic_t *target)
 Implementation of atomic_clear.
 
static ALWAYS_INLINE void * atomic_ptr_clear (atomic_ptr_t *target)
 Implementation of atomic_ptr_clear.
 

Function Documentation

◆ atomic_add()

static ALWAYS_INLINE atomic_val_t atomic_add ( atomic_t * target,
atomic_val_t value )
static

Implementation of atomic_add.

◆ atomic_and()

static ALWAYS_INLINE atomic_val_t atomic_and ( atomic_t * target,
atomic_val_t value )
static

Implementation of atomic_and.

◆ atomic_cas()

static ALWAYS_INLINE bool atomic_cas ( atomic_t * target,
atomic_val_t oldval,
atomic_val_t newval )
static

Implementation of atomic_cas.

◆ atomic_clear()

static ALWAYS_INLINE atomic_val_t atomic_clear ( atomic_t * target)
static

Implementation of atomic_clear.

◆ atomic_dec()

static ALWAYS_INLINE atomic_val_t atomic_dec ( atomic_t * target)
static

Implementation of atomic_dec.

◆ atomic_get()

static ALWAYS_INLINE atomic_val_t atomic_get ( const atomic_t * target)
static

Implementation of atomic_get.

◆ atomic_inc()

static ALWAYS_INLINE atomic_val_t atomic_inc ( atomic_t * target)
static

Implementation of atomic_inc.

◆ atomic_nand()

static ALWAYS_INLINE atomic_val_t atomic_nand ( atomic_t * target,
atomic_val_t value )
static

Implementation of atomic_nand.

◆ atomic_or()

static ALWAYS_INLINE atomic_val_t atomic_or ( atomic_t * target,
atomic_val_t value )
static

Implementation of atomic_or.

◆ atomic_ptr_cas()

static ALWAYS_INLINE bool atomic_ptr_cas ( atomic_ptr_t * target,
void * oldval,
void * newval )
static

Implementation of atomic_ptr_cas.

◆ atomic_ptr_clear()

static ALWAYS_INLINE void * atomic_ptr_clear ( atomic_ptr_t * target)
static

Implementation of atomic_ptr_clear.

◆ atomic_ptr_get()

static ALWAYS_INLINE void * atomic_ptr_get ( const atomic_ptr_t * target)
static

Implementation of atomic_ptr_get.

◆ atomic_ptr_set()

static ALWAYS_INLINE void * atomic_ptr_set ( atomic_ptr_t * target,
void * value )
static

Implementation of atomic_ptr_set.

◆ atomic_set()

static ALWAYS_INLINE atomic_val_t atomic_set ( atomic_t * target,
atomic_val_t value )
static

Implementation of atomic_set.

◆ atomic_sub()

static ALWAYS_INLINE atomic_val_t atomic_sub ( atomic_t * target,
atomic_val_t value )
static

Implementation of atomic_sub.

◆ atomic_xor()

static ALWAYS_INLINE atomic_val_t atomic_xor ( atomic_t * target,
atomic_val_t value )
static

Implementation of atomic_xor.

◆ xtensa_cas()

static ALWAYS_INLINE atomic_val_t xtensa_cas ( atomic_t * addr,
atomic_val_t oldval,
atomic_val_t newval )
static

Xtensa specific atomic compare-and-set (CAS).

Parameters
addrAddress of atomic variable.
oldvalOriginal value to compare against.
newvalNew value to store.

This utilizes SCOMPARE1 register and s32c1i instruction to perform compare-and-set atomic operation. This will unconditionally read from the atomic variable at addr before the comparison. This value is returned from the function.

Returns
The value at the memory location before CAS.
See also
atomic_cas.