![]() |
F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
|
Namespaces | |
| Queue | |
Classes | |
| struct | LocklessAtomicLockFree |
| compile-time lock-free possibility for an atomic of unsigned integral width WIDTH More... | |
| class | LocklessPriorityQueue |
| lockless ISR-safe priority queue implementation for Os::QueueInterface More... | |
| struct | LocklessPriorityQueueHandle |
| handle for the lockless priority queue More... | |
| struct | LocklessSlot |
| per-slot data for the lockless priority queue More... | |
| class | PriorityMemQueue |
| AtomicQueue-based priority queue implementation. More... | |
| struct | PriorityMemQueueHandle |
| critical data stored for priority queue More... | |
| class | PriorityQueue |
| generic priority queue implementation More... | |
| struct | PriorityQueueHandle |
| critical data stored for priority queue More... | |
| struct | UsedTotal |
| Generic used/total struct. More... | |
Typedefs | |
| using | LocklessStateTagType = U64 |
Enumerations | |
| enum | LocklessSlotState : LocklessStateTagType { LOCKLESS_SLOT_FREE = 0, LOCKLESS_SLOT_WRITING = 1, LOCKLESS_SLOT_READY = 2, LOCKLESS_SLOT_READING = 3 } |
| slot lifecycle states for the lockless priority queue More... | |
| enum | Status { OP_OK, ERROR } |
| Generic OK/ERROR status. More... | |
Functions | |
| static constexpr U32 | priorityBitMask (FwQueuePriorityType priority) |
| Get the bit mask for a priority. More... | |
| static I32 | findMSB (U32 value) |
| Find most significant bit set (IPC-style priority finding) More... | |
| static void | validateQueueConfigs (PriorityMemQueue::QueueConfig *queueConfigs, FwSizeType numQueueConfigs) |
| Validate queue configuration structures. More... | |
| static Types::AtomicQueue * | resolvePriorityQueue (PriorityMemQueueHandle &handle, FwQueuePriorityType &priority, FwEnumStoreType queueId, bool requirePrioritySizing) |
| Resolve priority to a valid AtomicQueue, fallback to DEFAULT if needed. More... | |
| static void | updateHighWaterMark (std::atomic< U32 > *highWaterMarks, FwSizeType index, U32 currentDepth, FwEnumStoreType queueId) |
| Update per-priority high water mark atomically. More... | |
Variables | |
| constexpr U32 | LOCKLESS_QUEUE_BLOCKING_BACKOFF_US = 100 |
| constexpr FwSizeType | LOCKLESS_QUEUE_SLOT_ALIGNMENT = 64 |
| constexpr FwSizeType | LOCKLESS_QUEUE_MAX_RETRY_PASSES = 4 |
| constexpr U32 | LOOP_GUARD_LIMIT = 2000 |
| typedef U64 Os::Generic::LocklessStateTagType |
Unsigned integral type of the lockless queue slot state-tag word. The low STATE_BITS hold the slot state; the remaining bits hold the ABA epoch tag. std::atomic of this type must be lock-free on the target platform (never-lock-free widths are rejected at compile time; the authoritative check is runtime-asserted at create()). Platforms without lock-free 64-bit atomics may configure a narrower type (U32, U16, or U8), shrinking the ABA tag by the same amount (62, 30, 14, or 6 tag bits respectively; see SDD sections 4 and 15 for the wrap consequence and a WARNING on the narrow-tag ordering risk).
Definition at line 26 of file LocklessQueueCfg.hpp.
slot lifecycle states for the lockless priority queue
Each slot in the queue moves through a four-state state machine. Producers transition slots FREE -> WRITING -> READY. Consumers transition slots READY -> READING -> FREE. State values occupy the low bits of a packed atomic; the remaining bits are used as an ABA tag.
Definition at line 59 of file LocklessPriorityQueue.hpp.
| enum Os::Generic::Status |
|
inlinestatic |
Find most significant bit set (IPC-style priority finding)
| value | bit mask to search |
Definition at line 190 of file PriorityMemQueue.cpp.
|
static |
Get the bit mask for a priority.
| priority | priority to get mask for |
Definition at line 54 of file PriorityMemQueue.cpp.
|
static |
Resolve priority to a valid AtomicQueue, fallback to DEFAULT if needed.
| handle | queue handle |
| priority | input/output priority (may be modified to DEFAULT) |
| queueId | queue ID for assertions |
| requirePrioritySizing | whether to assert on fallback |
Definition at line 591 of file PriorityMemQueue.cpp.
|
static |
Update per-priority high water mark atomically.
| highWaterMarks | array of HWM atomics |
| index | array index (not priority value) |
| currentDepth | current queue depth |
| queueId | queue ID for assertions |
Definition at line 621 of file PriorityMemQueue.cpp.
|
static |
Validate queue configuration structures.
| queueConfigs | array of queue configurations to validate |
| numQueueConfigs | number of configurations |
Definition at line 258 of file PriorityMemQueue.cpp.
| constexpr U32 Os::Generic::LOCKLESS_QUEUE_BLOCKING_BACKOFF_US = 100 |
Backoff (microseconds) between bounded scans on the BLOCKING send/receive paths. Shorter values lower message latency; longer values lower idle CPU use of blocked threads. Must be greater than 0: a zero backoff could livelock on a strict-priority scheduler.
Definition at line 31 of file LocklessQueueCfg.hpp.
| constexpr FwSizeType Os::Generic::LOCKLESS_QUEUE_MAX_RETRY_PASSES = 4 |
Retry passes through the slot array before a NONBLOCKING operation returns FULL/EMPTY. Larger values reduce spurious FULL/EMPTY under contention at the cost of a larger bound on non-blocking call time (depth * passes).
Definition at line 41 of file LocklessQueueCfg.hpp.
| constexpr FwSizeType Os::Generic::LOCKLESS_QUEUE_SLOT_ALIGNMENT = 64 |
Alignment (bytes) of each queue slot. Set to the target's cache-line size (typically 64) to avoid false sharing between adjacent slots under contention; smaller power-of-two values reduce memory use on constrained targets.
Definition at line 36 of file LocklessQueueCfg.hpp.
| constexpr U32 Os::Generic::LOOP_GUARD_LIMIT = 2000 |
Definition at line 26 of file PriorityMemQueue.cpp.