![]() |
SuperTinyKernel™ RTOS 1.05.3
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Public Types | |
| enum | EConsts { TASKS_MAX = TSize } |
| Constants. More... | |
| enum | EState : uint8_t { STATE_INACTIVE = 0 , STATE_READY , STATE_RUNNING } |
| Kernel state. More... | |
Public Member Functions | |
| BaseType::EFsmState | GetNewFsmState (typename BaseType::KernelTask *&next) override |
| void | ForceUpdateInvalidFsmState (bool max_val) |
| void | Initialize (uint32_t resolution_us=PERIODICITY_DEFAULT) |
| Prepare kernel for use: reset state, configure the platform, and register the service singleton. | |
| void | AddTask (ITask *user_task) |
| Register task for a soft real-time (SRT) scheduling. | |
| void | AddTask (ITask *user_task, Timeout periodicity_tc, Timeout deadline_tc, Timeout start_delay_tc) |
| Register a task for hard real-time (HRT) scheduling. | |
| void | RemoveTask (ITask *user_task) |
| Remove a previously added task from the kernel before Start(). | |
| void | Start () |
| Start the scheduler. This call does not return until all tasks have exited (KERNEL_DYNAMIC mode) or indefinitely (KERNEL_STATIC mode). | |
| bool | IsStarted () const |
| Check whether scheduler is currently running. | |
| IPlatform * | GetPlatform () |
| Get platform driver instance owned by this kernel. | |
| ITaskSwitchStrategy * | GetSwitchStrategy () |
| Get task-switching strategy instance owned by this kernel. | |
| EState | GetState () const |
| Get kernel state. | |
Public Attributes | |
| uint8_t | m_fsm_state_mock = KernelMock::FSM_STATE_NONE |
Protected Types | |
| enum | ERequest : uint8_t { REQUEST_NONE = 0 , REQUEST_ADD_TASK = (1 << 0) } |
| Bitmask flags for pending inter-task requests that must be processed by the kernel on the next tick (in UpdateTaskRequest()). More... | |
| enum | EFsmState : int8_t { FSM_STATE_NONE = -1 , FSM_STATE_SWITCHING , FSM_STATE_SLEEPING , FSM_STATE_WAKING , FSM_STATE_EXITING , FSM_STATE_MAX } |
| Finite-state machine (FSM) state. Encodes what the kernel is currently doing between two consecutive tick events. More... | |
| enum | EFsmEvent : int8_t { FSM_EVENT_SWITCH = 0 , FSM_EVENT_SLEEP , FSM_EVENT_WAKE , FSM_EVENT_EXIT , FSM_EVENT_MAX } |
| Finite-state machine (FSM) event. Computed by FetchNextEvent() each tick based on strategy output and current kernel state. More... | |
| typedef StackMemoryWrapper<(32)> | SleepTrapStackMemory |
| Stack memory wrapper type for the sleep trap. | |
| typedef StackMemoryWrapper< STACK_SIZE_MIN > | ExitTrapStackMemory |
| Stack memory wrapper type for the exit trap. | |
| typedef KernelTask | TaskStorageType[TASKS_MAX] |
| KernelTask array type used as a storage for the KernelTask instances. | |
| typedef ISyncObject::ListHeadType | SyncObjectList |
| Intrusive list of active ISyncObject instances registered with this kernel. Each sync object in this list receives a Tick() call every kernel tick for timeout tracking. Allocated only when KERNEL_SYNC is set (zero-size otherwise). | |
Protected Member Functions | |
| void | RemoveTask (KernelTask *task) |
| Remove kernel task. | |
| void | InitTraps () |
| Initialize stack of the traps. | |
| KernelTask * | AllocateNewTask (ITask *user_task) |
| Allocate new instance of KernelTask. | |
| void | AddKernelTask (KernelTask *task) |
| Add kernel task to the scheduling strategy. | |
| void | AllocateAndAddNewTask (ITask *user_task) |
| Allocate new instance of KernelTask and add it into the scheduling process. | |
| void | HrtAllocateAndAddNewTask (ITask *user_task, Timeout periodicity_tc, Timeout deadline_tc, Timeout start_delay_tc) |
| Allocate new instance of KernelTask and add it into the HRT scheduling process. | |
| void | RequestAddTask (ITask *user_task) |
| Request to add new task. | |
| KernelTask * | FindTaskByUserTask (const ITask *user_task) |
| Find kernel task by the bound ITask instance. | |
| KernelTask * | FindTaskByStack (const Stack *stack) |
| Find kernel task by the bound Stack instance. | |
| KernelTask * | FindTaskBySP (Word SP) |
| Find kernel task for a Stack Pointer (SP). | |
| void | OnStart (Stack *&active) |
| Called by platform driver immediately after a scheduler start (first tick). | |
| void | OnStop () |
| Called by the platform driver after a scheduler stop (all tasks have exited). | |
| bool | OnTick (Stack *&idle, Stack *&active) |
| Process one scheduler tick. Called from the platform timer/tick ISR. | |
| void | OnTaskSwitch (Word caller_SP) |
| Called by Thread process (via IKernelService::SwitchToNext) to switch to a next task. | |
| void | OnTaskSleep (Word caller_SP, Timeout ticks) |
| Called by Thread process (via IKernelService::Sleep) for exclusion of the calling process from scheduling (sleeping). | |
| void | OnTaskSleepUntil (Word caller_SP, Ticks timestamp) |
| Called by Thread process (via IKernelService::SleepUntil) for exclusion of the calling process from scheduling (sleeping). | |
| void | OnTaskExit (Stack *stack) |
| Called from the Thread process when task finished (its Run function exited by return). | |
| IWaitObject * | OnTaskWait (Word caller_SP, ISyncObject *sync_obj, IMutex *mutex, Timeout timeout) |
| Called from the Thread process when task needs to wait. | |
| TId | OnGetTid (Word caller_SP) |
| Called from the Thread process when for getting task/thread id of the process. | |
| Timeout | UpdateTasks (const Timeout elapsed_ticks) |
| Update tasks (sleep, requests). | |
| Timeout | UpdateTaskState (const Timeout elapsed_ticks) |
| Update task state: process removals, advance sleep timers, and track HRT durations. | |
| void | UpdateSyncObjects (const Timeout elapsed_ticks) |
| Update synchronization objects. | |
| void | UpdateTaskRequest () |
| Update pending task requests. | |
| EFsmEvent | FetchNextEvent (KernelTask *&next) |
| Fetch next event for the FSM. | |
| bool | UpdateFsmState (Stack *&idle, Stack *&active) |
| Update FSM state. | |
| bool | StateSwitch (KernelTask *now, KernelTask *next, Stack *&idle, Stack *&active) |
| Switches contexts. | |
| bool | StateWake (KernelTask *now, KernelTask *next, Stack *&idle, Stack *&active) |
| Wakes up after sleeping. | |
| bool | StateSleep (KernelTask *now, KernelTask *next, Stack *&idle, Stack *&active) |
| Enters into a sleeping mode. | |
| bool | StateExit (KernelTask *now, KernelTask *next, Stack *&idle, Stack *&active) |
| Exits from scheduling. | |
| bool | IsInitialized () const |
| Check whether Initialize() has been called and completed successfully. | |
| void | ScheduleAddTask () |
| Signal the kernel to process a pending AddTask request on the next tick. | |
Static Protected Member Functions | |
| static bool | IsValidFsmState (EFsmState state) |
| Check if FSM state is valid. | |
| static bool | IsStaticMode () |
| static bool | IsDynamicMode () |
| static bool | IsHrtMode () |
| static bool | IsSyncMode () |
| static bool | IsTicklessMode () |
Protected Attributes | |
| KernelService | m_service |
| Kernel service singleton exposed to running tasks via IKernelService::GetInstance(). | |
| TPlatform | m_platform |
| Platform driver (SysTick, PendSV, context switch implementation). | |
| TStrategy | m_strategy |
| Task-switching strategy (determines which task runs next). | |
| KernelTask * | m_task_now |
Currently executing task, or nullptr before Start() or after all tasks exit. | |
| TaskStorageType | m_task_storage |
| Static pool of TSize KernelTask slots (free slots have m_user == nullptr). | |
| SleepTrapStack | m_sleep_trap [1] |
| Sleep trap (always present): executed when all tasks are sleeping. | |
| ExitTrapStack | m_exit_trap [((((TMode) &(KERNEL_DYNAMIC)) !=0U) ?(1) :(0))] |
| Exit trap: zero-size in KERNEL_STATIC mode; one entry in KERNEL_DYNAMIC mode. | |
| EFsmState | m_fsm_state |
| Current FSM state. Drives context-switch decision on every tick. | |
| volatile uint8_t | m_request |
| Bitmask of pending ERequest flags from running tasks. Written by tasks, read/cleared by UpdateTaskRequest() in tick context. | |
| volatile EState | m_state |
| Current kernel state. | |
| SyncObjectList | m_sync_list [((((TMode) &(KERNEL_SYNC)) !=0U) ?(1) :(0))] |
| List of active sync objects. Zero-size (no memory) if KERNEL_SYNC is not set. | |
| const EFsmState | m_fsm [FSM_STATE_MAX][FSM_EVENT_MAX] |
Private Types | |
| typedef Kernel< TMode, TSize, TStrategy, TPlatform > | BaseType |
Definition at line 20 of file stktest_kernel.cpp.
|
private |
Definition at line 22 of file stktest_kernel.cpp.
|
protectedinherited |
Stack memory wrapper type for the exit trap.
|
protectedinherited |
Stack memory wrapper type for the sleep trap.
|
protectedinherited |
Intrusive list of active ISyncObject instances registered with this kernel. Each sync object in this list receives a Tick() call every kernel tick for timeout tracking. Allocated only when KERNEL_SYNC is set (zero-size otherwise).
|
protectedinherited |
KernelTask array type used as a storage for the KernelTask instances.
|
inherited |
Constants.
| Enumerator | |
|---|---|
| TASKS_MAX | Maximum number of concurrently registered tasks. Fixed at compile time. Exceeding this limit in AddTask() triggers a compile-time assert (TASKS_MAX > 0) and a runtime STK_ASSERT. |
Definition at line 762 of file stk.h.
|
protectedinherited |
Finite-state machine (FSM) event. Computed by FetchNextEvent() each tick based on strategy output and current kernel state.
| Enumerator | |
|---|---|
| FSM_EVENT_SWITCH | Strategy returned a runnable task, perform a context switch. |
| FSM_EVENT_SLEEP | No runnable tasks, enter sleep trap. |
| FSM_EVENT_WAKE | A task became runnable while the kernel was sleeping, wake from sleep trap. |
| FSM_EVENT_EXIT | No tasks remain (KERNEL_DYNAMIC), exit scheduling and return from Start(). |
| FSM_EVENT_MAX | Sentinel: number of valid events (used to size the FSM table). |
Definition at line 984 of file stk.h.
|
protectedinherited |
Finite-state machine (FSM) state. Encodes what the kernel is currently doing between two consecutive tick events.
| Enumerator | |
|---|---|
| FSM_STATE_NONE | Sentinel / uninitialized value. Set by the constructor, replaced by FSM_STATE_SWITCHING on the first tick. |
| FSM_STATE_SWITCHING | Normal operation: switching between runnable tasks each tick. |
| FSM_STATE_SLEEPING | All tasks are sleeping, the sleep trap is executing (CPU in low-power state). |
| FSM_STATE_WAKING | At least one task woke up, transitioning from sleep trap back to a user task. |
| FSM_STATE_EXITING | All tasks exited (KERNEL_DYNAMIC only), executing the exit trap to return from Start(). |
| FSM_STATE_MAX | Sentinel: number of valid states (used to size the FSM table), denotes uninitialized state. |
Definition at line 970 of file stk.h.
|
protectedinherited |
Bitmask flags for pending inter-task requests that must be processed by the kernel on the next tick (in UpdateTaskRequest()).
| Enumerator | |
|---|---|
| REQUEST_NONE | No pending requests. |
| REQUEST_ADD_TASK | An AddTask() request is pending from a running task (KERNEL_DYNAMIC only). |
Definition at line 101 of file stk.h.
|
inherited |
Kernel state.
| Enumerator | |
|---|---|
| STATE_INACTIVE | not ready, IKernel::Initialize() must be called |
| STATE_READY | ready to start, IKernel::Start() must be called |
| STATE_RUNNING | initialized and running, IKernel::Start() was called successfully |
Definition at line 859 of file stk_common.h.
|
inlineprotectedinherited |
Add kernel task to the scheduling strategy.
| [in] | task | Pointer to the kernel task. |
Definition at line 1073 of file stk.h.
References stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetUserStack(), IsStarted(), and m_strategy.
Referenced by AllocateAndAddNewTask(), and HrtAllocateAndAddNewTask().
|
inlinevirtualinherited |
Register task for a soft real-time (SRT) scheduling.
| [in] | user_task | User task to add. Must not already be registered. Must not be nullptr. |
Implements stk::IKernel.
Definition at line 832 of file stk.h.
References __stk_attr_noinline, AllocateAndAddNewTask(), IsDynamicMode(), IsHrtMode(), IsInitialized(), IsStarted(), RequestAddTask(), and STK_ASSERT.
Referenced by stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TestAlgorithm(), stk::test::TestHrtTaskExitDuringSleepState(), stk::test::TestPriorityNext(), stk::test::TestTaskExit(), and stk::test::TestTaskSleep().
|
inlinevirtualinherited |
Register a task for hard real-time (HRT) scheduling.
| [in] | user_task | User task to add. Must not already be registered. Must not be nullptr. |
| [in] | periodicity_tc | Activation period in ticks. Must be > 0 and < INT32_MAX. |
| [in] | deadline_tc | Maximum allowed active duration in ticks. Must be > 0 and < INT32_MAX. |
| [in] | start_delay_tc | Initial sleep delay in ticks before the first activation. 0 means activate immediately. |
Implements stk::IKernel.
Definition at line 871 of file stk.h.
References __stk_attr_noinline, HrtAllocateAndAddNewTask(), IsHrtMode(), IsInitialized(), IsStarted(), and STK_ASSERT.
|
inlineprotectedinherited |
Allocate new instance of KernelTask and add it into the scheduling process.
| [in] | user_task | User task for which kernel task object is allocated. |
Definition at line 1089 of file stk.h.
References AddKernelTask(), AllocateNewTask(), and STK_ASSERT.
Referenced by AddTask(), and UpdateTaskRequest().
|
inlineprotectedinherited |
Allocate new instance of KernelTask.
| [in] | user_task | User task for which kernel task object is allocated. |
Definition at line 1037 of file stk.h.
References stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::Bind(), stk::IStackMemory::GetStack(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsBusy(), m_platform, m_task_storage, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::m_user, STK_ASSERT, and TASKS_MAX.
Referenced by AllocateAndAddNewTask(), and HrtAllocateAndAddNewTask().
|
inlineprotectedinherited |
Fetch next event for the FSM.
| [out] | next | Next kernel task to which Kernel can switch. |
Definition at line 1656 of file stk.h.
References FSM_EVENT_EXIT, FSM_EVENT_SLEEP, FSM_EVENT_SWITCH, FSM_EVENT_WAKE, FSM_STATE_SLEEPING, IsDynamicMode(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsSleeping(), m_fsm_state, m_strategy, and STK_ASSERT.
Referenced by GetNewFsmState().
|
inlineprotectedinherited |
Find kernel task for a Stack Pointer (SP).
| [in] | SP | Stack pointer. |
Definition at line 1175 of file stk.h.
References __stk_attr_noinline, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsBusy(), IsDynamicMode(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsMemoryOfSP(), m_task_now, m_task_storage, STK_ASSERT, and TASKS_MAX.
Referenced by OnGetTid(), OnTaskSleep(), OnTaskSleepUntil(), OnTaskWait(), and RequestAddTask().
|
inlineprotectedinherited |
Find kernel task by the bound Stack instance.
| [in] | stack | Stack. |
Definition at line 1159 of file stk.h.
References stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetUserStack(), m_task_storage, and TASKS_MAX.
Referenced by OnTaskExit().
|
inlineprotectedinherited |
Find kernel task by the bound ITask instance.
| [in] | user_task | User task. |
Definition at line 1143 of file stk.h.
References __stk_attr_noinline, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetUserTask(), m_task_storage, and TASKS_MAX.
Referenced by RemoveTask().
|
inline |
Definition at line 36 of file stktest_kernel.cpp.
References stk::Kernel< TMode, TSize, TStrategy, TPlatform >::FSM_STATE_MAX, m_fsm_state_mock, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::m_task_now, and stk::Kernel< TMode, TSize, TStrategy, TPlatform >::UpdateFsmState().
Referenced by stk::test::TEST().
|
inlineoverride |
Definition at line 28 of file stktest_kernel.cpp.
References stk::Kernel< TMode, TSize, TStrategy, TPlatform >::FSM_STATE_NONE, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::GetNewFsmState(), and m_fsm_state_mock.
|
inlinevirtualinherited |
Get platform driver instance owned by this kernel.
Implements stk::IKernel.
Definition at line 954 of file stk.h.
References m_platform.
Referenced by stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TestHrtTaskExitDuringSleepState(), stk::test::TestTaskExit(), and stk::test::TestTaskSleep().
|
inlinevirtualinherited |
Get kernel state.
Implements stk::IKernel.
Definition at line 963 of file stk.h.
References m_state.
Referenced by stk::test::TEST(), stk::test::TEST(), and stk::test::TEST().
|
inlinevirtualinherited |
Get task-switching strategy instance owned by this kernel.
Implements stk::IKernel.
Definition at line 959 of file stk.h.
References m_strategy.
Referenced by stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TestAlgorithm(), stk::test::TestHrtTaskExitDuringSleepState(), and stk::test::TestPriorityNext().
|
inlineprotectedinherited |
Allocate new instance of KernelTask and add it into the HRT scheduling process.
| [in] | user_task | User task for which kernel task object is allocated. |
| [in] | periodicity_tc | Periodicity time at which task is scheduled (ticks). |
| [in] | deadline_tc | Deadline time within which a task must complete its work (ticks). |
| [in] | start_delay_tc | Initial start delay for the task (ticks). |
Definition at line 1105 of file stk.h.
References AddKernelTask(), AllocateNewTask(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtInit(), and STK_ASSERT.
Referenced by AddTask().
|
inlinevirtualinherited |
Prepare kernel for use: reset state, configure the platform, and register the service singleton.
| [in] | resolution_us | System tick resolution in microseconds per tick (default: PERIODICITY_DEFAULT). Valid range: 1 .. PERIODICITY_MAX. Asserts if 0 or out of range. |
Implements stk::IKernel.
Definition at line 805 of file stk.h.
References __stk_attr_noinline, FSM_STATE_NONE, IsDynamicMode(), IsInitialized(), m_exit_trap, m_fsm_state, m_platform, m_request, m_service, m_state, m_task_now, stk::PERIODICITY_DEFAULT, stk::PERIODICITY_MAX, REQUEST_NONE, stk::IKernel::STATE_READY, and STK_ASSERT.
Referenced by stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TestAlgorithm(), stk::test::TestHrtTaskExitDuringSleepState(), stk::test::TestPriorityNext(), stk::test::TestTaskExit(), and stk::test::TestTaskSleep().
|
inlineprotectedinherited |
Initialize stack of the traps.
Definition at line 1003 of file stk.h.
References __stk_attr_noinline, stk::ACCESS_PRIVILEGED, IsDynamicMode(), m_exit_trap, m_platform, m_sleep_trap, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::ExitTrapStack::memory, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::SleepTrapStack::memory, stk::Stack::mode, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::ExitTrapStack::stack, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::SleepTrapStack::stack, stk::STACK_EXIT_TRAP, stk::STACK_SLEEP_TRAP, stk::SYS_TASK_ID_EXIT, and stk::SYS_TASK_ID_SLEEP.
Referenced by Start().
|
inlinestaticprotectedinherited |
Definition at line 1923 of file stk.h.
References __stk_forceinline, and stk::KERNEL_DYNAMIC.
Referenced by AddTask(), FetchNextEvent(), FindTaskBySP(), Initialize(), InitTraps(), OnStop(), OnTaskExit(), RemoveTask(), RequestAddTask(), StateExit(), UpdateTaskRequest(), and UpdateTaskState().
|
inlinestaticprotectedinherited |
Definition at line 1924 of file stk.h.
References __stk_forceinline, and stk::KERNEL_HRT.
Referenced by AddTask(), AddTask(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetHrtDeadline(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetHrtPeriodicity(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetHrtRelativeDeadline(), OnStart(), OnTaskSleep(), OnTaskSleepUntil(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::ScheduleRemoval(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::Sleep(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::SleepUntil(), StateSleep(), StateSwitch(), StateWake(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::Unbind(), UpdateTaskRequest(), and UpdateTaskState().
|
inlineprotectedinherited |
Check whether Initialize() has been called and completed successfully.
true if Initialize() was called, false otherwise. Definition at line 1888 of file stk.h.
References m_state, and stk::IKernel::STATE_INACTIVE.
Referenced by AddTask(), AddTask(), Initialize(), and Start().
|
inlineinherited |
Check whether scheduler is currently running.
true if Start() has been called and the first task switch has occurred (m_task_now != nullptr), false before Start() or after all tasks exit. Definition at line 946 of file stk.h.
References m_task_now.
Referenced by AddKernelTask(), AddTask(), AddTask(), and RemoveTask().
|
inlinestaticprotectedinherited |
|
inlinestaticprotectedinherited |
Definition at line 1925 of file stk.h.
References __stk_forceinline, and stk::KERNEL_SYNC.
Referenced by stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::KernelTask(), OnTaskWait(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::Unbind(), UpdateSyncObjects(), UpdateTasks(), UpdateTaskState(), and stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService::Wait().
|
inlinestaticprotectedinherited |
Definition at line 1926 of file stk.h.
References __stk_forceinline, and stk::KERNEL_TICKLESS.
Referenced by UpdateTaskState().
|
inlinestaticprotectedinherited |
Check if FSM state is valid.
Definition at line 995 of file stk.h.
References __stk_forceinline, FSM_STATE_MAX, and FSM_STATE_NONE.
Referenced by GetNewFsmState().
|
inlineprotectedvirtualinherited |
Called from the Thread process when for getting task/thread id of the process.
| [in] | caller_SP | Value of Stack Pointer (SP) register (for locating the calling process inside the kernel). |
Implements stk::IPlatform::IEventHandler.
Definition at line 1460 of file stk.h.
References FindTaskBySP(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetTid(), and STK_ASSERT.
|
inlineprotectedvirtualinherited |
Called by platform driver immediately after a scheduler start (first tick).
| [out] | active | Set to the stack of the first task to run, or to the sleep-trap stack if all tasks are initially sleeping. |
Implements stk::IPlatform::IEventHandler.
Definition at line 1223 of file stk.h.
References __stk_attr_noinline, FSM_STATE_SLEEPING, FSM_STATE_SWITCHING, GetNewFsmState(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetUserStack(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtOnSwitchedIn(), IsHrtMode(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsSleeping(), m_fsm_state, m_sleep_trap, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::m_state, m_state, m_strategy, m_task_now, m_task_storage, stk::IKernel::STATE_RUNNING, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::STATE_SLEEP_PENDING, STK_ASSERT, and TASKS_MAX.
|
inlineprotectedvirtualinherited |
Called by the platform driver after a scheduler stop (all tasks have exited).
Implements stk::IPlatform::IEventHandler.
Definition at line 1290 of file stk.h.
References __stk_attr_noinline, FSM_STATE_NONE, IsDynamicMode(), m_fsm_state, m_state, and stk::IKernel::STATE_READY.
|
inlineprotectedvirtualinherited |
Called from the Thread process when task finished (its Run function exited by return).
| [out] | stack | Stack of the exited task. |
Implements stk::IPlatform::IEventHandler.
Definition at line 1401 of file stk.h.
References FindTaskByStack(), IsDynamicMode(), stk::KERNEL_PANIC_BAD_MODE, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::ScheduleRemoval(), STK_ASSERT, and STK_KERNEL_PANIC.
|
inlineprotectedvirtualinherited |
Called by Thread process (via IKernelService::Sleep) for exclusion of the calling process from scheduling (sleeping).
| [in] | caller_SP | Value of Stack Pointer (SP) register (for locating the calling process inside the kernel). |
| [in] | ticks | Time to sleep (ticks). |
Implements stk::IPlatform::IEventHandler.
Definition at line 1352 of file stk.h.
References __stk_relax_cpu, FindTaskBySP(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtOnWorkCompleted(), IsHrtMode(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsSleeping(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::ScheduleSleep(), and STK_ASSERT.
Referenced by OnTaskSwitch().
|
inlineprotectedvirtualinherited |
Called by Thread process (via IKernelService::SleepUntil) for exclusion of the calling process from scheduling (sleeping).
| [in] | caller_SP | Value of Stack Pointer (SP) register (for locating the calling process inside the kernel). |
| [in] | timestamp | Absolute timestamp (ticks). |
Implements stk::IPlatform::IEventHandler.
Definition at line 1374 of file stk.h.
References __stk_relax_cpu, FindTaskBySP(), IsHrtMode(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsSleeping(), m_service, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::ScheduleSleep(), and STK_ASSERT.
|
inlineprotectedvirtualinherited |
Called by Thread process (via IKernelService::SwitchToNext) to switch to a next task.
| [in] | caller_SP | Value of Stack Pointer (SP) register (for locating the calling process inside the kernel). |
Implements stk::IPlatform::IEventHandler.
Definition at line 1344 of file stk.h.
References OnTaskSleep().
|
inlineprotectedvirtualinherited |
Called from the Thread process when task needs to wait.
| [in] | caller_SP | Value of Stack Pointer (SP) register (for locating the calling process inside the kernel). |
| [in] | sync_obj | ISyncObject instance (passed by Wait). |
| [in] | mutex | IMutex instance (passed by Wait). |
| [in] | timeout | Time to sleep (ticks). |
Implements stk::IPlatform::IEventHandler.
Definition at line 1417 of file stk.h.
References __stk_relax_cpu, FindTaskBySP(), stk::util::DListEntry< T, _ClosedLoop >::GetHead(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsSleeping(), IsSyncMode(), stk::IMutex::Lock(), m_sync_list, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::m_wait_obj, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::ScheduleSleep(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::WaitObject::SetupWait(), STK_ASSERT, stk::IMutex::Unlock(), and stk::WAIT_INFINITE.
|
inlineprotectedvirtualinherited |
Process one scheduler tick. Called from the platform timer/tick ISR.
| [out] | idle | Stack descriptor to context-switch out (nullptr if no switch needed). |
| [out] | active | Stack descriptor to context-switch in (nullptr if no switch needed). |
| [in,out] | ticks | (KERNEL_TICKLESS builds only) On entry: actual number of ticks elapsed since the last call, as measured by the platform driver. On return: the number of ticks the hardware timer may suppress before the next required wakeup, computed as the minimum remaining sleep across all active tasks, clamped to [1, STK_TICKLESS_TICKS_MAX]. The platform driver programs this value into the timer to avoid unnecessary wakeups. This parameter is absent in non-tickless builds. |
true if a context switch is required (idle and active are valid); false if the current task continues running. Implements stk::IPlatform::IEventHandler.
Definition at line 1317 of file stk.h.
References m_service, STK_TICKLESS_IDLE, UpdateFsmState(), and UpdateTasks().
|
inlinevirtualinherited |
Remove a previously added task from the kernel before Start().
| [in] | user_task | User task to remove. Must not be nullptr. |
Implements stk::IKernel.
Definition at line 895 of file stk.h.
References __stk_attr_noinline, FindTaskByUserTask(), IsDynamicMode(), IsStarted(), RemoveTask(), and STK_ASSERT.
Referenced by RemoveTask(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TestAlgorithm(), stk::test::TestPriorityNext(), and UpdateTaskState().
|
inlineprotectedinherited |
Remove kernel task.
| [in] | task | Kernel task. |
Definition at line 1201 of file stk.h.
References stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetUserStack(), m_strategy, STK_ASSERT, and stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::Unbind().
|
inlineprotectedinherited |
Request to add new task.
| [in] | user_task | User task to add. |
Definition at line 1119 of file stk.h.
References __stk_attr_noinline, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::SrtInfo::add_task_req, FindTaskBySP(), IsDynamicMode(), m_platform, m_service, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::m_srt, ScheduleAddTask(), and STK_ASSERT.
Referenced by AddTask().
|
inlineprotectedinherited |
Signal the kernel to process a pending AddTask request on the next tick.
Definition at line 1894 of file stk.h.
References m_request, and REQUEST_ADD_TASK.
Referenced by RequestAddTask().
|
inlinevirtualinherited |
Start the scheduler. This call does not return until all tasks have exited (KERNEL_DYNAMIC mode) or indefinitely (KERNEL_STATIC mode).
Implements stk::IKernel.
Definition at line 921 of file stk.h.
References __stk_attr_noinline, InitTraps(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsBusy(), IsInitialized(), m_platform, m_task_storage, STK_ASSERT, and TASKS_MAX.
Referenced by stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TestHrtTaskExitDuringSleepState(), stk::test::TestTaskExit(), and stk::test::TestTaskSleep().
|
inlineprotectedinherited |
Exits from scheduling.
| [in] | now | Currently active kernel task (ignored). |
| [in] | next | Next kernel task (ignored). |
| [out] | idle | Stack of the task which must enter Idle state. |
| [out] | active | Stack of the task which must enter Active state (to which context will switch). |
Definition at line 1859 of file stk.h.
References IsDynamicMode(), m_exit_trap, m_platform, m_task_now, and STK_ASSERT.
Referenced by UpdateFsmState().
|
inlineprotectedinherited |
Enters into a sleeping mode.
| [in] | now | Currently active kernel task. |
| [in] | next | Next kernel task (ignored). |
| [out] | idle | Stack of the task which must enter Idle state. |
| [out] | active | Stack of the task which must enter Active state (to which context will switch). |
Definition at line 1826 of file stk.h.
References stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetUserStack(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtOnSwitchedOut(), IsHrtMode(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsPendingRemoval(), m_platform, m_sleep_trap, m_strategy, m_task_now, STK_ASSERT, and stk::TRACE_EVENT_SLEEP.
Referenced by UpdateFsmState().
|
inlineprotectedinherited |
Switches contexts.
| [in] | now | Currently active kernel task. |
| [in] | next | Next kernel task. |
| [out] | idle | Stack of the task which must enter Idle state. |
| [out] | active | Stack of the task which must enter Active state (to which context will switch). |
Definition at line 1748 of file stk.h.
References stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtInfo::done, stk::IStackMemory::GetStack(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetUserStack(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetUserTask(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtOnSwitchedIn(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtOnSwitchedOut(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsBusy(), IsHrtMode(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::m_hrt, m_platform, m_task_now, STK_ASSERT, STK_STACK_MEMORY_FILLER, and stk::TRACE_EVENT_SWITCH.
Referenced by UpdateFsmState().
|
inlineprotectedinherited |
Wakes up after sleeping.
| [in] | now | Currently active kernel task (ignored). |
| [in] | next | Next kernel task. |
| [out] | idle | Stack of the task which must enter Idle state. |
| [out] | active | Stack of the task which must enter Active state (to which context will switch). |
Definition at line 1794 of file stk.h.
References stk::IStackMemory::GetStack(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetUserStack(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::GetUserTask(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtOnSwitchedIn(), IsHrtMode(), m_sleep_trap, m_task_now, STK_ASSERT, and STK_STACK_MEMORY_FILLER.
Referenced by UpdateFsmState().
|
inlineprotectedinherited |
Update FSM state.
| [out] | idle | Stack of the task which must enter Idle state. |
| [out] | active | Stack of the task which must enter Active state (to which context will switch). |
Definition at line 1708 of file stk.h.
References FSM_STATE_EXITING, FSM_STATE_MAX, FSM_STATE_NONE, FSM_STATE_SLEEPING, FSM_STATE_SWITCHING, FSM_STATE_WAKING, GetNewFsmState(), stk::KERNEL_PANIC_BAD_STATE, m_fsm_state, m_task_now, StateExit(), StateSleep(), StateSwitch(), StateWake(), and STK_KERNEL_PANIC.
Referenced by stk::test::KernelMock< TMode, TSize, TStrategy, TPlatform >::ForceUpdateInvalidFsmState(), and OnTick().
|
inlineprotectedinherited |
Update synchronization objects.
Definition at line 1600 of file stk.h.
References stk::util::DListEntry< T, _ClosedLoop >::GetNext(), IsSyncMode(), m_sync_list, and STK_ASSERT.
Referenced by UpdateTasks().
|
inlineprotectedinherited |
Update pending task requests.
Definition at line 1621 of file stk.h.
References stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::SrtInfo::add_task_req, AllocateAndAddNewTask(), IsDynamicMode(), IsHrtMode(), m_request, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::m_srt, m_task_storage, REQUEST_ADD_TASK, REQUEST_NONE, TASKS_MAX, and stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::AddTaskRequest::user_task.
Referenced by UpdateTasks().
|
inlineprotectedinherited |
Update tasks (sleep, requests).
Definition at line 1470 of file stk.h.
References IsSyncMode(), UpdateSyncObjects(), UpdateTaskRequest(), and UpdateTaskState().
Referenced by OnTick().
|
inlineprotectedinherited |
Update task state: process removals, advance sleep timers, and track HRT durations.
| [in] | elapsed_ticks | Number of ticks elapsed since the previous call. Always 1 in non-tickless mode, may be >1 in tickless mode. |
Definition at line 1490 of file stk.h.
References stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtInfo::duration, FSM_STATE_SLEEPING, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtHardFailDeadline(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtIsDeadlineMissed(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsBusy(), IsDynamicMode(), IsHrtMode(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsPendingRemoval(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsSleeping(), IsSyncMode(), IsTicklessMode(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::WaitObject::IsWaiting(), m_fsm_state, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::m_hrt, m_platform, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::m_state, m_strategy, m_task_now, m_task_storage, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::m_time_sleep, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::WaitObject::m_time_wait, stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::m_wait_obj, stk::Max(), stk::Min(), RemoveTask(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::STATE_SLEEP_PENDING, STK_TICKLESS_TICKS_MAX, and TASKS_MAX.
Referenced by UpdateTasks().
|
protectedinherited |
Exit trap: zero-size in KERNEL_STATIC mode; one entry in KERNEL_DYNAMIC mode.
Definition at line 1996 of file stk.h.
Referenced by Initialize(), InitTraps(), Kernel(), and StateExit().
|
protectedinherited |
Compile-time FSM transition table. Indexed as m_fsm[current_state][event] -> next_state. FSM_STATE_NONE as a next-state means "no transition": the FSM stays in the current state. Updated by UpdateFsmState() each tick via GetNewFsmState() -> FetchNextEvent().
Definition at line 2002 of file stk.h.
Referenced by GetNewFsmState().
|
protectedinherited |
Current FSM state. Drives context-switch decision on every tick.
Definition at line 1997 of file stk.h.
Referenced by FetchNextEvent(), GetNewFsmState(), Initialize(), Kernel(), OnStart(), OnStop(), UpdateFsmState(), and UpdateTaskState().
| uint8_t stk::test::KernelMock< TMode, TSize, TStrategy, TPlatform >::m_fsm_state_mock = KernelMock::FSM_STATE_NONE |
Definition at line 25 of file stktest_kernel.cpp.
Referenced by ForceUpdateInvalidFsmState(), and GetNewFsmState().
|
protectedinherited |
Platform driver (SysTick, PendSV, context switch implementation).
Definition at line 1991 of file stk.h.
Referenced by AllocateNewTask(), GetPlatform(), Initialize(), InitTraps(), Kernel(), RequestAddTask(), Start(), StateExit(), StateSleep(), StateSwitch(), and UpdateTaskState().
|
protectedinherited |
Bitmask of pending ERequest flags from running tasks. Written by tasks, read/cleared by UpdateTaskRequest() in tick context.
Definition at line 1998 of file stk.h.
Referenced by Initialize(), Kernel(), ScheduleAddTask(), and UpdateTaskRequest().
|
protectedinherited |
Kernel service singleton exposed to running tasks via IKernelService::GetInstance().
Definition at line 1990 of file stk.h.
Referenced by Initialize(), OnTaskSleepUntil(), OnTick(), and RequestAddTask().
|
protectedinherited |
Sleep trap (always present): executed when all tasks are sleeping.
Definition at line 1995 of file stk.h.
Referenced by InitTraps(), Kernel(), OnStart(), StateSleep(), and StateWake().
|
protectedinherited |
Current kernel state.
Definition at line 1999 of file stk.h.
Referenced by GetState(), Initialize(), IsInitialized(), Kernel(), OnStart(), and OnStop().
|
protectedinherited |
Task-switching strategy (determines which task runs next).
Definition at line 1992 of file stk.h.
Referenced by AddKernelTask(), FetchNextEvent(), GetSwitchStrategy(), Kernel(), OnStart(), RemoveTask(), StateSleep(), and UpdateTaskState().
|
protectedinherited |
List of active sync objects. Zero-size (no memory) if KERNEL_SYNC is not set.
Definition at line 2000 of file stk.h.
Referenced by OnTaskWait(), and UpdateSyncObjects().
|
protectedinherited |
Currently executing task, or nullptr before Start() or after all tasks exit.
Definition at line 1993 of file stk.h.
Referenced by FindTaskBySP(), stk::test::KernelMock< TMode, TSize, TStrategy, TPlatform >::ForceUpdateInvalidFsmState(), Initialize(), IsStarted(), Kernel(), OnStart(), StateExit(), StateSleep(), StateSwitch(), StateWake(), UpdateFsmState(), and UpdateTaskState().
|
protectedinherited |
Static pool of TSize KernelTask slots (free slots have m_user == nullptr).
Definition at line 1994 of file stk.h.
Referenced by AllocateNewTask(), FindTaskBySP(), FindTaskByStack(), FindTaskByUserTask(), Kernel(), OnStart(), Start(), UpdateTaskRequest(), and UpdateTaskState().