|
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 | |
| PthreadTask () | |
| STK_VIRT_DTOR | ~PthreadTask ()=default |
| Destructor. | |
| void | Initialize (pthread_stk_ctrl_t *ctrl, stk_word_t *stack, size_t stack_size, EAccessMode mode) |
| EAccessMode | GetAccessMode () const override |
| Get pointer to the stack memory. | |
| int32_t | GetWeight () const override |
| Get static base weight of the task. | |
| const char * | GetTraceName () const override |
| Get task trace name set by application. | |
| const Word * | GetStack () const override |
| Get pointer to the stack memory. | |
| size_t | GetStackSize () const override |
| Get number of elements of the stack memory array. | |
| 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 Timeout | GetTimeSlice () const |
| Get time-slice quantum of the task (ticks). KERNEL_TIMESLICE only. | |
| virtual size_t | GetStackSpace () const |
| Get available stack space. | |
Private Member Functions | |
| STK_NONCOPYABLE_CLASS (PthreadTask) | |
| 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). | |
Private Attributes | |
| pthread_stk_ctrl_t * | m_ctrl |
| stk_word_t * | m_stack |
| size_t | m_stack_size |
| EAccessMode | m_mode |
Definition at line 70 of file stk_c_pthread.cpp.
|
inlineexplicit |
Definition at line 73 of file stk_c_pthread.cpp.
References stk::ACCESS_USER, m_ctrl, m_mode, m_stack, and m_stack_size.
Referenced by STK_NONCOPYABLE_CLASS().
|
default |
|
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 90 of file stk_c_pthread.cpp.
References m_mode.
|
inlineoverridevirtual |
Get pointer to the stack memory.
Implements stk::IStackMemory.
Definition at line 95 of file stk_c_pthread.cpp.
References m_stack.
|
inlineoverridevirtual |
Get number of elements of the stack memory array.
Implements stk::IStackMemory.
Definition at line 96 of file stk_c_pthread.cpp.
References m_stack_size.
|
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().
|
inlinevirtualinherited |
Get time-slice quantum of the task (ticks). KERNEL_TIMESLICE only.
Reimplemented in anonymous_namespace{threadx_stk.cpp}::StkThread, and anonymous_namespace{threadx_stk.cpp}::StkTimerThread.
Definition at line 937 of file stk_common.h.
References stk::NO_TIME_SLICE.
Referenced by stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::Bind().
|
inlineoverridevirtual |
Get task trace name set by application.
NULL if unused. Reimplemented from stk::ITask.
Definition at line 92 of file stk_c_pthread.cpp.
|
inlineoverridevirtual |
Get static base weight of the task.
Reimplemented from stk::ITask.
Definition at line 91 of file stk_c_pthread.cpp.
References stk::DEFAULT_WEIGHT.
|
inline |
Definition at line 81 of file stk_c_pthread.cpp.
References m_ctrl, m_mode, m_stack, and m_stack_size.
Referenced by pthread_create().
|
inlinevirtualinherited |
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 anonymous_namespace{threadx_stk.cpp}::StkThread, anonymous_namespace{threadx_stk.cpp}::StkTimerThread, FrtosTask, stk::time::TimerHost::TimerWorkerTask, and StkThread.
Definition at line 911 of file stk_common.h.
References STK_UNUSED.
|
overrideprivatevirtual |
Called by the kernel before removal from the scheduling (see stk::KERNEL_DYNAMIC).
Reimplemented from stk::ITask.
Definition at line 570 of file stk_c_pthread.cpp.
References m_ctrl.
|
overrideprivatevirtual |
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 545 of file stk_c_pthread.cpp.
References pthread_stk_ctrl_t::arg, pthread_stk_ctrl_t::done_event, pthread_stk_ctrl_t::finished, m_ctrl, stk::pthread::MaybeReap(), pthread_stk_ctrl_t::retval, stk::pthread::RunKeyDestructors(), stk::sync::Event::Set(), and pthread_stk_ctrl_t::start_routine.
|
private |
|
private |
Definition at line 104 of file stk_c_pthread.cpp.
Referenced by Initialize(), OnExit(), PthreadTask(), and Run().
|
private |
Definition at line 107 of file stk_c_pthread.cpp.
Referenced by GetAccessMode(), Initialize(), and PthreadTask().
|
private |
Definition at line 105 of file stk_c_pthread.cpp.
Referenced by GetStack(), Initialize(), and PthreadTask().
|
private |
Definition at line 106 of file stk_c_pthread.cpp.
Referenced by GetStackSize(), Initialize(), and PthreadTask().