|
SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Scheduling-strategy-facing interface for a kernel task slot. More...
#include <stk_common.h>
Public Types | |
| typedef DLHeadType | ListHeadType |
| List head type for IKernelTask elements. | |
| typedef DLEntryType | ListEntryType |
| List entry type of IKernelTask elements. | |
| enum | |
| A tag for type-safe casts done by CastListEntryToParent. More... | |
| typedef DListEntry< IKernelTask, TClosedLoop > | DLEntryType |
| Convenience alias for this entry type. Used to avoid repeating the full template spelling. | |
| typedef DListHead< IKernelTask, TClosedLoop > | DLHeadType |
| Convenience alias for the corresponding list head type. | |
Public Member Functions | |
| virtual ITask * | GetUserTask ()=0 |
| Get user task. | |
| virtual Stack | GetUserStack () const =0 |
| Get user task's Stack info. | |
| virtual Weight | GetWeight () const =0 |
| Get the effective weight of the task. | |
| virtual Weight | GetBaseWeight () const =0 |
| Get the base (configured) weight of the task, ignoring any priority-inheritance boost. | |
| virtual void | SetCurrentWeight (Weight weight)=0 |
| Set the current dynamic weight value used by the scheduling strategy. | |
| virtual Weight | GetCurrentWeight () const =0 |
| Get the current dynamic weight value of this task. | |
| virtual Timeout | GetHrtPeriodicity () const =0 |
| Get HRT task execution periodicity. | |
| virtual Timeout | GetHrtDeadline () const =0 |
| Get HRT task deadline (max allowed task execution time). | |
| virtual Timeout | GetHrtRelativeDeadline () const =0 |
| Get HRT task's remaining deadline. | |
| virtual bool | IsSleeping () const =0 |
| Check whether the task is currently sleeping. | |
| virtual void | Wake ()=0 |
| Wake a sleeping task on the next scheduling tick. | |
| DLHeadType * | GetHead () |
| Get the list head this entry currently belongs to. | |
| DLEntryType * | GetNext () |
| Get the next entry in the list. | |
| DLEntryType * | GetPrev () |
| Get the previous entry in the list. | |
| bool | IsLinked () const |
| Check whether this entry is currently a member of any list. | |
| operator IKernelTask * () | |
| Implicit conversion to a mutable pointer to the host object (T). | |
| operator const IKernelTask * () const | |
| Implicit conversion to a const pointer to the host object (T). | |
Protected Member Functions | |
| ~IKernelTask ()=default | |
| Destructor. | |
Private Member Functions | |
| void | Link (DLHeadType *head, DLEntryType *next, DLEntryType *prev) |
| Wire this entry into a list between prev and next. | |
| void | Unlink () |
| Remove this entry from its current list. | |
Private Attributes | |
| DLHeadType * | m_head |
Owning list head, or NULL when the entry is not linked. | |
| DLEntryType * | m_next |
Next entry in the list, or NULL (open list boundary) / first entry (closed loop). | |
| DLEntryType * | m_prev |
Previous entry in the list, or NULL (open list boundary) / last entry (closed loop). | |
Scheduling-strategy-facing interface for a kernel task slot.
Wraps a user ITask and exposes the metadata that task-switching strategy implementations (ITaskSwitchStrategy) need to make scheduling decisions: sleep state (IsSleeping, Wake), HRT timing (GetHrtPeriodicity, GetHrtDeadline, GetHrtRelativeDeadline), and weighted-round-robin support (GetWeight, GetCurrentWeight, SetCurrentWeight).
Definition at line 1031 of file stk_common.h.
|
inherited |
Convenience alias for this entry type. Used to avoid repeating the full template spelling.
Definition at line 75 of file stk_linked_list.h.
|
inherited |
Convenience alias for the corresponding list head type.
Definition at line 80 of file stk_linked_list.h.
List entry type of IKernelTask elements.
Definition at line 1042 of file stk_common.h.
List head type for IKernelTask elements.
Definition at line 1037 of file stk_common.h.
|
inherited |
A tag for type-safe casts done by CastListEntryToParent.
Definition at line 70 of file stk_linked_list.h.
|
protecteddefault |
Destructor.
|
pure virtual |
Get the base (configured) weight of the task, ignoring any priority-inheritance boost.
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask.
Referenced by stk::sched::SwitchStrategyPreemptionThreshold< 32 >::GetRawThreshold().
|
pure virtual |
Get the current dynamic weight value of this task.
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask.
Referenced by stk::sched::SwitchStrategySmoothWeightedRoundRobinT< false >::GetNext().
|
inlineinherited |
Get the list head this entry currently belongs to.
NULL if the entry is not linked. Definition at line 85 of file stk_linked_list.h.
|
pure virtual |
Get HRT task deadline (max allowed task execution time).
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask.
Referenced by stk::sched::SwitchStrategyMonotonic< MSS_TYPE_RATE >::AddTask(), and stk::sched::SchedulabilityCheck::IsSchedulableWCRT().
|
pure virtual |
Get HRT task execution periodicity.
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask.
Referenced by stk::sched::SwitchStrategyMonotonic< MSS_TYPE_RATE >::AddTask(), and stk::sched::SchedulabilityCheck::IsSchedulableWCRT().
|
pure virtual |
Get HRT task's remaining deadline.
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask.
Referenced by stk::sched::SwitchStrategyEDF::GetNext().
|
inlineinherited |
Get the next entry in the list.
NULL for the last entry; in a closed loop the last entry wraps to the first one, so the result is never NULL for a linked entry. Definition at line 96 of file stk_linked_list.h.
|
inlineinherited |
Get the previous entry in the list.
NULL for the first entry; in a closed loop the first entry wraps to the last one, so the result is never NULL for a linked entry. Definition at line 106 of file stk_linked_list.h.
|
pure virtual |
Get user task's Stack info.
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask.
|
pure virtual |
Get user task.
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask.
|
pure virtual |
Get the effective weight of the task.
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask.
Referenced by stk::sched::SwitchStrategySmoothWeightedRoundRobinT< false >::AddActive(), stk::sched::SwitchStrategyFixedPriority< 32 >::AddTask(), stk::sched::SwitchStrategySmoothWeightedRoundRobinT< false >::AddTask(), stk::sched::SwitchStrategySmoothWeightedRoundRobinT< false >::GetNext(), stk::sched::SwitchStrategyFixedPriority< 32 >::GetTaskPriority(), stk::sched::SwitchStrategyPreemptionThreshold< 32 >::GetTaskPriority(), stk::sched::SwitchStrategyFixedPriority< 32 >::OnTaskWeightChange(), and stk::sched::SwitchStrategySmoothWeightedRoundRobinT< false >::RemoveActive().
|
inlineinherited |
Check whether this entry is currently a member of any list.
true if linked (m_head != NULL); false otherwise. Definition at line 115 of file stk_linked_list.h.
|
pure virtual |
Check whether the task is currently sleeping.
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask.
Referenced by stk::sched::SwitchStrategyMonotonic< MSS_TYPE_RATE >::GetNext(), stk::sched::SwitchStrategyEDF::OnTaskSleep(), stk::sched::SwitchStrategyFixedPriority< 32 >::OnTaskSleep(), stk::sched::SwitchStrategyPreemptionThreshold< 32 >::OnTaskSleep(), stk::sched::SwitchStrategyRoundRobinT< false >::OnTaskSleep(), stk::sched::SwitchStrategySmoothWeightedRoundRobinT< false >::OnTaskSleep(), stk::sched::SwitchStrategyEDF::OnTaskWake(), stk::sched::SwitchStrategyFixedPriority< 32 >::OnTaskWake(), stk::sched::SwitchStrategyPreemptionThreshold< 32 >::OnTaskWake(), stk::sched::SwitchStrategyRoundRobinT< false >::OnTaskWake(), and stk::sched::SwitchStrategySmoothWeightedRoundRobinT< false >::OnTaskWake().
|
inlineprivateinherited |
Wire this entry into a list between prev and next.
| [in] | head | The owning DListHead. Stored as a back-pointer for IsLinked() and ownership checks. |
| [in] | next | The entry that will follow this one, or NULL if this becomes the last entry. |
| [in] | prev | The entry that will precede this one, or NULL if this becomes the first entry. |
Definition at line 150 of file stk_linked_list.h.
|
inlineinherited |
Implicit conversion to a const pointer to the host object (T).
Definition at line 129 of file stk_linked_list.h.
|
inlineinherited |
Implicit conversion to a mutable pointer to the host object (T).
Definition at line 122 of file stk_linked_list.h.
|
pure virtual |
Set the current dynamic weight value used by the scheduling strategy.
| [in] | weight | New current dynamic weight value. |
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask.
Referenced by stk::sched::SwitchStrategySmoothWeightedRoundRobinT< false >::AddTask(), stk::sched::SwitchStrategySmoothWeightedRoundRobinT< false >::GetNext(), and stk::sched::SwitchStrategySmoothWeightedRoundRobinT< false >::OnTaskWake().
|
inlineprivateinherited |
Remove this entry from its current list.
Definition at line 174 of file stk_linked_list.h.
|
pure virtual |
Wake a sleeping task on the next scheduling tick.
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask.
|
privateinherited |
Owning list head, or NULL when the entry is not linked.
Definition at line 191 of file stk_linked_list.h.
|
privateinherited |
Next entry in the list, or NULL (open list boundary) / first entry (closed loop).
Definition at line 192 of file stk_linked_list.h.
|
privateinherited |
Previous entry in the list, or NULL (open list boundary) / last entry (closed loop).
Definition at line 193 of file stk_linked_list.h.