10#ifndef STK_STRATEGY_EDF_H_
11#define STK_STRATEGY_EDF_H_
147 while ((itr = (*itr->
GetNext())) != start);
Contains interface definitions of the library.
#define STK_ASSERT(e)
Runtime assertion. Halts execution if the expression e evaluates to false.
Namespace of STK package.
Scheduling-strategy-facing interface for a kernel task slot.
virtual Timeout GetHrtRelativeDeadline() const =0
Get HRT task's relative deadline.
DLHeadType ListHeadType
List head type for IKernelTask elements.
virtual bool IsSleeping() const =0
Check whether the task is currently sleeping.
Interface for a task switching strategy implementation.
DLHeadType * GetHead() const
Get the list head this entry currently belongs to.
DLEntryType * GetNext() const
Get the next entry in the list.
SwitchStrategyEDF()
Construct an empty strategy with no tasks.
bool OnTaskDeadlineMissed(IKernelTask *)
Not supported, asserts unconditionally.
size_t GetSize() const
Get total number of tasks managed by this strategy.
void OnTaskSleep(IKernelTask *task)
Notification that a task has entered the sleeping state.
~SwitchStrategyEDF()
Destructor.
IKernelTask * GetFirst() const
Get first task in the managed set (used by the kernel for initial scheduling).
IKernelTask * GetNext()
Select and return the task with the earliest (minimum) relative deadline.
IKernelTask::ListHeadType m_sleep
Sleeping (blocked) tasks not eligible for scheduling. Deadline tracking continues in the kernel while...
STK_NONCOPYABLE_CLASS(SwitchStrategyEDF)
EConfig
Compile-time capability flags reported to the kernel.
@ DEADLINE_MISSED_API
This strategy does not use OnTaskDeadlineMissed() events.
@ SLEEP_EVENT_API
This strategy requires OnTaskSleep() / OnTaskWake() events to move tasks between the runnable and sle...
@ WEIGHT_API
This strategy does not use per-task weights. Deadline tracking is handled by the kernel in KERNEL_HRT...
void OnTaskWake(IKernelTask *task)
Notification that a task has become runnable again.
void AddTask(IKernelTask *task)
Add task to the runnable set.
IKernelTask::ListHeadType m_tasks
Runnable tasks eligible for scheduling. Scanned in full by GetNext() each tick to find the minimum re...
void RemoveTask(IKernelTask *task)
Remove task from whichever list it currently occupies.