|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
FreeRTOS atomic operation support. More...
#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | ATOMIC_ENTER_CRITICAL() |
| #define | ATOMIC_EXIT_CRITICAL() |
| #define | portFORCE_INLINE |
| #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. | |
Functions | |
| static portFORCE_INLINE uint32_t | Atomic_CompareAndSwap_u32 (uint32_t volatile *pulDestination, uint32_t ulExchange, uint32_t ulComparand) |
| Atomic compare-and-swap. | |
| static portFORCE_INLINE void * | Atomic_SwapPointers_p32 (void *volatile *ppvDestination, void *pvExchange) |
| Atomic swap (pointers). | |
| static portFORCE_INLINE uint32_t | Atomic_CompareAndSwapPointers_p32 (void *volatile *ppvDestination, void *pvExchange, void *pvComparand) |
| Atomic compare-and-swap (pointers). | |
| static portFORCE_INLINE uint32_t | Atomic_Add_u32 (uint32_t volatile *pulAddend, uint32_t ulCount) |
| Atomic add. | |
| static portFORCE_INLINE uint32_t | Atomic_Subtract_u32 (uint32_t volatile *pulAddend, uint32_t ulCount) |
| Atomic subtract. | |
| static portFORCE_INLINE uint32_t | Atomic_Increment_u32 (uint32_t volatile *pulAddend) |
| Atomic increment. | |
| static portFORCE_INLINE uint32_t | Atomic_Decrement_u32 (uint32_t volatile *pulAddend) |
| Atomic decrement. | |
| static portFORCE_INLINE uint32_t | Atomic_OR_u32 (uint32_t volatile *pulDestination, uint32_t ulValue) |
| Atomic OR. | |
| static portFORCE_INLINE uint32_t | Atomic_AND_u32 (uint32_t volatile *pulDestination, uint32_t ulValue) |
| Atomic AND. | |
| static portFORCE_INLINE uint32_t | Atomic_NAND_u32 (uint32_t volatile *pulDestination, uint32_t ulValue) |
| Atomic NAND. | |
| static portFORCE_INLINE uint32_t | Atomic_XOR_u32 (uint32_t volatile *pulDestination, uint32_t ulValue) |
| Atomic XOR. | |
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.
Definition in file atomic.h.
| #define ATOMIC_COMPARE_AND_SWAP_FAILURE 0x0U |
Compare and swap failed, did not swap.
Definition at line 91 of file atomic.h.
Referenced by Atomic_CompareAndSwap_u32(), and Atomic_CompareAndSwapPointers_p32().
| #define ATOMIC_COMPARE_AND_SWAP_SUCCESS 0x1U |
Compare and swap succeeded, swapped.
Definition at line 90 of file atomic.h.
Referenced by Atomic_CompareAndSwap_u32(), and Atomic_CompareAndSwapPointers_p32().
| #define ATOMIC_ENTER_CRITICAL | ( | ) |
Definition at line 74 of file atomic.h.
Referenced by Atomic_Add_u32(), Atomic_AND_u32(), Atomic_CompareAndSwap_u32(), Atomic_CompareAndSwapPointers_p32(), Atomic_Decrement_u32(), Atomic_Increment_u32(), Atomic_NAND_u32(), Atomic_OR_u32(), Atomic_Subtract_u32(), Atomic_SwapPointers_p32(), and Atomic_XOR_u32().
| #define ATOMIC_EXIT_CRITICAL | ( | ) |
Definition at line 75 of file atomic.h.
Referenced by Atomic_Add_u32(), Atomic_AND_u32(), Atomic_CompareAndSwap_u32(), Atomic_CompareAndSwapPointers_p32(), Atomic_Decrement_u32(), Atomic_Increment_u32(), Atomic_NAND_u32(), Atomic_OR_u32(), Atomic_Subtract_u32(), Atomic_SwapPointers_p32(), and Atomic_XOR_u32().
| #define portFORCE_INLINE |
Definition at line 87 of file atomic.h.
Referenced by Atomic_Add_u32(), Atomic_AND_u32(), Atomic_CompareAndSwap_u32(), Atomic_CompareAndSwapPointers_p32(), Atomic_Decrement_u32(), Atomic_Increment_u32(), Atomic_NAND_u32(), Atomic_OR_u32(), Atomic_Subtract_u32(), Atomic_SwapPointers_p32(), Atomic_XOR_u32(), ulPortRaiseBASEPRI(), vPortRaiseBASEPRI(), vPortSetBASEPRI(), and xPortIsInsideInterrupt().
|
static |
Atomic add.
Atomically adds count to the value of the specified pointer points to.
| [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. |
Definition at line 211 of file atomic.h.
References ATOMIC_ENTER_CRITICAL, ATOMIC_EXIT_CRITICAL, and portFORCE_INLINE.
|
static |
Atomic AND.
Performs an atomic AND operation on the specified values.
| [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. |
Definition at line 344 of file atomic.h.
References ATOMIC_ENTER_CRITICAL, ATOMIC_EXIT_CRITICAL, and portFORCE_INLINE.
|
static |
Atomic compare-and-swap.
Performs an atomic compare-and-swap operation on the specified values.
| [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. |
Definition at line 110 of file atomic.h.
References ATOMIC_COMPARE_AND_SWAP_FAILURE, ATOMIC_COMPARE_AND_SWAP_SUCCESS, ATOMIC_ENTER_CRITICAL, ATOMIC_EXIT_CRITICAL, and portFORCE_INLINE.
|
static |
Atomic compare-and-swap (pointers).
Performs an atomic compare-and-swap operation on the specified pointer values.
| [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. |
Definition at line 178 of file atomic.h.
References ATOMIC_COMPARE_AND_SWAP_FAILURE, ATOMIC_COMPARE_AND_SWAP_SUCCESS, ATOMIC_ENTER_CRITICAL, ATOMIC_EXIT_CRITICAL, and portFORCE_INLINE.
|
static |
Atomic decrement.
Atomically decrements the value of the specified pointer points to
| [in,out] | pulAddend | Pointer to memory location from where value is to be loaded and written back to. |
Definition at line 290 of file atomic.h.
References ATOMIC_ENTER_CRITICAL, ATOMIC_EXIT_CRITICAL, and portFORCE_INLINE.
|
static |
Atomic increment.
Atomically increments the value of the specified pointer points to.
| [in,out] | pulAddend | Pointer to memory location from where value is to be loaded and written back to. |
Definition at line 265 of file atomic.h.
References ATOMIC_ENTER_CRITICAL, ATOMIC_EXIT_CRITICAL, and portFORCE_INLINE.
|
static |
Atomic NAND.
Performs an atomic NAND operation on the specified values.
| [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. |
Definition at line 371 of file atomic.h.
References ATOMIC_ENTER_CRITICAL, ATOMIC_EXIT_CRITICAL, and portFORCE_INLINE.
|
static |
Atomic OR.
Performs an atomic OR operation on the specified values.
| [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. |
Definition at line 317 of file atomic.h.
References ATOMIC_ENTER_CRITICAL, ATOMIC_EXIT_CRITICAL, and portFORCE_INLINE.
|
static |
Atomic subtract.
Atomically subtracts count from the value of the specified pointer pointers to.
| [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. |
Definition at line 239 of file atomic.h.
References ATOMIC_ENTER_CRITICAL, ATOMIC_EXIT_CRITICAL, and portFORCE_INLINE.
|
static |
Atomic swap (pointers).
Atomically sets the address pointed to by *ppvDestination to the value of *pvExchange.
| [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. |
Definition at line 146 of file atomic.h.
References ATOMIC_ENTER_CRITICAL, ATOMIC_EXIT_CRITICAL, and portFORCE_INLINE.
|
static |
Atomic XOR.
Performs an atomic XOR operation on the specified values.
| [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. |
Definition at line 398 of file atomic.h.
References ATOMIC_ENTER_CRITICAL, ATOMIC_EXIT_CRITICAL, and portFORCE_INLINE.