![]() |
SuperTinyKernel™ RTOS 1.06.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Compiler and platform low-level definitions for STK. More...
#include <cstddef>#include <cstdint>#include <algorithm>#include "stk_config.h"Go to the source code of this file.
Classes | |
| struct | STK_ALLOCATE_COUNT< MODE, FLAG, ONTRUE, ONFALSE > |
| Selects a static array element count at compile time based on a mode flag. More... | |
Namespaces | |
| namespace | stk |
| Namespace of STK package. | |
| namespace | stk::util |
| Internal utility namespace containing data structure helpers (linked lists, etc.) used by the kernel implementation. Not part of the public user API. | |
Macros | |
| #define | STK_STRICT_COMPLIANCY (0) |
| Allow the use of workarounds to make binary smaller and faster. | |
| #define | STK_TICKLESS_USE_ARM_DWT (1) |
| Use DWT timer of ARM Cortex-M for a precise tick calculation. | |
| #define | STK_TICKLESS_TICKS_MAX (1000) |
| Maximum number of kernel ticks the hardware timer may be suppressed in one tickless idle interval when STK_TICKLESS_IDLE=1. Default: 1000. | |
| #define | STK_TLS (0) |
| Enable per-task thread-local storage (TLS). | |
| #define | STK_TLS_PREFER_REGISTER (0) |
| Store the per-task TLS pointer in a dedicated CPU register instead of the stk::Stack::tls member, enabling single-instruction TLS access. | |
| #define | STK_SYNC_DEBUG_NAMES (0) |
| Enable debug names for synchronization primitives (mutexes, events, etc.) for debugging and tracing purposes. | |
| #define | STK_VIRT_DTOR |
| Makes destructors virtual and compliant to strict rules if STK_STRICT_COMPLIANCY=0. | |
| #define | __stk_forceinline inline |
| Forces compiler to always inline the decorated function, regardless of optimisation level. | |
| #define | __stk_aligned(x) |
| Specifies minimum alignment in bytes for the decorated variable or struct member (data instance prefix). | |
| #define | __stk_weak |
| Marks a function or variable as weak, allowing it to be overridden by the user. | |
| #define | __stk_attr_naked |
| Suppresses compiler-generated function prologue and epilogue (function prefix). | |
| #define | __stk_attr_noreturn |
| Declares that function never returns to its caller (function prefix). | |
| #define | __stk_attr_unused |
| Suppresses compiler warnings about an unused type, variable, or function (declaration prefix). | |
| #define | __stk_attr_used |
| Marks a symbol as used, preventing the linker from discarding it even if no references are visible (declaration prefix). | |
| #define | __stk_attr_noinline |
| Prevents compiler from inlining the decorated function (function prefix). | |
| #define | __stk_attr_deprecated |
| Marks a function, class, variable, or typedef as deprecated (declaration prefix). | |
| #define | __stk_constexpr_cpp17 |
| constexpr definition for C++17 and above. | |
| #define | STK_ASSERT(e) |
| Runtime assertion. Halts execution if the expression e evaluates to false. | |
| #define | STK_STATIC_ASSERT_DESC_N(NAME, X, DESC) |
| Compile-time assertion with a user-defined name suffix and a custom error description. | |
| #define | STK_STATIC_ASSERT_DESC(X, DESC) |
| Compile-time assertion with a custom error description. Produces a compilation error if X is false. | |
| #define | STK_STATIC_ASSERT_N(NAME, X) |
| Compile-time assertion with a user-defined name suffix. | |
| #define | STK_STATIC_ASSERT(X) |
| Compile-time assertion. Produces a compilation error if X is false. | |
| #define | STK_STACK_MEMORY_FILLER (static_cast<stk::Word>((sizeof(stk::Word) <= 4U) ? 0xDEADBEEFU : 0xDEADBEEFDEADBEEFULL)) |
| Sentinel value written to the entire stack region at initialization (stack watermark pattern). | |
| #define | STK_STACK_MEMORY_ALIGN (4U) |
| Stack memory alignment. | |
| #define | STK_CRITICAL_SECTION_NESTINGS_MAX (16U) |
| Maximum allowable recursion depth for critical section entry (default: 16). | |
| #define | STK_ARCH_CPU_COUNT (1U) |
| Number of physical CPU cores available to the scheduler (default: 1). | |
| #define | STK_STACK_SIZE_MIN (32U) |
Minimum stack size in elements of Word, shared by all stack allocation lower-bound checks. | |
| #define | STK_SLEEP_TRAP_STACK_SIZE (STK_STACK_SIZE_MIN) |
Stack size for the sleep trap in elements of Word (default: STK_STACK_SIZE_MIN). | |
| #define | STK_ENDIAN_IDX_HI (1U) |
Array index of the high 32-bit word when a 64-bit value is viewed as uint32_t[2]. | |
| #define | STK_ENDIAN_IDX_LO (0U) |
Array index of the low 32-bit word when a 64-bit value is viewed as uint32_t[2]. | |
| #define | STK_NONCOPYABLE_CLASS(TYPE) |
| Disables copy construction and assignment for a class. | |
| #define | STK_UNUSED(X) |
| Explicitly marks a variable as unused to suppress compiler warnings. | |
Functions | |
| static void | __stk_debug_break () |
| template<typename T> | |
| static constexpr T | stk::Min (T a, T b) |
| Compile-time minimum of two values. | |
| template<typename T> | |
| static constexpr T | stk::Max (T a, T b) |
| Compile-time maximum of two values. | |
Compiler and platform low-level definitions for STK.
Definition in file stk_defs.h.
| #define __stk_aligned | ( | x | ) |
Specifies minimum alignment in bytes for the decorated variable or struct member (data instance prefix).
| [in] | x | Required alignment in bytes. Must be a power of two. |
Definition at line 187 of file stk_defs.h.
| #define __stk_attr_deprecated |
Marks a function, class, variable, or typedef as deprecated (declaration prefix).
Definition at line 268 of file stk_defs.h.
| #define __stk_attr_naked |
Suppresses compiler-generated function prologue and epilogue (function prefix).
Definition at line 211 of file stk_defs.h.
| #define __stk_attr_noinline |
Prevents compiler from inlining the decorated function (function prefix).
Definition at line 255 of file stk_defs.h.
Referenced by stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::AddTask(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::AddTask(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::FindTaskBySP(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::FindTaskByUserTask(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::Initialize(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::InitTraps(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnStart(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnStop(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::RemoveTask(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::RequestAddTask(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::ScheduleTaskRemoval(), and stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::Start().
| #define __stk_attr_noreturn |
Declares that function never returns to its caller (function prefix).
Definition at line 222 of file stk_defs.h.
| #define __stk_attr_unused |
Suppresses compiler warnings about an unused type, variable, or function (declaration prefix).
Definition at line 233 of file stk_defs.h.
| #define __stk_attr_used |
Marks a symbol as used, preventing the linker from discarding it even if no references are visible (declaration prefix).
Definition at line 244 of file stk_defs.h.
| #define __stk_constexpr_cpp17 |
constexpr definition for C++17 and above.
Definition at line 382 of file stk_defs.h.
Referenced by stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::AddTask(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::AddTask(), stk::memory::MemoryAllocator::AllocateArrayT(), stk::memory::MemoryAllocator::AllocateOneT(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::Bind(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::FetchNextEvent(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::FindTaskBySP(), stk::memory::MemoryAllocator::FreeArrayT(), stk::memory::MemoryAllocator::FreeOneT(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetCurrentWeight(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetHrtDeadline(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetHrtPeriodicity(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetHrtRelativeDeadline(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetSleepTicks(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetWeight(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::InheritWeight(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::Initialize(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::InitTraps(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::KernelTask(), stk::util::DListHead< T, TClosedLoop >::Link(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnStart(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnStop(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnTaskExit(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnTaskSleep(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnTaskWait(), stk::hw::ReadVolatile64(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::RemoveTask(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::RestoreWeight(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::Resume(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::ScheduleRemoval(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::ScheduleSleep(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::ScheduleTaskRemoval(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::SetCurrentWeight(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::Sleep(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::SleepCancel(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::SleepUntil(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::StateExit(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::StateSleep(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::StateSwitch(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::StateWake(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::Suspend(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::Unbind(), stk::util::DListHead< T, TClosedLoop >::UpdateEnds(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::UpdateTaskRequest(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::UpdateTasks(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::UpdateTaskState(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::Wait(), and stk::hw::WriteVolatile64().
| #define __stk_forceinline inline |
Forces compiler to always inline the decorated function, regardless of optimisation level.
Definition at line 175 of file stk_defs.h.
Referenced by __stk_debug_break(), __stk_dmb(), __stk_dmb(), CastCppKernelInterfaceToC(), CastCppTaskInterfaceToC(), CastCppTimerWrapperToC(), CastCToKernelInterface(), CastCToKernelInterfaceConst(), CmsisFlagsOptionsToStk(), CmsisPrioToStk(), CmsisTimeoutToStk(), stk::ConvertTimeUsToClockCycles(), stk::Delay(), stk::DelayMs(), stk::SwitchStrategyFixedPriority< 32 >::GetHighestReadyPriority(), stk::GetMsFromTicks(), stk::GetSysTimerCount(), stk::GetSysTimerFrequency(), stk::SwitchStrategyFixedPriority< 32 >::GetTaskPriority(), stk::SwitchStrategyFixedPriority< 32 >::GetTaskPriorityFromWeight(), stk::GetTickResolution(), stk::GetTicks(), stk::GetTicksFromMs(), stk::GetTicksFromMs(), stk::GetTicksFromMsClampedToTimeout(), stk::GetTid(), stk::GetTimeNowMs(), stk::hw::HiResClock::GetTimeUs(), stk::GetTls(), stk::hw::IsInsideISR(), IsIrqContext(), stk::IsIsrTid(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::IsValidFsmState(), stk::util::DListCast::ListEntryToParent(), stk::hw::ReadVolatile64(), stk::SetTls(), stk::Sleep(), stk::SleepCancel(), stk::SleepMs(), stk::SleepUntil(), stk::STK_KERNEL_PANIC(), STK_MEMCPY(), StkFlagsResultToCmsis(), StkPrioToCmsis(), stk::hw::WriteVolatile64(), and stk::Yield().
| #define __stk_weak |
Marks a function or variable as weak, allowing it to be overridden by the user.
Definition at line 198 of file stk_defs.h.
Referenced by pvPortMalloc(), and vPortFree().
| #define STK_ARCH_CPU_COUNT (1U) |
Number of physical CPU cores available to the scheduler (default: 1).
Definition at line 493 of file stk_defs.h.
| #define STK_ASSERT | ( | e | ) |
Runtime assertion. Halts execution if the expression e evaluates to false.
_STK_ASSERT_REDIRECT is defined: always redirects to the custom handler STK_ASSERT_HANDLER (regardless of debug/release build type). Signature: DEBUG or _DEBUG is defined (debug build): maps to the standard assert() macro from <assert.h>, which halts execution on failure._STK_ASSERT_REDIRECT, all assertions are silently removed. Safety-critical applications (ISO 26262, IEC 61508) should define _STK_ASSERT_REDIRECT to retain fault detection in all build configurations. Definition at line 409 of file stk_defs.h.
Referenced by stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::AddTask(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::AddTask(), stk::SwitchStrategyEDF::AddTask(), stk::SwitchStrategyFixedPriority< 32 >::AddTask(), stk::SwitchStrategyMonotonic< MSS_TYPE_RATE >::AddTask(), stk::SwitchStrategyRoundRobin::AddTask(), stk::SwitchStrategySmoothWeightedRoundRobin::AddTask(), stk::ISyncObject::AddWaitObject(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::AllocateAndAddNewTask(), stk::memory::MemoryAllocator::AllocateArrayT(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::AllocateNewTask(), stk::memory::MemoryAllocator::AllocateOneT(), AllocateTask(), StkMessageQueue::AllocBuffer(), stk::memory::BlockMemoryPool::BlockMemoryPool(), stk::memory::BlockMemoryPool::BlockMemoryPool(), stk::memory::BlockMemoryPool::BuildFreeList(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::Delay(), stk::sync::EventFlags::EventFlags(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::FetchNextEvent(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::FindTaskBySP(), stk::memory::BlockMemoryPool::Free(), stk::memory::MemoryAllocator::FreeArrayT(), stk::memory::MemoryAllocator::FreeOneT(), FreeTask(), stk::sync::MessageQueue::Get(), stk::SwitchStrategyEDF::GetFirst(), stk::SwitchStrategyFixedPriority< 32 >::GetFirst(), stk::SwitchStrategyMonotonic< MSS_TYPE_RATE >::GetFirst(), stk::SwitchStrategyRoundRobin::GetFirst(), stk::SwitchStrategySmoothWeightedRoundRobin::GetFirst(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetHrtDeadline(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetHrtPeriodicity(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetHrtRelativeDeadline(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::GetNewFsmState(), stk::SwitchStrategySmoothWeightedRoundRobin::GetNext(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::HrtAllocateAndAddNewTask(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtHardFailDeadline(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtInit(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtOnSwitchedOut(), CTimerWrapper::Initialize(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::Initialize(), stk::PlatformContext::InitStackMemory(), stk::SchedulabilityCheck::IsSchedulableWCRT(), stk::util::DListHead< T, TClosedLoop >::Link(), stk::sync::SpinLock::LockRecursively(), stk::sync::MessageQueue::MessageQueue(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnGetTid(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnInheritWeight(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnRestoreWeight(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnStart(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnTaskExit(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnTaskSleep(), stk::SwitchStrategyEDF::OnTaskSleep(), stk::SwitchStrategyFixedPriority< 32 >::OnTaskSleep(), stk::SwitchStrategyMonotonic< MSS_TYPE_RATE >::OnTaskSleep(), stk::SwitchStrategyRoundRobin::OnTaskSleep(), stk::SwitchStrategySmoothWeightedRoundRobin::OnTaskSleep(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnTaskSleepUntil(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnTaskWait(), stk::SwitchStrategyEDF::OnTaskWake(), stk::SwitchStrategyFixedPriority< 32 >::OnTaskWake(), stk::SwitchStrategyMonotonic< MSS_TYPE_RATE >::OnTaskWake(), stk::SwitchStrategyRoundRobin::OnTaskWake(), stk::SwitchStrategySmoothWeightedRoundRobin::OnTaskWake(), stk::SwitchStrategyFixedPriority< 32 >::OnTaskWeightChange(), stk::ArrayView< T >::operator[](), osMutexNew(), osThreadNew(), stk::sync::MessageQueue::Peek(), stk::sync::MessageQueue::PeekFront(), stk::sync::Pipe::Pipe(), PlacementNewOrHeap(), stk::time::PeriodicTrigger::Poll(), stk::memory::BlockMemoryPool::PopFreeList(), stk::time::TimerHost::ProcessCommands(), stk::time::TimerHost::PushCommand(), stk::sync::MessageQueue::Put(), stk::sync::MessageQueue::PutFront(), stk::sync::Pipe::Read(), stk::sync::RWMutex::ReadUnlock(), stk::memory::MemoryAllocator::Stats::RecordFree(), RegisterKernel(), stk::util::DListHead< T, TClosedLoop >::RelinkTo(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::RemoveTask(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::RemoveTask(), stk::SwitchStrategyEDF::RemoveTask(), stk::SwitchStrategyFixedPriority< 32 >::RemoveTask(), stk::SwitchStrategyMonotonic< MSS_TYPE_RATE >::RemoveTask(), stk::SwitchStrategyRoundRobin::RemoveTask(), stk::SwitchStrategySmoothWeightedRoundRobin::RemoveTask(), stk::ISyncObject::RemoveWaitObject(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::RequestAddTask(), ResolveNotifyTarget(), stk::time::TimerHost::Restart(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::Resume(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::ResumeTask(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::ScheduleSleep(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::ScheduleTaskRemoval(), stk::sync::Semaphore::Semaphore(), SetEventOverrider(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::WaitObject::SetupWait(), stk::sync::Semaphore::Signal(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::Sleep(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::SleepUntil(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::Start(), stk::time::TimerHost::Start(), stk::time::TimerHost::StartOrReset(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::StateExit(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::StateSleep(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::StateSwitch(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::StateWake(), stk_blockpool_alloc(), stk_blockpool_create(), stk_blockpool_create_static(), stk_blockpool_destroy(), stk_blockpool_free(), stk_blockpool_get_block_size(), stk_blockpool_get_capacity(), stk_blockpool_get_free_count(), stk_blockpool_get_used_count(), stk_blockpool_is_empty(), stk_blockpool_is_full(), stk_blockpool_is_storage_valid(), stk_blockpool_timed_alloc(), stk_blockpool_try_alloc(), stk_cv_create(), stk_cv_notify_all(), stk_cv_notify_one(), stk_cv_wait(), stk_ef_clear(), stk_ef_create(), stk_ef_get(), stk_ef_set(), stk_ef_trywait(), stk_ef_wait(), stk_event_create(), stk_event_pulse(), stk_event_reset(), stk_event_set(), stk_event_trywait(), stk_event_wait(), stk_kernel_add_task(), stk_kernel_add_task_hrt(), stk_kernel_create(), stk_kernel_destroy(), stk_kernel_enumerate_tasks(), stk_kernel_get_state(), stk_kernel_init(), stk_kernel_is_schedulable(), stk_kernel_is_started(), stk_kernel_process_hard_fault(), stk_kernel_process_tick(), stk_kernel_remove_task(), stk_kernel_resume(), stk_kernel_resume_task(), stk_kernel_schedule_task_removal(), stk_kernel_set_event_overrider(), stk_kernel_start(), stk_kernel_suspend(), stk_kernel_suspend_task(), stk_msgq_create(), stk_msgq_get(), stk_msgq_get_buffer(), stk_msgq_get_capacity(), stk_msgq_get_count(), stk_msgq_get_msg_size(), stk_msgq_get_space(), stk_msgq_is_empty(), stk_msgq_is_full(), stk_msgq_is_storage_valid(), stk_msgq_peek(), stk_msgq_peekfront(), stk_msgq_put(), stk_msgq_putfront(), stk_msgq_reset(), stk_msgq_tryget(), stk_msgq_trypeek(), stk_msgq_trypeekfront(), stk_msgq_tryput(), stk_msgq_tryputfront(), stk_mutex_create(), stk_mutex_lock(), stk_mutex_timed_lock(), stk_mutex_trylock(), stk_mutex_unlock(), stk_periodic_trigger_create(), stk_periodic_trigger_get_period(), stk_periodic_trigger_poll(), stk_periodic_trigger_restart(), stk_periodic_trigger_set_period(), stk_pipe_create(), stk_pipe_get_capacity(), stk_pipe_get_count(), stk_pipe_get_element_size(), stk_pipe_get_space(), stk_pipe_is_empty(), stk_pipe_is_full(), stk_pipe_is_storage_valid(), stk_pipe_read(), stk_pipe_read_bulk(), stk_pipe_read_bulk_triggered(), stk_pipe_reset(), stk_pipe_tryread(), stk_pipe_tryread_bulk(), stk_pipe_tryread_bulk_triggered(), stk_pipe_trywrite(), stk_pipe_trywrite_bulk(), stk_pipe_write(), stk_pipe_write_bulk(), stk_rwmutex_create(), stk_rwmutex_lock(), stk_rwmutex_read_lock(), stk_rwmutex_read_unlock(), stk_rwmutex_timed_lock(), stk_rwmutex_timed_read_lock(), stk_rwmutex_try_read_lock(), stk_rwmutex_trylock(), stk_rwmutex_unlock(), stk_sem_create(), stk_sem_get_count(), stk_sem_signal(), stk_sem_trywait(), stk_sem_wait(), stk_spinlock_create(), stk_spinlock_lock(), stk_spinlock_trylock(), stk_spinlock_unlock(), stk_task_create_privileged(), stk_task_create_user(), stk_task_destroy(), stk_task_get_id(), stk_task_get_name(), stk_task_set_name(), stk_task_set_priority(), stk_task_set_weight(), stk_timer_create(), stk_timer_destroy(), stk_timer_get_deadline(), stk_timer_get_period(), stk_timer_get_remaining_ticks(), stk_timer_get_timestamp(), stk_timer_is_active(), stk_timer_reset(), stk_timer_restart(), stk_timer_set_period(), stk_timer_start(), stk_timer_start_or_reset(), stk_timer_stop(), stk_timerhost_get_size(), stk_timerhost_get_time_now(), stk_timerhost_init(), stk_timerhost_is_empty(), stk_timerhost_shutdown(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::Suspend(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::SuspendTask(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::SwitchToNext(), stk::memory::BlockMemoryPool::TimedAlloc(), stk::memory::BlockMemoryPool::TimedAllocT(), stk::sync::Mutex::TimedLock(), stk::sync::RWMutex::TimedLock(), stk::sync::RWMutex::TimedReadLock(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::Unbind(), stk::util::DListHead< T, TClosedLoop >::Unlink(), stk::sync::Mutex::Unlock(), stk::sync::RWMutex::Unlock(), stk::sync::SpinLock::Unlock(), stk::time::TimerHost::UpdateTime(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::Wait(), stk::sync::ConditionVariable::Wait(), stk::sync::Event::Wait(), stk::sync::Semaphore::Wait(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::WaitObject::Wake(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::Wake(), stk::sync::Pipe::Write(), xEventGroupSync(), xMessageBufferReceive(), xMessageBufferReceiveFromISR(), xMessageBufferSend(), xMessageBufferSendFromISR(), xQueueAddToSet(), xQueueRemoveFromSet(), stk::sync::ConditionVariable::~ConditionVariable(), stk::sync::Event::~Event(), stk::sync::Mutex::~Mutex(), stk::sync::RWMutex::~RWMutex(), stk::sync::Semaphore::~Semaphore(), and stk::sync::SpinLock::~SpinLock().
| #define STK_CRITICAL_SECTION_NESTINGS_MAX (16U) |
Maximum allowable recursion depth for critical section entry (default: 16).
Definition at line 483 of file stk_defs.h.
| #define STK_ENDIAN_IDX_HI (1U) |
Array index of the high 32-bit word when a 64-bit value is viewed as uint32_t[2].
Definition at line 586 of file stk_defs.h.
Referenced by stk::hw::ReadVolatile64(), and stk::hw::WriteVolatile64().
| #define STK_ENDIAN_IDX_LO (0U) |
Array index of the low 32-bit word when a 64-bit value is viewed as uint32_t[2].
Definition at line 587 of file stk_defs.h.
Referenced by stk::hw::ReadVolatile64(), and stk::hw::WriteVolatile64().
| #define STK_NONCOPYABLE_CLASS | ( | TYPE | ) |
Disables copy construction and assignment for a class.
This macro declares a private copy constructor and copy assignment operator to prevent the compiler from generating default ones. It ensures that instances of a class cannot be duplicated.
| [in] | TYPE | The name of the class to be made non-copyable. |
private or protected section of the class declaration to be effective. = delete, however, this macro provides compatibility for legacy environments. Definition at line 601 of file stk_defs.h.
| #define STK_SLEEP_TRAP_STACK_SIZE (STK_STACK_SIZE_MIN) |
Stack size for the sleep trap in elements of Word (default: STK_STACK_SIZE_MIN).
Definition at line 546 of file stk_defs.h.
| #define STK_STACK_MEMORY_ALIGN (4U) |
Stack memory alignment.
Definition at line 468 of file stk_defs.h.
Referenced by stk::PlatformContext::InitStackMemory().
| #define STK_STACK_MEMORY_FILLER (static_cast<stk::Word>((sizeof(stk::Word) <= 4U) ? 0xDEADBEEFU : 0xDEADBEEFDEADBEEFULL)) |
Sentinel value written to the entire stack region at initialization (stack watermark pattern).
0xDEADBEEF on 32-bit targets and 0xDEADBEEFDEADBEEF on 64-bit targets. Can be overridden by defining STK_STACK_MEMORY_FILLER before including this header or in stk_config.h. Definition at line 456 of file stk_defs.h.
Referenced by stk::IStackMemory::GetStackSpace(), stk::PlatformContext::InitStackMemory(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::StateSwitch(), and stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::StateWake().
| #define STK_STACK_SIZE_MIN (32U) |
Minimum stack size in elements of Word, shared by all stack allocation lower-bound checks.
Definition at line 533 of file stk_defs.h.
| #define STK_STATIC_ASSERT | ( | X | ) |
Compile-time assertion. Produces a compilation error if X is false.
Definition at line 446 of file stk_defs.h.
Referenced by stk::IKernel::EnumerateTasksT(), stk::hw::PtrToWord(), stk::StackMemoryWrapper<((32U))>::StackMemoryWrapper(), stk_kernel_create(), and stk::hw::WordToPtr().
| #define STK_STATIC_ASSERT_DESC | ( | X, | |
| DESC ) |
Compile-time assertion with a custom error description. Produces a compilation error if X is false.
Definition at line 429 of file stk_defs.h.
Referenced by stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::Kernel(), and stk::SwitchStrategyFixedPriority< 32 >::SwitchStrategyFixedPriority().
| #define STK_STATIC_ASSERT_DESC_N | ( | NAME, | |
| X, | |||
| DESC ) |
Compile-time assertion with a user-defined name suffix and a custom error description.
Definition at line 421 of file stk_defs.h.
| #define STK_STATIC_ASSERT_N | ( | NAME, | |
| X ) |
Compile-time assertion with a user-defined name suffix.
Definition at line 438 of file stk_defs.h.
Referenced by stk::util::DListCast::ListEntryToParent(), stk::hw::ReadVolatile64(), and stk::hw::WriteVolatile64().
| #define STK_STRICT_COMPLIANCY (0) |
Allow the use of workarounds to make binary smaller and faster.
Definition at line 51 of file stk_defs.h.
| #define STK_SYNC_DEBUG_NAMES (0) |
Enable debug names for synchronization primitives (mutexes, events, etc.) for debugging and tracing purposes.
Definition at line 152 of file stk_defs.h.
| #define STK_TICKLESS_TICKS_MAX (1000) |
Maximum number of kernel ticks the hardware timer may be suppressed in one tickless idle interval when STK_TICKLESS_IDLE=1. Default: 1000.
Definition at line 77 of file stk_defs.h.
Referenced by stk::GetInitialSleepTicks< true >().
| #define STK_TICKLESS_USE_ARM_DWT (1) |
Use DWT timer of ARM Cortex-M for a precise tick calculation.
Definition at line 63 of file stk_defs.h.
| #define STK_TLS (0) |
Enable per-task thread-local storage (TLS).
Definition at line 99 of file stk_defs.h.
| #define STK_TLS_PREFER_REGISTER (0) |
Store the per-task TLS pointer in a dedicated CPU register instead of the stk::Stack::tls member, enabling single-instruction TLS access.
-ffixed-r9. Without it the compiler may allocate r9 as an ordinary callee-saved register, silently overwriting the TLS pointer after a context switch. See stk_arch_arm-cortex-m.h for the full explanation. tp (x4) register, which is reserved for TLS by the RISC-V psABI. STK_TLS_PREFER_REGISTER is forced to 1 on RISC-V regardless of this setting; no additional compiler flags are needed. tls member, reducing per-task RAM by one Word. On targets with many tasks this saving can be significant. -ffixed-r9 cannot be applied to all task translation units (e.g. pre-built third-party libraries); the memory-based fallback incurs only one extra load/store per TLS access. -ffixed-r9 must be applied to every translation unit in the binary that contains task code, including inlined functions and any library code those tasks call. A single TU compiled without the flag is sufficient to cause intermittent, hard-to-reproduce TLS corruption. Definition at line 127 of file stk_defs.h.
| #define STK_UNUSED | ( | X | ) |
Explicitly marks a variable as unused to suppress compiler warnings.
Definition at line 608 of file stk_defs.h.
Referenced by stk::memory::MemoryAllocator::AllocateArrayT(), stk::memory::MemoryAllocator::AllocateOneT(), stk::memory::BlockMemoryPool::BlockMemoryPool(), stk::memory::BlockMemoryPool::BlockMemoryPool(), stk::memory::MemoryAllocator::FreeArrayT(), FrtosMessageBuffer::FrtosMessageBuffer(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::InitTraps(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::Kernel(), stk::sync::Mutex::Lock(), stk::sync::RWMutex::Lock(), stk::ITask::OnDeadlineMissed(), CTimerWrapper::OnExpired(), stk::IPlatform::IEventOverrider::OnSleep(), stk::ITaskSwitchStrategy::OnTaskDeadlineMissed(), stk::ITaskSwitchStrategy::OnTaskWeightChange(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::OnTick(), osKernelResume(), osThreadJoin(), stk::time::TimerHost::ProcessCommands(), QueueSetNotify(), stk::sync::RWMutex::ReadLock(), stk::ITraceable::SetTraceName(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::StateExit(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::StateSleep(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::StateWake(), STK_MEMCPY(), and stk::time::TimerHost::UpdateTime().
| #define STK_VIRT_DTOR |
Makes destructors virtual and compliant to strict rules if STK_STRICT_COMPLIANCY=0.
Definition at line 159 of file stk_defs.h.
Referenced by stk::sync::ConditionVariable::~ConditionVariable(), stk::sync::Event::~Event(), stk::sync::EventFlags::~EventFlags(), EventOverrider::~EventOverrider(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::~Kernel(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::~KernelService(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::~KernelTask(), stk::sync::MessageQueue::~MessageQueue(), stk::sync::MessageQueueT< N, MSG >::~MessageQueueT(), stk::sync::Mutex::~Mutex(), stk::sync::Pipe::~Pipe(), stk::PlatformArmCortexM::~PlatformArmCortexM(), stk::PlatformContext::~PlatformContext(), stk::sync::RWMutex::~RWMutex(), stk::sync::ScopedCriticalSection::~ScopedCriticalSection(), stk::sync::Semaphore::~Semaphore(), stk::sync::SpinLock::~SpinLock(), stk::StackMemoryWrapper<((32U))>::~StackMemoryWrapper(), stk::SwitchStrategyEDF::~SwitchStrategyEDF(), stk::SwitchStrategyFixedPriority< 32 >::~SwitchStrategyFixedPriority(), stk::SwitchStrategyMonotonic< MSS_TYPE_RATE >::~SwitchStrategyMonotonic(), stk::SwitchStrategyRoundRobin::~SwitchStrategyRoundRobin(), stk::SwitchStrategySmoothWeightedRoundRobin::~SwitchStrategySmoothWeightedRoundRobin(), stk::Task< _StackSize, _AccessMode >::~Task(), stk::TaskW< _Weight, _StackSize, _AccessMode >::~TaskW(), TaskWrapper::~TaskWrapper(), stk::time::TimerHost::Timer::~Timer(), and stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::WaitObject::~WaitObject().
|
inlinestatic |
Definition at line 372 of file stk_defs.h.
References __stk_forceinline.
Referenced by stk::STK_KERNEL_PANIC().