FreeRTOS:
Platform
Platform portability layer
|
Return to main page ↑ |
FreeRTOS atomic operation support. More...
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | ATOMIC_ENTER_CRITICAL() portENTER_CRITICAL() |
#define | ATOMIC_EXIT_CRITICAL() portEXIT_CRITICAL() |
#define | portFORCE_INLINE |
#define | ATOMIC_COMPARE_AND_SWAP_SUCCESS 0x1U |
#define | ATOMIC_COMPARE_AND_SWAP_FAILURE 0x0U |
Functions | |
static portFORCE_INLINE uint32_t | Atomic_CompareAndSwap_u32 (uint32_t volatile *pulDestination, 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 *ppvDestination, void *pvExchange) |
Atomically sets the address pointed to by *ppvDestination to the value of *pvExchange. More... | |
static portFORCE_INLINE uint32_t | Atomic_CompareAndSwapPointers_p32 (void *volatile *ppvDestination, void *pvExchange, void *pvComparand) |
Performs an atomic compare-and-swap operation on the specified pointer values. More... | |
static portFORCE_INLINE uint32_t | Atomic_Add_u32 (uint32_t volatile *pulAddend, 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 *pulAddend, 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 *pulAddend) |
Atomically increments the value of the specified pointer points to. More... | |
static portFORCE_INLINE uint32_t | Atomic_Decrement_u32 (uint32_t volatile *pulAddend) |
Atomically decrements the value of the specified pointer points to. More... | |
static portFORCE_INLINE uint32_t | Atomic_OR_u32 (uint32_t volatile *pulDestination, uint32_t ulValue) |
Performs an atomic OR operation on the specified values. More... | |
static portFORCE_INLINE uint32_t | Atomic_AND_u32 (uint32_t volatile *pulDestination, uint32_t ulValue) |
Performs an atomic AND operation on the specified values. More... | |
static portFORCE_INLINE uint32_t | Atomic_NAND_u32 (uint32_t volatile *pulDestination, uint32_t ulValue) |
Performs an atomic NAND operation on the specified values. More... | |
static portFORCE_INLINE uint32_t | Atomic_XOR_u32 (uint32_t volatile *pulDestination, uint32_t ulValue) |
Performs an atomic XOR operation on the specified values. More... | |
FreeRTOS atomic operation support.
This file implements atomic functions by disabling interrupts globally. Implementations with architecture specific atomic instructions can be provided under each compiler directory.
#define ATOMIC_COMPARE_AND_SWAP_SUCCESS 0x1U |
Compare and swap succeeded, swapped.
#define ATOMIC_COMPARE_AND_SWAP_FAILURE 0x0U |
Compare and swap failed, did not swap.
|
static |
Performs an atomic compare-and-swap operation on the specified values.
Atomic compare-and-swap
[in,out] | pulDestination | 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. |
|
static |
Atomically sets the address pointed to by *ppvDestination to the value of *pvExchange.
Atomic swap (pointers)
[in,out] | ppvDestination | Pointer to memory location from where a pointer value is to be loaded and written back to. |
[in] | pvExchange | Pointer value to be written to *ppvDestination. |
|
static |
Performs an atomic compare-and-swap operation on the specified pointer values.
Atomic compare-and-swap (pointers)
[in,out] | ppvDestination | Pointer to memory location from where a pointer value is to be loaded and checked. |
[in] | pvExchange | If condition meets, write this value to memory. |
[in] | pvComparand | Swap condition. |
|
static |
Atomically adds count to the value of the specified pointer points to.
Atomic add
[in,out] | pulAddend | Pointer to memory location from where value is to be loaded and written back to. |
[in] | ulCount | Value to be added to *pulAddend. |
|
static |
Atomically subtracts count from the value of the specified pointer pointers to.
Atomic subtract
[in,out] | pulAddend | Pointer to memory location from where value is to be loaded and written back to. |
[in] | ulCount | Value to be subtract from *pulAddend. |
|
static |
Atomically increments the value of the specified pointer points to.
Atomic increment
[in,out] | pulAddend | Pointer to memory location from where value is to be loaded and written back to. |
|
static |
Atomically decrements the value of the specified pointer points to.
Atomic decrement
[in,out] | pulAddend | Pointer to memory location from where value is to be loaded and written back to. |
|
static |
Performs an atomic OR operation on the specified values.
Atomic OR
[in,out] | pulDestination | Pointer to memory location from where value is to be loaded and written back to. |
[in] | ulValue | Value to be ORed with *pulDestination. |
|
static |
Performs an atomic AND operation on the specified values.
Atomic AND
[in,out] | pulDestination | Pointer to memory location from where value is to be loaded and written back to. |
[in] | ulValue | Value to be ANDed with *pulDestination. |
|
static |
Performs an atomic NAND operation on the specified values.
Atomic NAND
[in,out] | pulDestination | Pointer to memory location from where value is to be loaded and written back to. |
[in] | ulValue | Value to be NANDed with *pulDestination. |
|
static |
Performs an atomic XOR operation on the specified values.
Atomic XOR
[in,out] | pulDestination | Pointer to memory location from where value is to be loaded and written back to. |
[in] | ulValue | Value to be XORed with *pulDestination. |