Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
Macros | |
#define | ATOMIC_INIT(i) (i) |
Initialize an atomic variable. More... | |
#define | ATOMIC_PTR_INIT(p) (p) |
Initialize an atomic pointer variable. More... | |
#define | ATOMIC_BITMAP_SIZE(num_bits) (1 + ((num_bits) - 1) / ATOMIC_BITS) |
This macro computes the number of atomic variables necessary to represent a bitmap with num_bits. More... | |
#define | ATOMIC_DEFINE(name, num_bits) atomic_t name[ATOMIC_BITMAP_SIZE(num_bits)] |
Define an array of atomic variables. More... | |
#define ATOMIC_BITMAP_SIZE | ( | num_bits | ) | (1 + ((num_bits) - 1) / ATOMIC_BITS) |
#include <include/sys/atomic.h>
This macro computes the number of atomic variables necessary to represent a bitmap with num_bits.
num_bits | Number of bits. |
#define ATOMIC_DEFINE | ( | name, | |
num_bits | |||
) | atomic_t name[ATOMIC_BITMAP_SIZE(num_bits)] |
#include <include/sys/atomic.h>
Define an array of atomic variables.
This macro defines an array of atomic variables containing at least num_bits bits.
name | Name of array of atomic variables. |
num_bits | Number of bits needed. |
#define ATOMIC_INIT | ( | i | ) | (i) |
#include <include/sys/atomic.h>
Initialize an atomic variable.
This macro can be used to initialize an atomic variable. For example,
i | Value to assign to atomic variable. |
#include <include/sys/atomic.h>
Initialize an atomic pointer variable.
This macro can be used to initialize an atomic pointer variable. For example,
p | Pointer value to assign to atomic pointer variable. |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic addition.
This routine performs an atomic addition on target.
target | Address of atomic variable. |
value | Value to add. |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic bitwise AND.
This routine atomically sets target to the bitwise AND of target and value.
target | Address of atomic variable. |
value | Value to AND. |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic compare-and-set.
This routine performs an atomic compare-and-set on target. If the current value of target equals old_value, target is set to new_value. If the current value of target does not equal old_value, target is left unchanged.
target | Address of atomic variable. |
old_value | Original value to compare against. |
new_value | New value to store. |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic clear.
This routine atomically sets target to zero and returns its previous value. (Hence, it is equivalent to atomic_set(target, 0).)
target | Address of atomic variable. |
#include <include/sys/atomic.h>
Atomically clear a bit.
Atomically clear bit number bit of target. The target may be a single atomic variable or an array of them.
target | Address of atomic variable or array. |
bit | Bit number (starting from 0). |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic decrement.
This routine performs an atomic decrement by 1 on target.
target | Address of atomic variable. |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic get.
This routine performs an atomic read on target.
target | Address of atomic variable. |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic increment.
This routine performs an atomic increment by 1 on target.
target | Address of atomic variable. |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic bitwise NAND.
This routine atomically sets target to the bitwise NAND of target and value. (This operation is equivalent to target = ~(target & value).)
target | Address of atomic variable. |
value | Value to NAND. |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic bitwise inclusive OR.
This routine atomically sets target to the bitwise inclusive OR of target and value.
target | Address of atomic variable. |
value | Value to OR. |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic compare-and-set with pointer values.
This routine performs an atomic compare-and-set on target. If the current value of target equals old_value, target is set to new_value. If the current value of target does not equal old_value, target is left unchanged.
target | Address of atomic variable. |
old_value | Original value to compare against. |
new_value | New value to store. |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic clear of a pointer value.
This routine atomically sets target to zero and returns its previous value. (Hence, it is equivalent to atomic_set(target, 0).)
target | Address of atomic variable. |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic get a pointer value.
This routine performs an atomic read on target.
target | Address of pointer variable. |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic get-and-set for pointer values.
This routine atomically sets target to value and returns the previous value of target.
target | Address of atomic variable. |
value | Value to write to target. |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic get-and-set.
This routine atomically sets target to value and returns the previous value of target.
target | Address of atomic variable. |
value | Value to write to target. |
#include <include/sys/atomic.h>
Atomically set a bit.
Atomically set bit number bit of target. The target may be a single atomic variable or an array of them.
target | Address of atomic variable or array. |
bit | Bit number (starting from 0). |
#include <include/sys/atomic.h>
Atomically set a bit to a given value.
Atomically set bit number bit of target to value val. The target may be a single atomic variable or an array of them.
target | Address of atomic variable or array. |
bit | Bit number (starting from 0). |
val | true for 1, false for 0. |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic subtraction.
This routine performs an atomic subtraction on target.
target | Address of atomic variable. |
value | Value to subtract. |
#include <include/sys/atomic.h>
Atomically test and clear a bit.
Atomically clear bit number bit of target and return its old value. The target may be a single atomic variable or an array of them.
target | Address of atomic variable or array. |
bit | Bit number (starting from 0). |
#include <include/sys/atomic.h>
Atomically set a bit.
Atomically set bit number bit of target and return its old value. The target may be a single atomic variable or an array of them.
target | Address of atomic variable or array. |
bit | Bit number (starting from 0). |
#include <include/sys/atomic.h>
Atomically test a bit.
This routine tests whether bit number bit of target is set or not. The target may be a single atomic variable or an array of them.
target | Address of atomic variable or array. |
bit | Bit number (starting from 0). |
|
inlinestatic |
#include <include/sys/atomic_builtin.h>
Atomic bitwise exclusive OR (XOR).
This routine atomically sets target to the bitwise exclusive OR (XOR) of target and value.
target | Address of atomic variable. |
value | Value to XOR |