![]() |
SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Interface for a user task. More...
#include <stk_common.h>
Public Member Functions | |
| virtual void | Run ()=0 |
| Entry point of the user task. | |
| virtual IStackMemory * | GetSecureStackMemory () |
| Get pointer to the stack memory. | |
| virtual const MpuRegionList * | GetMpuRegions () const |
| Get up to (STK_MPU_TASK_REGIONS - 1) application-defined MPU regions for this task. | |
| virtual EAccessMode | GetAccessMode () const =0 |
| Get hardware access mode of the user task. | |
| virtual void | OnDeadlineMissed (uint32_t duration) |
| Called by the scheduler if deadline of the task is missed when Kernel is operating in Hard Real-Time mode (see stk::KERNEL_HRT). | |
| virtual void | OnExit () |
| Called by the kernel before removal from the scheduling (see stk::KERNEL_DYNAMIC). | |
| virtual Weight | GetWeight () const |
| Get static base weight of the task. | |
| virtual const char * | GetTraceName () const |
| Get task trace name set by application. | |
| virtual const Word * | GetStack () const =0 |
| Get pointer to the stack memory. | |
| virtual size_t | GetStackSize () const =0 |
| Get number of elements of the stack memory array. | |
| virtual size_t | GetStackSpace () const |
| Get available stack space. | |
Interface for a user task.
Usage example:
Definition at line 733 of file stk_common.h.
|
pure virtual |
Get hardware access mode of the user task.
Implemented in FrtosTask, stk::Task< _StackSize, _AccessMode >, stk::TaskW< _Weight, _StackSize, _AccessMode >, stk::time::TimerHost::TimerWorkerTask, StkThread, and TaskWrapper.
Referenced by stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::Bind().
|
inlinevirtual |
Get up to (STK_MPU_TASK_REGIONS - 1) application-defined MPU regions for this task.
When STK_MPU_STACK_GUARD is enabled, each task owns STK_MPU_TASK_REGIONS (2 or 4, see STK_MPU_TASK_REGIONS) hardware MPU region slots. Slot 0 is always the automatic stack guard, computed by the driver from the task's own stack memory (see IStackMemory::GetStack/GetStackSize). This hook supplies the remaining STK_MPU_TASK_REGIONS-1 slots, letting an application additionally sandbox a task to e.g. a private data buffer, a specific peripheral block, or a shared IPC region - on top of its stack guard.
MpuRegionList containing up to (STK_MPU_TASK_REGIONS - 1) region descriptors, or nullptr if no extra task regions are configured. Array element i is applied at task-relative region index i +1 (i.e. the slots following the stack guard). STK_MPU_STACK_GUARD is enabled; a no-op on platforms/builds without MPU stack-guard support. MpuRegionList instance referenced by the returned pointer must remain valid (e.g. a static const instance); a stack-local temporary is invalid once this function returns. Definition at line 801 of file stk_common.h.
|
inlinevirtual |
Get pointer to the stack memory.
Definition at line 756 of file stk_common.h.
|
pure virtualinherited |
Get pointer to the stack memory.
Implemented in FrtosTask, stk::StackMemoryWrapper< _StackSize >, stk::StackMemoryWrapper< STACK_SIZE_MIN >, stk::StackMemoryWrapper<((32U))>, stk::Task< _StackSize, _AccessMode >, stk::TaskW< _Weight, _StackSize, _AccessMode >, stk::time::TimerHost::TimerWorkerTask, StkThread, and TaskWrapper.
Referenced by stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::AllocateNewTask(), GetStackSpace(), stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsMemoryOfSP(), 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().
|
pure virtualinherited |
Get number of elements of the stack memory array.
Implemented in FrtosTask, stk::StackMemoryWrapper< _StackSize >, stk::StackMemoryWrapper< STACK_SIZE_MIN >, stk::StackMemoryWrapper<((32U))>, stk::Task< _StackSize, _AccessMode >, stk::TaskW< _Weight, _StackSize, _AccessMode >, stk::time::TimerHost::TimerWorkerTask, StkThread, and TaskWrapper.
Referenced by GetStackSpace(), and stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::IsMemoryOfSP().
|
inlinevirtualinherited |
Get available stack space.
Definition at line 418 of file stk_common.h.
References stk::ArrayView< T >::GetSize(), GetStack(), GetStackSize(), and STK_STACK_MEMORY_FILLER.
Referenced by FrtosTask::GetStackHighWaterMark(), and osThreadGetStackSpace().
|
inlinevirtual |
Get task trace name set by application.
NULL if unused. Reimplemented in FrtosTask, stk::time::TimerHost::TimerWorkerTask, StkThread, and TaskWrapper.
Definition at line 841 of file stk_common.h.
|
inlinevirtual |
Get static base weight of the task.
Reimplemented in FrtosTask, stk::TaskW< _Weight, _StackSize, _AccessMode >, stk::time::TimerHost::TimerWorkerTask, StkThread, and TaskWrapper.
Definition at line 834 of file stk_common.h.
References stk::DEFAULT_WEIGHT.
Referenced by stk::ISyncObject::FindWeightHigherThan().
|
inlinevirtual |
Called by the scheduler if deadline of the task is missed when Kernel is operating in Hard Real-Time mode (see stk::KERNEL_HRT).
| [in] | duration | Elapsed active time in ticks at the point the deadline was detected. Always greater than the task's configured deadline (ticks). |
Reimplemented in FrtosTask, stk::time::TimerHost::TimerWorkerTask, StkThread, and TaskWrapper.
Definition at line 817 of file stk_common.h.
References STK_UNUSED.
|
inlinevirtual |
Called by the kernel before removal from the scheduling (see stk::KERNEL_DYNAMIC).
Reimplemented in FrtosTask, stk::time::TimerHost::TimerWorkerTask, StkThread, and TaskWrapper.
Definition at line 827 of file stk_common.h.
|
pure virtual |
Entry point of the user task.
Kernel is configured as KERNEL_STATIC, the body must contain an infinite loop. Implemented in FrtosTask, stk::time::TimerHost::TimerWorkerTask, StkThread, and TaskWrapper.