AWS IoT Device SDK C:
Platform
Platform portability layer
|
Return to main page ↑ |
Generic implementation of atomic operations. More...
Go to the source code of this file.
Functions | |
static uint32_t | Atomic_CompareAndSwap_u32 (uint32_t volatile *pDestination, uint32_t newValue, uint32_t comparand) |
Performs an atomic compare-and-swap operation on the given values. More... | |
static void * | Atomic_Swap_Pointer (void *volatile *pDestination, void *pNewValue) |
Atomically writes a pointer value to memory. More... | |
static uint32_t | Atomic_CompareAndSwap_Pointer (void *volatile *pDestination, void *pNewValue, void *pComparand) |
Performs an atomic compare-and-swap operation on the given pointers. More... | |
static uint32_t | Atomic_Add_u32 (uint32_t volatile *pAugend, uint32_t addend) |
Performs an atomic addition of the given values. More... | |
static uint32_t | Atomic_Subtract_u32 (uint32_t volatile *pMinuend, uint32_t subtrahend) |
Performs an atomic subtraction of the given values. More... | |
static uint32_t | Atomic_Increment_u32 (uint32_t volatile *pAugend) |
Atomically adds 1 to the given value. More... | |
static uint32_t | Atomic_Decrement_u32 (uint32_t volatile *pMinuend) |
Atomically subtracts 1 from the given value. More... | |
static uint32_t | Atomic_OR_u32 (uint32_t volatile *pOperand, uint32_t mask) |
Performs an atomic bitwise OR of the given values. More... | |
static uint32_t | Atomic_XOR_u32 (uint32_t volatile *pOperand, uint32_t mask) |
Performs an atomic bitwise XOR of the given values. More... | |
static uint32_t | Atomic_AND_u32 (uint32_t volatile *pOperand, uint32_t mask) |
Performs an atomic bitwise AND of the given values. More... | |
static uint32_t | Atomic_NAND_u32 (uint32_t volatile *pOperand, uint32_t mask) |
Performs an atomic bitwise NAND of the given values. More... | |
Generic implementation of atomic operations.
This implementation is less efficient than the specific atomic implementations, but should work on all platforms.
|
inlinestatic |
Performs an atomic compare-and-swap operation on the given values.
[in,out] | pDestination | Pointer to memory location from where value is to be loaded and checked. |
[in] | newValue | This value will be written to memory if the comparand matches the value at pDestination . |
[in] | comparand | This value is compared to the value at pDestination . |
1
if the newValue
was written to pDestination
; 0
otherwise.
|
inlinestatic |
Atomically writes a pointer value to memory.
[in,out] | pDestination | Where pNewValue will be written. |
[in] | pNewValue | The value to write to pDestination . |
pDestination
.
|
inlinestatic |
Performs an atomic compare-and-swap operation on the given pointers.
[in,out] | pDestination | Pointer to the memory location to be loaded and checked. |
[in] | pNewValue | This value will be written to memory if the comparand matches the value at pDestination . |
[in] | pComparand | This value is compared to the value at pDestination . |
1
if the newValue
was written to pDestination
; 0
otherwise.
|
inlinestatic |
Performs an atomic addition of the given values.
[in,out] | pAugend | Pointer to the augend and where the sum is stored. |
[in] | addend | Value to add to the augend. |
pAugend
.
|
inlinestatic |
Performs an atomic subtraction of the given values.
[in,out] | pMinuend | Pointer to the minuend and where the difference is stored. |
[in] | subtrahend | Value to subtract from the minuend. |
pMinuend
.
|
inlinestatic |
Atomically adds 1 to the given value.
[in,out] | pAugend | Pointer to the augend and where the sum is stored. |
pAugend
.
|
inlinestatic |
Atomically subtracts 1 from the given value.
[in,out] | pMinuend | Pointer to the minuend and where the difference is stored. |
pMinuend
.
|
inlinestatic |
Performs an atomic bitwise OR of the given values.
[in,out] | pOperand | Pointer to operand and where the result is stored. |
[in] | mask | Mask to OR with the operand. |
pOperand
.
|
inlinestatic |
Performs an atomic bitwise XOR of the given values.
[in,out] | pOperand | Pointer to operand and where the result is stored. |
[in] | mask | Mask to XOR with the operand. |
pOperand
.
|
inlinestatic |
Performs an atomic bitwise AND of the given values.
[in,out] | pOperand | Pointer to operand and where the result is stored. |
[in] | mask | Mask to AND with the operand. |
pOperand
.
|
inlinestatic |
Performs an atomic bitwise NAND of the given values.
[in,out] | pOperand | Pointer to operand and where the result is stored. |
[in] | mask | Mask to NAND with the operand. |
pOperand
.