![]() |
SuperTinyKernel™ RTOS 1.06.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Namespace of STK package. More...
Namespaces | |
| namespace | memory |
| Memory-related primitives. | |
| namespace | hw |
| Hardware Abstraction Layer (HAL) for architecture-specific operations. | |
| namespace | util |
| Internal utility namespace containing data structure helpers (linked lists, etc.) used by the kernel implementation. Not part of the public user API. | |
| namespace | sync |
| Synchronization primitives for task coordination and resource protection. | |
| namespace | time |
| Time-related primitives. | |
Classes | |
| class | PlatformArmCortexM |
| Concrete implementation of IPlatform driver for the Arm Cortex-M0, M3, M4, M7 processors. More... | |
| class | PlatformRiscV |
| Concrete implementation of IPlatform driver for the Risc-V processors. More... | |
| class | PlatformContext |
| Base platform context for all platform implementations. More... | |
| class | PlatformX86Win32 |
| Concrete implementation of IPlatform driver for the x86 Win32 platform. More... | |
| class | Kernel |
| Concrete implementation of IKernel. More... | |
| class | ArrayView |
| Lightweight, non-owning view over a contiguous sequence of elements. More... | |
| class | StackMemoryDef |
| Stack memory type definition. More... | |
| class | Stack |
| Stack descriptor. More... | |
| class | IStackMemory |
| Interface for a stack memory region. More... | |
| class | IWaitObject |
| Wait object. More... | |
| class | ITraceable |
| Traceable object. More... | |
| class | ISyncObject |
| Synchronization object. More... | |
| class | IMutex |
| Interface for mutex synchronization primitive. More... | |
| class | ITask |
| Interface for a user task. More... | |
| class | IKernelTask |
| Scheduling-strategy-facing interface for a kernel task slot. More... | |
| class | IPlatform |
| Interface for a platform driver. More... | |
| class | ITaskSwitchStrategy |
| Interface for a task switching strategy implementation. More... | |
| class | IKernel |
| Interface for the implementation of the kernel of the scheduler. It supports Soft and Hard Real-Time modes. More... | |
| class | IKernelService |
| Interface for the kernel services exposed to the user processes during run-time when Kernel started scheduling the processes. More... | |
| class | Task |
| Partial implementation of the user task. More... | |
| class | TaskW |
| Partial implementation of the user task with a compile-time scheduling weight. Use when the kernel is configured with SwitchStrategySmoothWeightedRoundRobin. More... | |
| class | StackMemoryWrapper |
| Adapts an externally-owned stack memory array to the IStackMemory interface. More... | |
| class | SwitchStrategyEDF |
| Earliest Deadline First (EDF) scheduling strategy: always selects the runnable task with the least time remaining before its deadline expires. More... | |
| class | SwitchStrategyFixedPriority |
| Fixed-priority preemptive scheduling strategy with round-robin arbitration within each priority level. More... | |
| class | SwitchStrategyMonotonic |
| Monotonic scheduling strategy: Rate-Monotonic (RM) or Deadline-Monotonic (DM), selected at compile time by the TStrategyType template parameter. More... | |
| class | SchedulabilityCheck |
| Utility class providing static methods for Worst-Case Response Time (WCRT) schedulability analysis of a monotonic HRT task set. More... | |
| class | SwitchStrategyRoundRobin |
| Round-Robin task-switching strategy: each runnable task receives one time slice (one tick interval) in turn before the kernel moves to the next task. More... | |
| class | SwitchStrategySmoothWeightedRoundRobin |
| Smooth Weighted Round-Robin (SWRR) task-switching strategy: distributes CPU time proportionally to per-task weights while avoiding execution bursts by spreading selections evenly over time. More... | |
Typedefs | |
| typedef PlatformArmCortexM | PlatformDefault |
| Default platform implementation. | |
| typedef uintptr_t | Word |
| Native processor word type. | |
| typedef Word | TId |
| typedef int32_t | Timeout |
| Timeout time (ticks). | |
| typedef int64_t | Ticks |
| Ticks value. | |
| typedef int64_t | Time |
| Time value. | |
| typedef uint64_t | Cycles |
| Cycles value. | |
| typedef int32_t | Weight |
| Weight value (aka priority). | |
| typedef SwitchStrategyFixedPriority< 32 > | SwitchStrategyFP32 |
Shorthand alias for SwitchStrategyFixedPriority<32>: 32 priority levels (0..31), using a single 32-bit m_ready_bitmap for O(1) highest-priority lookup. | |
| typedef SwitchStrategyMonotonic< MSS_TYPE_RATE > | SwitchStrategyRM |
| Shorthand alias for SwitchStrategyMonotonic<MSS_TYPE_RATE>: Rate-Monotonic scheduling (shorter scheduling period -> higher priority). | |
| typedef SwitchStrategyMonotonic< MSS_TYPE_DEADLINE > | SwitchStrategyDM |
| Shorthand alias for SwitchStrategyMonotonic<MSS_TYPE_DEADLINE>: Deadline-Monotonic scheduling (shorter execution deadline -> higher priority). | |
| typedef SwitchStrategyRoundRobin | SwitchStrategyRR |
| Shorthand alias for SwitchStrategyRoundRobin. | |
| typedef SwitchStrategySmoothWeightedRoundRobin | SwitchStrategySWRR |
| Shorthand alias for SwitchStrategySmoothWeightedRoundRobin. | |
Functions | |
| __stk_forceinline Word | GetTls () |
| Get thread-local storage (TLS). | |
| __stk_forceinline void | SetTls (Word tp) |
| Set thread-local storage (TLS). | |
| static __stk_forceinline Cycles | ConvertTimeUsToClockCycles (uint32_t clock_freq, Ticks time_us) |
| Convert time (microseconds) to core clock cycles. | |
| static __stk_forceinline void | STK_KERNEL_PANIC (stk::EKernelPanicId id) |
| Called when the kernel detects an unrecoverable internal fault. | |
| static constexpr TId | GetTidFromUserTask (const ITask *task) noexcept |
| Get task identifier from ITask instance. | |
| static constexpr ITask * | GetUserTaskFromTid (TId task_id) noexcept |
| Get task instance from its identifier. | |
| static bool | IsIsrTid (TId id) |
| Test whether a task identifier represents an ISR context. | |
| template<typename T> | |
| static constexpr T | Min (T a, T b) |
| Compile-time minimum of two values. | |
| template<typename T> | |
| static constexpr T | Max (T a, T b) |
| Compile-time maximum of two values. | |
| template<bool TicklessMode> | |
| Timeout | GetInitialSleepTicks () |
| template<> | |
| Timeout | GetInitialSleepTicks< true > () |
| template<> | |
| Timeout | GetInitialSleepTicks< false > () |
| TId | GetTid () |
| Get task/thread Id of the calling task. | |
| Time | GetMsFromTicks (Ticks tick_count, uint32_t resolution) |
| Convert ticks to milliseconds. | |
| Ticks | GetTicksFromMs (Time ms, uint32_t resolution) |
| Convert milliseconds to ticks. | |
| Ticks | GetTicks () |
| Get number of ticks elapsed since kernel start. | |
| uint32_t | GetTickResolution () |
| Get number of microseconds in one tick. | |
| Ticks | GetTicksFromMs (Time ms) |
| Convert milliseconds to ticks using the current kernel tick resolution. | |
| static Time | GetTimeNowMs () |
| Get current time in milliseconds since kernel start. | |
| Cycles | GetSysTimerCount () |
| Get system timer count value. | |
| uint32_t | GetSysTimerFrequency () |
| Get system timer frequency. | |
| void | Sleep (Timeout tick_count) |
| Put calling process into a sleep state. | |
| static void | SleepMs (Timeout ms) |
| Put calling process into a sleep state. | |
| bool | SleepUntil (Ticks timestamp) |
| Put calling process into a sleep state until the specified timestamp. | |
| void | SleepCancel (TId task_id) |
| Cancel sleep of the task. | |
| void | Yield () |
| Notify scheduler to switch to the next runnable task. | |
| void | Delay (Timeout tick_count) |
| Delay calling process by busy-waiting until the deadline expires. | |
| static void | DelayMs (Timeout ms) |
| Delay calling process by busy-waiting until the deadline expires. | |
Variables | |
| static constexpr TId | TID_ISR_N = static_cast<TId>(0xFFFFF000U) |
| Bitmask sentinel for ISR-context task identifiers. | |
| static constexpr TId | TID_NONE = static_cast<TId>(0U) |
| Reserved task/thread id representing zero/none thread id. | |
| static constexpr Timeout | WAIT_INFINITE = INT32_MAX |
| Timeout value: block indefinitely until the synchronization object is signaled. | |
| static constexpr Timeout | NO_WAIT = 0 |
| Timeout value: return immediately if the synchronization object is not yet signaled (non-blocking poll). | |
| static constexpr Weight | NO_WEIGHT = static_cast<Weight>(-1) |
| Weight value: weight is not set. | |
| static constexpr Weight | DEFAULT_WEIGHT = static_cast<Weight>(1) |
Weight value: default weight of value (1) (see SwitchStrategySmoothWeightedRoundRobin). | |
Namespace of STK package.
| typedef uint64_t stk::Cycles |
Cycles value.
Definition at line 140 of file stk_common.h.
| typedef PlatformX86Win32 stk::PlatformDefault |
Default platform implementation.
Definition at line 55 of file stk_arch_arm-cortex-m.h.
Shorthand alias for SwitchStrategyMonotonic<MSS_TYPE_DEADLINE>: Deadline-Monotonic scheduling (shorter execution deadline -> higher priority).
Definition at line 518 of file stk_strategy_monotonic.h.
| typedef SwitchStrategyFixedPriority<32> stk::SwitchStrategyFP32 |
Shorthand alias for SwitchStrategyFixedPriority<32>: 32 priority levels (0..31), using a single 32-bit m_ready_bitmap for O(1) highest-priority lookup.
Definition at line 407 of file stk_strategy_fpriority.h.
Shorthand alias for SwitchStrategyMonotonic<MSS_TYPE_RATE>: Rate-Monotonic scheduling (shorter scheduling period -> higher priority).
Definition at line 511 of file stk_strategy_monotonic.h.
Shorthand alias for SwitchStrategyRoundRobin.
Definition at line 247 of file stk_strategy_rrobin.h.
Shorthand alias for SwitchStrategySmoothWeightedRoundRobin.
Definition at line 276 of file stk_strategy_swrrobin.h.
| typedef int64_t stk::Ticks |
Ticks value.
Definition at line 130 of file stk_common.h.
Definition at line 120 of file stk_common.h.
| typedef int64_t stk::Time |
Time value.
Definition at line 135 of file stk_common.h.
| typedef int32_t stk::Timeout |
Timeout time (ticks).
Definition at line 125 of file stk_common.h.
| typedef int32_t stk::Weight |
Weight value (aka priority).
Definition at line 145 of file stk_common.h.
| typedef uintptr_t stk::Word |
Native processor word type.
Represents natural data width of the CPU (matching uintptr_t). Used for stack allocation, register storage, pointer value storage, and memory alignment to ensure atomic access, optimal performance, and hardware compatibility.
Definition at line 115 of file stk_common.h.
| enum stk::EAccessMode : int32_t |
Hardware access mode by the user task.
Definition at line 31 of file stk_common.h.
| enum stk::EConsts |
Constants.
| Enumerator | |
|---|---|
| PERIODICITY_MAX | Maximum periodicity (microseconds), 99 milliseconds (note: this value is the highest working on a real hardware and QEMU). |
| PERIODICITY_DEFAULT | Default periodicity (microseconds), 1 millisecond. |
| STACK_SIZE_MIN | Minimum stack size in elements of Word. Used as a lower bound for all stack allocations (user task, sleep trap, exit trap). See: StackMemoryDef, StackMemoryWrapper. |
Definition at line 81 of file stk_common.h.
| enum stk::EKernelMode : uint8_t |
Kernel operating mode.
Definition at line 40 of file stk_common.h.
| enum stk::EKernelPanicId : uint32_t |
Identifies the source of a kernel panic.
| Enumerator | |
|---|---|
| KERNEL_PANIC_NONE | Panic is absent (no fault). |
| KERNEL_PANIC_SPINLOCK_DEADLOCK | Spin-lock timeout expired: lock owner never released. |
| KERNEL_PANIC_STACK_CORRUPT | Stack integrity check failed. |
| KERNEL_PANIC_ASSERT | Internal assertion failed (maps from STK_ASSERT). |
| KERNEL_PANIC_HRT_HARD_FAULT | Kernel running in KERNEL_HRT mode reported deadline failure of the task. |
| KERNEL_PANIC_CPU_EXCEPTION | CPU reported an exception and halted execution. |
| KERNEL_PANIC_CS_NESTING_OVERFLOW | Critical section nesting limit exceeded: violation of STK_CRITICAL_SECTION_NESTINGS_MAX. |
| KERNEL_PANIC_UNKNOWN_SVC | Unknown service command received by SVC handler. |
| KERNEL_PANIC_BAD_STATE | Kernel entered unexpected (bad) state. |
| KERNEL_PANIC_BAD_MODE | Kernel is in bad/unsupported mode for the current operation. |
| KERNEL_PANIC_BAD_STACK_TYPE | Stack type is unknown. |
Definition at line 52 of file stk_common.h.
Policy selector for SwitchStrategyMonotonic: determines the timing attribute used to assign fixed priorities to tasks at AddTask() time.
Definition at line 28 of file stk_strategy_monotonic.h.
| enum stk::EStackType |
Stack type.
| Enumerator | |
|---|---|
| STACK_USER_TASK | Stack of the user task. |
| STACK_SLEEP_TRAP | Stack of the Sleep trap. |
| STACK_EXIT_TRAP | Stack of the Exit trap. |
Definition at line 71 of file stk_common.h.
| enum stk::ESystemTaskId |
System task id.
| Enumerator | |
|---|---|
| SYS_TASK_ID_SLEEP | Sleep trap. |
| SYS_TASK_ID_EXIT | Exit trap. |
Definition at line 91 of file stk_common.h.
| enum stk::ETraceEventId |
Trace event identifiers for tracing task suspension and resume with debugging tools (e.g. SEGGER SystemView).
| Enumerator | |
|---|---|
| TRACE_EVENT_UNKNOWN | Unknown / uninitialized trace event. |
| TRACE_EVENT_SWITCH | Task context switch event (task became active). |
| TRACE_EVENT_SLEEP | Task entered sleep / blocked state. |
Definition at line 101 of file stk_common.h.
|
static |
Convert time (microseconds) to core clock cycles.
| [in] | clock_freq | Clock frequency. |
| [in] | time_us | Time (microseconds). |
Definition at line 107 of file stk_arch_common.h.
References __stk_forceinline.
|
inline |
Delay calling process by busy-waiting until the deadline expires.
| [in] | tick_count | Delay time (in ticks). Negative will cause an assertion. |
Definition at line 397 of file stk_helper.h.
References __stk_forceinline, stk::IKernelService::Delay(), and stk::IKernelService::GetInstance().
Referenced by DelayMs(), and stk_delay().
|
inlinestatic |
Delay calling process by busy-waiting until the deadline expires.
| [in] | ms | Delay time (milliseconds). Negative will cause an assertion. |
Definition at line 408 of file stk_helper.h.
References Delay(), GetTicksFromMs(), and WAIT_INFINITE.
Referenced by stk_delay_ms().
|
inline |
|
inline |
Definition at line 178 of file stk_helper.h.
|
inline |
Definition at line 177 of file stk_helper.h.
References STK_TICKLESS_TICKS_MAX.
Convert ticks to milliseconds.
| [in] | tick_count | Tick count to convert. |
| [in] | resolution | Microseconds per tick, as returned by IKernelService::GetTickResolution(). |
Definition at line 254 of file stk_helper.h.
References __stk_forceinline.
|
inline |
Get system timer count value.
Definition at line 321 of file stk_helper.h.
References __stk_forceinline, stk::IKernelService::GetInstance(), and stk::IKernelService::GetSysTimerCount().
Referenced by osKernelGetSysTimerCount(), osKernelGetSysTimerCount64(), and stk_sys_timer_count().
|
inline |
Get system timer frequency.
Definition at line 330 of file stk_helper.h.
References __stk_forceinline, stk::IKernelService::GetInstance(), and stk::IKernelService::GetSysTimerFrequency().
Referenced by osKernelGetSysTimerFreq(), and stk_sys_timer_frequency().
|
inline |
Get number of microseconds in one tick.
Definition at line 284 of file stk_helper.h.
References __stk_forceinline, stk::IKernelService::GetInstance(), and stk::IKernelService::GetTickResolution().
Referenced by GetTicksFromMs(), osKernelGetTickFreq(), stk_tick_resolution(), and stk_ticks_from_ms().
|
inline |
Get number of ticks elapsed since kernel start.
Definition at line 274 of file stk_helper.h.
References __stk_forceinline, stk::IKernelService::GetInstance(), and stk::IKernelService::GetTicks().
Referenced by stk::time::TimerHost::Timer::GetRemainingTicks(), osKernelGetTickCount(), stk::time::PeriodicTrigger::Poll(), stk::sync::Pipe::ReadBulk(), stk::sync::PipeT< Timer *, 32U >::ReadBulk(), stk::sync::Pipe::ReadBulkTriggered(), stk::time::TimerHost::Reset(), stk::time::PeriodicTrigger::Restart(), stk::time::TimerHost::Restart(), stk::time::TimerHost::Start(), stk::time::TimerHost::StartOrReset(), stk_ticks(), stk::time::TimerHost::UpdateTime(), stk::sync::EventFlags::Wait(), stk::sync::Pipe::WriteBulk(), stk::sync::PipeT< Timer *, 32U >::WriteBulk(), xTaskGetTickCount(), and xTaskGetTickCountFromISR().
Convert milliseconds to ticks using the current kernel tick resolution.
| [in] | ms | Time in milliseconds to convert. |
Definition at line 296 of file stk_helper.h.
References __stk_forceinline, GetTickResolution(), and GetTicksFromMs().
Convert milliseconds to ticks.
| [in] | ms | Time in milliseconds to convert. |
| [in] | resolution | Microseconds per tick, as returned by IKernelService::GetTickResolution(). |
Definition at line 265 of file stk_helper.h.
References __stk_forceinline.
Referenced by DelayMs(), GetTicksFromMs(), and SleepMs().
|
inline |
Get task/thread Id of the calling task.
Definition at line 243 of file stk_helper.h.
References __stk_forceinline, stk::IKernelService::GetInstance(), and stk::IKernelService::GetTid().
Referenced by eTaskGetState(), stk::sync::SpinLock::Lock(), osThreadGetId(), stk_tid(), stk::sync::SpinLock::TryLock(), stk::sync::Mutex::Unlock(), stk::sync::SpinLock::Unlock(), uxTaskGetStackHighWaterMark(), uxTaskGetStackHighWaterMark2(), uxTaskGetSystemState(), uxTaskPriorityGet(), vTaskDelete(), vTaskList(), vTaskPrioritySet(), vTaskSuspend(), and xTaskGetCurrentTaskHandle().
Get task identifier from ITask instance.
Definition at line 495 of file stk_arch.h.
References stk::hw::PtrToWord().
Referenced by stk::ITask::GetId(), and stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetTid().
|
inlinestatic |
Get current time in milliseconds since kernel start.
Definition at line 307 of file stk_helper.h.
References stk::IKernelService::GetInstance(), stk::IKernelService::GetTickResolution(), and stk::IKernelService::GetTicks().
Referenced by stk_time_now_ms().
| __stk_forceinline Word stk::GetTls | ( | ) |
Get thread-local storage (TLS).
Definition at line 80 of file stk_arch_risc-v.h.
References __stk_forceinline.
Get task instance from its identifier.
Definition at line 501 of file stk_arch.h.
References stk::hw::WordToPtr().
Referenced by stk::ISyncObject::FindWeightHigherThan(), 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 >::OnTaskSleepCancel(), stk::sync::Mutex::TimedLock(), and stk::sync::Mutex::Unlock().
|
inlinestatic |
Test whether a task identifier represents an ISR context.
Returns true if tid was produced by GetTid() called from an interrupt service routine, i.e. its upper 20 bits match TID_ISR_N. Use this predicate instead of comparing against TID_ISR_N directly.
| [in] | tid | Task identifier to test. |
true if tid encodes an ISR context, false otherwise. Definition at line 212 of file stk_common.h.
References TID_ISR_N.
|
staticconstexpr |
Compile-time maximum of two values.
Definition at line 639 of file stk_defs.h.
Referenced by stk::memory::BlockMemoryPool::AlignBlockSize(), and stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetSleepTicks().
|
staticconstexpr |
Compile-time minimum of two values.
Definition at line 633 of file stk_defs.h.
Referenced by stk::sync::Pipe::DrainLocked(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS, 16U, stk::SwitchStrategyFP32, stk::PlatformDefault >::EnumerateKernelTasks(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS, 16U, stk::SwitchStrategyFP32, stk::PlatformDefault >::EnumerateTasks(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetSleepTicks(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS, 16U, stk::SwitchStrategyFP32, stk::PlatformDefault >::OnTaskSleepUntil(), osSemaphoreNew(), and stk::memory::MemoryAllocator::Stats::RecordAllocate().
| __stk_forceinline void stk::SetTls | ( | Word | tp | ) |
Set thread-local storage (TLS).
| [in] | tp | TLS value. |
Definition at line 91 of file stk_arch_risc-v.h.
References __stk_forceinline.
|
inline |
Put calling process into a sleep state.
| [in] | tick_count | Sleep time (in ticks). 0 does not cause yield, use Yield instead. Negative will cause an assertion. |
Definition at line 341 of file stk_helper.h.
References __stk_forceinline, stk::IKernelService::GetInstance(), and stk::IKernelService::Sleep().
Referenced by osDelay(), SleepMs(), stk_sleep(), and vTaskDelay().
|
inline |
Cancel sleep of the task.
| [in] | task_id | Id of the task. |
Definition at line 377 of file stk_helper.h.
References __stk_forceinline, stk::IKernelService::GetInstance(), and stk::IKernelService::SleepCancel().
Referenced by stk_sleep_cancel(), and xTaskAbortDelay().
|
inlinestatic |
Put calling process into a sleep state.
| [in] | ms | Sleep time (milliseconds). 0 does not cause yield, use Yield instead. Negative will cause an assertion. |
Definition at line 354 of file stk_helper.h.
References GetTicksFromMs(), Sleep(), and WAIT_INFINITE.
Referenced by stk_sleep_ms().
|
inline |
Put calling process into a sleep state until the specified timestamp.
| [in] | timestamp | Absolute timestamp (ticks). 0 does not cause yield, use Yield instead. Negative will cause an assertion. |
Definition at line 367 of file stk_helper.h.
References __stk_forceinline, stk::IKernelService::GetInstance(), and stk::IKernelService::SleepUntil().
Referenced by osDelayUntil(), stk_sleep_until(), and xTaskDelayUntil().
|
static |
Called when the kernel detects an unrecoverable internal fault.
| [in] | id | EKernelPanicId value identifying the fault. |
Definition at line 75 of file stk_arch.h.
References __stk_debug_break, __stk_forceinline, and STK_PANIC_HANDLER.
Referenced by stk::sync::SpinLock::MakeLocked(), 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::sync::Mutex::TimedLock(), stk::sync::RWMutex::TimedLock(), and stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS, 16U, stk::SwitchStrategyFP32, stk::PlatformDefault >::UpdateFsmState().
|
inline |
Notify scheduler to switch to the next runnable task.
Definition at line 386 of file stk_helper.h.
References __stk_forceinline, stk::IKernelService::GetInstance(), and stk::IKernelService::SwitchToNext().
Referenced by osThreadExit(), osThreadYield(), stk_yield(), taskYIELD_impl(), and vTaskEndScheduler().
Weight value: default weight of value (1) (see SwitchStrategySmoothWeightedRoundRobin).
Definition at line 199 of file stk_common.h.
Referenced by stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetCurrentWeight(), stk::ITask::GetWeight(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetWeight(), stk::time::TimerHost::TimerWorkerTask::Initialize(), TaskWrapper::Initialize(), TaskWrapper::TaskWrapper(), and stk::time::TimerHost::TimerWorkerTask::TimerWorkerTask().
|
staticconstexpr |
Timeout value: return immediately if the synchronization object is not yet signaled (non-blocking poll).
Definition at line 189 of file stk_common.h.
Referenced by CmsisTimeoutToStk(), FrtosTimeoutToStk(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetSleepTicks(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::KernelTask(), osMessageQueueGet(), osMessageQueuePut(), osMutexAcquire(), osSemaphoreAcquire(), stk::time::TimerHost::ProcessCommands(), stk::time::TimerHost::PushCommand(), stk::sync::Pipe::ReadBulk(), stk::sync::PipeT< Timer *, 32U >::ReadBulk(), stk::sync::Pipe::ReadBulkTriggered(), stk::memory::BlockMemoryPool::TimedAlloc(), stk::sync::Mutex::TimedLock(), stk::memory::BlockMemoryPool::TryAlloc(), stk::memory::BlockMemoryPool::TryAllocT(), stk::sync::MessageQueue::TryGet(), stk::sync::Mutex::TryLock(), stk::sync::RWMutex::TryLock(), stk::sync::MessageQueue::TryPeek(), stk::sync::MessageQueue::TryPeekFront(), stk::sync::MessageQueue::TryPut(), stk::sync::MessageQueue::TryPutFront(), stk::sync::Pipe::TryRead(), stk::sync::PipeT< Timer *, 32U >::TryRead(), stk::sync::Pipe::TryReadBulk(), stk::sync::PipeT< Timer *, 32U >::TryReadBulk(), stk::sync::Pipe::TryReadBulkTriggered(), stk::sync::RWMutex::TryReadLock(), stk::sync::EventFlags::TryWait(), stk::sync::Semaphore::TryWait(), stk::sync::Pipe::TryWrite(), stk::sync::PipeT< Timer *, 32U >::TryWrite(), stk::sync::Pipe::TryWriteBulk(), stk::sync::PipeT< Timer *, 32U >::TryWriteBulk(), stk::time::TimerHost::UpdateTime(), stk::sync::ConditionVariable::Wait(), stk::sync::Event::Wait(), stk::sync::EventFlags::Wait(), stk::sync::Semaphore::Wait(), stk::sync::Pipe::WriteBulk(), stk::sync::PipeT< Timer *, 32U >::WriteBulk(), xMessageBufferSend(), and xMessageBufferSendFromISR().
Weight value: weight is not set.
Definition at line 194 of file stk_common.h.
Referenced by stk::SwitchStrategySmoothWeightedRoundRobin::AddTask(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::Bind(), stk::ISyncObject::FindWeightHigherThan(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetWeight(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS, 16U, stk::SwitchStrategyFP32, stk::PlatformDefault >::OnInheritWeight(), and stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS, 16U, stk::SwitchStrategyFP32, stk::PlatformDefault >::OnRestoreWeight().
Bitmask sentinel for ISR-context task identifiers.
The upper 20 bits of the TId space are reserved for ISR contexts. When GetTid() is called from an interrupt service routine, it returns TID_ISR_N | exception_number, where exception_number is the raw value:
This encoding guarantees uniqueness per exception, so two ISRs at different priority levels or with different exception numbers are never treated as the same owner by synchronization primitives.
Task TIds are word-aligned pointers. On all supported Cortex-M and RISC-V targets they fall in the range 0x00000000..0xEFFFFFFF, so no overlap with the 0xFFFFF000..0xFFFFFFFF sentinel range is possible.
IsIsrTid() to test for this sentinel rather than comparing against this constant directly. Definition at line 172 of file stk_common.h.
Referenced by IsIsrTid().
Reserved task/thread id representing zero/none thread id.
Definition at line 177 of file stk_common.h.
Referenced by stk::sync::SpinLock::MakeLocked(), stk::sync::Mutex::Mutex(), 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::sync::SpinLock::SpinLock(), stk::sync::Mutex::TimedLock(), stk::sync::Mutex::Unlock(), stk::sync::SpinLock::Unlock(), uxSemaphoreGetCount(), xSemaphoreGetMutexHolder(), xSemaphoreGetMutexHolderFromISR(), and stk::sync::SpinLock::~SpinLock().
|
staticconstexpr |
Timeout value: block indefinitely until the synchronization object is signaled.
Definition at line 183 of file stk_common.h.
Referenced by stk::memory::BlockMemoryPool::Alloc(), stk::memory::BlockMemoryPool::AllocT(), CmsisTimeoutToStk(), DelayMs(), FrtosTimeoutToStk(), stk::sync::Mutex::Lock(), stk::sync::RWMutex::Lock(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS, 16U, stk::SwitchStrategyFP32, stk::PlatformDefault >::OnTaskWait(), osThreadJoin(), stk::time::TimerHost::ProcessCommands(), stk::sync::PipeT< Timer *, 32U >::Read(), stk::sync::Pipe::ReadBulk(), stk::sync::PipeT< Timer *, 32U >::ReadBulk(), stk::sync::Pipe::ReadBulkTriggered(), stk::sync::RWMutex::ReadLock(), stk::time::TimerHost::Restart(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::ScheduleRemoval(), stk::sync::RWMutex::ScopedTimedLock::ScopedTimedLock(), stk::sync::RWMutex::ScopedTimedReadMutex::ScopedTimedReadMutex(), stk::time::TimerHost::SetPeriod(), SleepMs(), stk::time::TimerHost::Start(), stk::time::TimerHost::StartOrReset(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS, 16U, stk::SwitchStrategyFP32, stk::PlatformDefault >::SuspendTask(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::WaitObject::Tick(), stk::time::TimerHost::UpdateTime(), stk::sync::EventFlags::Wait(), stk::sync::PipeT< Timer *, 32U >::Write(), stk::sync::Pipe::WriteBulk(), stk::sync::PipeT< Timer *, 32U >::WriteBulk(), stk::sync::EventFlags::~EventFlags(), stk::sync::MessageQueue::~MessageQueue(), and stk::sync::Pipe::~Pipe().