|
SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Public Member Functions | |
| StkThread (TX_THREAD *tx) | |
| virtual | ~StkThread () |
| void | Run () override |
| Entry point of the user task. | |
| void | OnExit () override |
| Called by the kernel before removal from the scheduling (see stk::KERNEL_DYNAMIC). | |
| const stk::Word * | GetStack () const override |
| Get pointer to the stack memory. | |
| size_t | GetStackSize () const override |
| Get number of elements of the stack memory array. | |
| stk::EAccessMode | GetAccessMode () const override |
| Get pointer to the stack memory. | |
| void | OnDeadlineMissed (uint32_t) override |
| Called by the scheduler if deadline of the task is missed when Kernel is operating in Hard Real-Time mode (see stk::KERNEL_HRT). | |
| stk::Weight | GetWeight () const override |
| Get static base weight of the task. | |
| const char * | GetTraceName () const override |
| Get task trace name set by application. | |
| stk::Timeout | GetTimeSlice () const override |
| Get time-slice quantum of the task (ticks). KERNEL_TIMESLICE only. | |
| virtual size_t | GetStackSpace () const |
| Get available stack space. | |
Public Attributes | |
| TX_THREAD * | m_tx |
| volatile stk::Weight | m_weight |
| stk::Timeout | m_time_slice |
| volatile bool | m_registered |
| volatile bool | m_removed |
| volatile UINT | m_wait_kind |
| volatile bool | m_abort |
Private Member Functions | |
| STK_NONCOPYABLE_CLASS (StkThread) | |
Definition at line 142 of file threadx_stk.cpp.
|
inlineexplicit |
Definition at line 147 of file threadx_stk.cpp.
References m_abort, m_registered, m_removed, m_time_slice, m_tx, m_wait_kind, m_weight, anonymous_namespace{threadx_stk.cpp}::ToStkWeight(), and TX_READY.
Referenced by STK_NONCOPYABLE_CLASS().
|
inlinevirtual |
Definition at line 153 of file threadx_stk.cpp.
|
inlineoverridevirtual |
Get pointer to the stack memory.
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, 4, 6, 8, 12 or 16, 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. Get hardware access mode of the user task.
Implements stk::ITask.
Definition at line 193 of file threadx_stk.cpp.
References stk::ACCESS_PRIVILEGED.
|
inlineoverridevirtual |
Get pointer to the stack memory.
Implements stk::IStackMemory.
Definition at line 189 of file threadx_stk.cpp.
References m_tx.
|
inlineoverridevirtual |
Get number of elements of the stack memory array.
Implements stk::IStackMemory.
Definition at line 190 of file threadx_stk.cpp.
References m_tx.
|
inlinevirtualinherited |
Get available stack space.
Definition at line 465 of file stk_common.h.
References stk::ArrayView< T >::GetSize(), GetStack(), GetStackSize(), and STK_STACK_MEMORY_FILLER.
Referenced by FrtosTask::GetStackHighWaterMark(), and osThreadGetStackSpace().
|
inlineoverridevirtual |
Get time-slice quantum of the task (ticks). KERNEL_TIMESLICE only.
Reimplemented from stk::ITask.
Definition at line 197 of file threadx_stk.cpp.
References m_time_slice.
|
inlineoverridevirtual |
Get task trace name set by application.
NULL if unused. Reimplemented from stk::ITask.
Definition at line 196 of file threadx_stk.cpp.
References m_tx.
|
inlineoverridevirtual |
Get static base weight of the task.
Reimplemented from stk::ITask.
Definition at line 195 of file threadx_stk.cpp.
References m_weight.
|
inlineoverridevirtual |
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 from stk::ITask.
Definition at line 194 of file threadx_stk.cpp.
|
inlineoverridevirtual |
Called by the kernel before removal from the scheduling (see stk::KERNEL_DYNAMIC).
Reimplemented from stk::ITask.
Definition at line 182 of file threadx_stk.cpp.
References m_registered, and m_removed.
|
inlineoverridevirtual |
Entry point of the user task.
Kernel is configured as KERNEL_STATIC, the body must contain an infinite loop. Implements stk::ITask.
Definition at line 156 of file threadx_stk.cpp.
References m_tx, TX_COMPLETED, TX_TERMINATED, TX_THREAD_ENTRY, TX_THREAD_STRUCT::tx_thread_entry, TX_THREAD_STRUCT::tx_thread_entry_exit_notify, TX_THREAD_STRUCT::tx_thread_entry_parameter, TX_THREAD_EXIT, TX_THREAD_STRUCT::tx_thread_run_count, and TX_THREAD_STRUCT::tx_thread_state.
|
private |
| volatile bool anonymous_namespace{threadx_stk.cpp}::StkThread::m_abort |
Definition at line 206 of file threadx_stk.cpp.
Referenced by StkThread().
| volatile bool anonymous_namespace{threadx_stk.cpp}::StkThread::m_registered |
Definition at line 203 of file threadx_stk.cpp.
Referenced by OnExit(), anonymous_namespace{threadx_stk.cpp}::RegisterThread(), StkThread(), and anonymous_namespace{threadx_stk.cpp}::ThreadStateOf().
| volatile bool anonymous_namespace{threadx_stk.cpp}::StkThread::m_removed |
Definition at line 204 of file threadx_stk.cpp.
Referenced by OnExit(), anonymous_namespace{threadx_stk.cpp}::RegisterThread(), StkThread(), anonymous_namespace{threadx_stk.cpp}::ThreadStateOf(), and anonymous_namespace{threadx_stk.cpp}::WaitThreadRemoved().
| stk::Timeout anonymous_namespace{threadx_stk.cpp}::StkThread::m_time_slice |
Definition at line 202 of file threadx_stk.cpp.
Referenced by GetTimeSlice(), and StkThread().
| TX_THREAD* anonymous_namespace{threadx_stk.cpp}::StkThread::m_tx |
Definition at line 200 of file threadx_stk.cpp.
Referenced by GetStack(), GetStackSize(), GetTraceName(), anonymous_namespace{threadx_stk.cpp}::RegisterThread(), Run(), and StkThread().
| volatile UINT anonymous_namespace{threadx_stk.cpp}::StkThread::m_wait_kind |
Definition at line 205 of file threadx_stk.cpp.
Referenced by StkThread(), and anonymous_namespace{threadx_stk.cpp}::ThreadStateOf().
| volatile stk::Weight anonymous_namespace{threadx_stk.cpp}::StkThread::m_weight |
Definition at line 201 of file threadx_stk.cpp.
Referenced by GetWeight(), and StkThread().