FreeRTOS port on GAP8/RISC-V
|
FreeRTOS atomic operation support. More...
Macros | |
#define | ATOMIC_ENTER_CRITICAL() |
#define | ATOMIC_EXIT_CRITICAL() |
#define | portFORCE_INLINE |
#define | ATOMIC_COMPARE_AND_SWAP_SUCCESS |
#define | ATOMIC_COMPARE_AND_SWAP_FAILURE |
Functions | |
static portFORCE_INLINE uint32_t | Atomic_CompareAndSwap_u32 (uint32_t volatile *pDestination, uint32_t ulExchange, uint32_t ulComparand) |
Performs an atomic compare-and-swap operation on the specified values. More... | |
static portFORCE_INLINE void * | Atomic_SwapPointers_p32 (void *volatile *ppDestination, void *pExchange) |
Atomically sets the address pointed to by *ppDestination to the value of *pExchange. More... | |
static portFORCE_INLINE uint32_t | Atomic_CompareAndSwapPointers_p32 (void *volatile *ppDestination, void *pExchange, void *pComparand) |
Performs an atomic compare-and-swap operation on the specified pointer values. More... | |
static portFORCE_INLINE uint32_t | Atomic_Add_u32 (uint32_t volatile *pAddend, uint32_t ulCount) |
Atomically adds count to the value of the specified pointer points to. More... | |
static portFORCE_INLINE uint32_t | Atomic_Subtract_u32 (uint32_t volatile *pAddend, uint32_t ulCount) |
Atomically subtracts count from the value of the specified pointer pointers to. More... | |
static portFORCE_INLINE uint32_t | Atomic_Increment_u32 (uint32_t volatile *pAddend) |
Atomically increments the value of the specified pointer points to. More... | |
static portFORCE_INLINE uint32_t | Atomic_Decrement_u32 (uint32_t volatile *pAddend) |
Atomically decrements the value of the specified pointer points to. More... | |
static portFORCE_INLINE uint32_t | Atomic_OR_u32 (uint32_t volatile *pDestination, uint32_t ulValue) |
Performs an atomic OR operation on the specified values. More... | |
static portFORCE_INLINE uint32_t | Atomic_AND_u32 (uint32_t volatile *pDestination, uint32_t ulValue) |
Performs an atomic AND operation on the specified values. More... | |
static portFORCE_INLINE uint32_t | Atomic_NAND_u32 (uint32_t volatile *pDestination, uint32_t ulValue) |
Performs an atomic NAND operation on the specified values. More... | |
static portFORCE_INLINE uint32_t | Atomic_XOR_u32 (uint32_t volatile *pDestination, uint32_t ulValue) |
Performs an atomic XOR operation on the specified values. More... | |
This file implements atomic by disabling interrupts globally. Implementation with architecture specific atomic instructions are to be provided under each compiler directory.
#define ATOMIC_COMPARE_AND_SWAP_FAILURE |
Compare and swap failed, did not swap.
Referenced by Atomic_CompareAndSwap_u32(), and Atomic_CompareAndSwapPointers_p32().
#define ATOMIC_COMPARE_AND_SWAP_SUCCESS |
Compare and swap succeeded, swapped.
Referenced by Atomic_CompareAndSwap_u32(), and Atomic_CompareAndSwapPointers_p32().
#define ATOMIC_ENTER_CRITICAL | ( | ) |
#define ATOMIC_EXIT_CRITICAL | ( | ) |
#define portFORCE_INLINE |
|
static |
Atomic add
[in,out] | pAddend | Pointer to memory location from where value is to be loaded and written back to. |
[in] | ulCount | Value to be added to *pAddend. |
References ATOMIC_ENTER_CRITICAL, and ATOMIC_EXIT_CRITICAL.
|
static |
Atomic AND
[in,out] | pDestination | Pointer to memory location from where value is to be loaded and written back to. |
[in] | ulValue | Value to be ANDed with *pDestination. |
References ATOMIC_ENTER_CRITICAL, and ATOMIC_EXIT_CRITICAL.
|
static |
Atomic compare-and-swap
[in,out] | pDestination | Pointer to memory location from where value is to be loaded and checked. |
[in] | ulExchange | If condition meets, write this value to memory. |
[in] | ulComparand | Swap condition. |
References ATOMIC_COMPARE_AND_SWAP_FAILURE, ATOMIC_COMPARE_AND_SWAP_SUCCESS, ATOMIC_ENTER_CRITICAL, and ATOMIC_EXIT_CRITICAL.
|
static |
Atomic compare-and-swap (pointers)
[in,out] | ppDestination | Pointer to memory location from where a pointer value is to be loaded and checked. |
[in] | pExchange | If condition meets, write this value to memory. |
[in] | pComparand | Swap condition. |
References ATOMIC_COMPARE_AND_SWAP_FAILURE, ATOMIC_COMPARE_AND_SWAP_SUCCESS, ATOMIC_ENTER_CRITICAL, and ATOMIC_EXIT_CRITICAL.
|
static |
Atomic decrement
[in,out] | pAddend | Pointer to memory location from where value is to be loaded and written back to. |
References ATOMIC_ENTER_CRITICAL, and ATOMIC_EXIT_CRITICAL.
|
static |
Atomic increment
[in,out] | pAddend | Pointer to memory location from where value is to be loaded and written back to. |
References ATOMIC_ENTER_CRITICAL, and ATOMIC_EXIT_CRITICAL.
|
static |
Atomic NAND
[in,out] | pDestination | Pointer to memory location from where value is to be loaded and written back to. |
[in] | ulValue | Value to be NANDed with *pDestination. |
References ATOMIC_ENTER_CRITICAL, and ATOMIC_EXIT_CRITICAL.
|
static |
Atomic OR
[in,out] | pDestination | Pointer to memory location from where value is to be loaded and written back to. |
[in] | ulValue | Value to be ORed with *pDestination. |
References ATOMIC_ENTER_CRITICAL, and ATOMIC_EXIT_CRITICAL.
|
static |
Atomic subtract
[in,out] | pAddend | Pointer to memory location from where value is to be loaded and written back to. |
[in] | ulCount | Value to be subtract from *pAddend. |
References ATOMIC_ENTER_CRITICAL, and ATOMIC_EXIT_CRITICAL.
|
static |
Atomic swap (pointers)
[in,out] | ppDestination | Pointer to memory location from where a pointer value is to be loaded and written back to. |
[in] | pExchange | Pointer value to be written to *ppDestination. |
References ATOMIC_ENTER_CRITICAL, and ATOMIC_EXIT_CRITICAL.
|
static |
Atomic XOR
[in,out] | pDestination | Pointer to memory location from where value is to be loaded and written back to. |
[in] | ulValue | Value to be XORed with *pDestination. |
References ATOMIC_ENTER_CRITICAL, and ATOMIC_EXIT_CRITICAL.