RTEMS
5.1
|
EDF Scheduler. More...
Files | |
file | scheduleredf.h |
Data Related to the Manipulation of Threads for the EDF Scheduler. | |
file | scheduleredfimpl.h |
EDF Scheduler Implementation. | |
Data Structures | |
struct | Scheduler_EDF_Context |
struct | Scheduler_EDF_Node |
Scheduler node specialization for EDF schedulers. More... | |
Macros | |
#define | SCHEDULER_EDF_MAXIMUM_PRIORITY INT_MAX |
#define | SCHEDULER_EDF_ENTRY_POINTS |
#define | SCHEDULER_EDF_PRIO_MSB 0x8000000000000000 |
Functions | |
void | _Scheduler_EDF_Initialize (const Scheduler_Control *scheduler) |
Initializes EDF scheduler. More... | |
void | _Scheduler_EDF_Block (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node) |
Removes the blocking thread from the ready queue and schedules is only again if the thread is executing or the heir thread. More... | |
void | _Scheduler_EDF_Schedule (const Scheduler_Control *scheduler, Thread_Control *the_thread) |
Sets the heir thread to be the next ready thread in the rbtree ready queue. More... | |
void | _Scheduler_EDF_Node_initialize (const Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority) |
Initializes an EDF specific scheduler node of the_thread. More... | |
void | _Scheduler_EDF_Unblock (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node) |
Performs an unblocking of the thread. More... | |
void | _Scheduler_EDF_Update_priority (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node) |
Updates the priority of the scheduler node. More... | |
Priority_Control | _Scheduler_EDF_Map_priority (const Scheduler_Control *scheduler, Priority_Control priority) |
Gets the mapped priority map of the priority control. More... | |
Priority_Control | _Scheduler_EDF_Unmap_priority (const Scheduler_Control *scheduler, Priority_Control priority) |
Gets the unmapped priority map of the priority control. More... | |
void | _Scheduler_EDF_Yield (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node) |
Executes a thread yield for the thread. More... | |
void | _Scheduler_EDF_Release_job (const Scheduler_Control *scheduler, Thread_Control *the_thread, Priority_Node *priority_node, uint64_t deadline, Thread_queue_Context *queue_context) |
Releases a EDF job. More... | |
void | _Scheduler_EDF_Cancel_job (const Scheduler_Control *scheduler, Thread_Control *the_thread, Priority_Node *priority_node, Thread_queue_Context *queue_context) |
Cancels a job and removes the thread from the queue context. More... | |
RTEMS_INLINE_ROUTINE Scheduler_EDF_Context * | _Scheduler_EDF_Get_context (const Scheduler_Control *scheduler) |
Gets the context of the scheduler. More... | |
RTEMS_INLINE_ROUTINE Scheduler_EDF_Node * | _Scheduler_EDF_Thread_get_node (Thread_Control *the_thread) |
Gets the scheduler EDF node of the thread. More... | |
RTEMS_INLINE_ROUTINE Scheduler_EDF_Node * | _Scheduler_EDF_Node_downcast (Scheduler_Node *node) |
Returns the scheduler EDF node for the scheduler node. More... | |
RTEMS_INLINE_ROUTINE bool | _Scheduler_EDF_Less (const void *left, const RBTree_Node *right) |
Checks if left is less than the priority of the node right. More... | |
RTEMS_INLINE_ROUTINE bool | _Scheduler_EDF_Priority_less_equal (const void *left, const RBTree_Node *right) |
Checks if left is less or equal than the priority of the node right. More... | |
RTEMS_INLINE_ROUTINE void | _Scheduler_EDF_Enqueue (Scheduler_EDF_Context *context, Scheduler_EDF_Node *node, Priority_Control insert_priority) |
Inserts the scheduler node with the given priority in the ready queue of the context. More... | |
RTEMS_INLINE_ROUTINE void | _Scheduler_EDF_Extract (Scheduler_EDF_Context *context, Scheduler_EDF_Node *node) |
Extracts the scheduler node from the ready queue of the context. More... | |
RTEMS_INLINE_ROUTINE void | _Scheduler_EDF_Extract_body (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node) |
Extracts the node from the context of the given scheduler. More... | |
RTEMS_INLINE_ROUTINE void | _Scheduler_EDF_Schedule_body (const Scheduler_Control *scheduler, Thread_Control *the_thread, bool force_dispatch) |
Schedules the next ready thread as the heir. More... | |
EDF Scheduler.
#define SCHEDULER_EDF_ENTRY_POINTS |
Entry points for the Earliest Deadline First Scheduler.
#define SCHEDULER_EDF_PRIO_MSB 0x8000000000000000 |
This is just a most significant bit of Priority_Control type. It distinguishes threads which are deadline driven (priority represented by a lower number than SCHEDULER_EDF_PRIO_MSB) from those ones who do not have any deadlines and thus are considered background tasks.
void _Scheduler_EDF_Block | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Removes the blocking thread from the ready queue and schedules is only again if the thread is executing or the heir thread.
[in,out] | scheduler | The scheduler for the operation. |
the_thread | The thread to operate upon. | |
[in,out] | node | The scheduler node for this thread. |
void _Scheduler_EDF_Cancel_job | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Priority_Node * | priority_node, | ||
Thread_queue_Context * | queue_context | ||
) |
Cancels a job and removes the thread from the queue context.
scheduler | The scheduler instance. | |
the_thread | The thread for the operation. | |
[in,out] | priority_node | The corresponding priority node. |
[in,out] | queue_context | The thread queue context. |
RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Enqueue | ( | Scheduler_EDF_Context * | context, |
Scheduler_EDF_Node * | node, | ||
Priority_Control | insert_priority | ||
) |
Inserts the scheduler node with the given priority in the ready queue of the context.
[in,out] | context | The context to insert the node in. |
node | The node to be inserted. | |
insert_priority | The priority with which the node will be inserted. |
RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Extract | ( | Scheduler_EDF_Context * | context, |
Scheduler_EDF_Node * | node | ||
) |
Extracts the scheduler node from the ready queue of the context.
[in,out] | context | The context to extract the node from. |
[in,out] | node | The node to extract. |
RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Extract_body | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Extracts the node from the context of the given scheduler.
scheduler | The scheduler instance. | |
the_thread | The thread is not used in this method. | |
[in,out] | node | The node to be extracted. |
RTEMS_INLINE_ROUTINE Scheduler_EDF_Context* _Scheduler_EDF_Get_context | ( | const Scheduler_Control * | scheduler | ) |
Gets the context of the scheduler.
scheduler | The scheduler instance. |
void _Scheduler_EDF_Initialize | ( | const Scheduler_Control * | scheduler | ) |
Initializes EDF scheduler.
This routine initializes the EDF scheduler.
[in,out] | scheduler | The scheduler instance. |
RTEMS_INLINE_ROUTINE bool _Scheduler_EDF_Less | ( | const void * | left, |
const RBTree_Node * | right | ||
) |
Checks if left is less than the priority of the node right.
left | The priority on the left hand side of the comparison. |
right | The node of which the priority is compared to left. |
true | left is less than the priority of right. |
false | left is greater or equal than the priority of right. |
Priority_Control _Scheduler_EDF_Map_priority | ( | const Scheduler_Control * | scheduler, |
Priority_Control | priority | ||
) |
Gets the mapped priority map of the priority control.
scheduler | Not used in this operation. |
priority | The priority control to get the priority map of. |
RTEMS_INLINE_ROUTINE Scheduler_EDF_Node* _Scheduler_EDF_Node_downcast | ( | Scheduler_Node * | node | ) |
Returns the scheduler EDF node for the scheduler node.
node | The scheduler node of which the scheduler EDF node is returned. |
void _Scheduler_EDF_Node_initialize | ( | const Scheduler_Control * | scheduler, |
Scheduler_Node * | node, | ||
Thread_Control * | the_thread, | ||
Priority_Control | priority | ||
) |
Initializes an EDF specific scheduler node of the_thread.
scheduler | The scheduler instance. |
node | The node being initialized. |
the_thread | The thread of the node. |
priority | The thread priority. |
RTEMS_INLINE_ROUTINE bool _Scheduler_EDF_Priority_less_equal | ( | const void * | left, |
const RBTree_Node * | right | ||
) |
Checks if left is less or equal than the priority of the node right.
left | The priority on the left hand side of the comparison. |
right | The node of which the priority is compared to left. |
true | left is less or equal than the priority of right. |
false | left is greater than the priority of right. |
void _Scheduler_EDF_Release_job | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Priority_Node * | priority_node, | ||
uint64_t | deadline, | ||
Thread_queue_Context * | queue_context | ||
) |
Releases a EDF job.
scheduler | The scheduler instance | |
the_thread | The thread | |
[in,out] | priority_node | The priority node for the operation. |
deadline | The deadline for the job. | |
[in,out] | queue_context | The thread queue context. |
void _Scheduler_EDF_Schedule | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread | ||
) |
Sets the heir thread to be the next ready thread in the rbtree ready queue.
This kernel routine sets the heir thread to be the next ready thread in the rbtree ready queue.
[in,out] | scheduler | The scheduler instance. |
the_thread | The thread being scheduled. |
RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Schedule_body | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
bool | force_dispatch | ||
) |
Schedules the next ready thread as the heir.
scheduler | The scheduler instance to schedule the minimum of the context of. |
the_thread | This parameter is not used. |
force_dispatch | Indicates whether the current heir is blocked even if it is not set as preemptible. |
RTEMS_INLINE_ROUTINE Scheduler_EDF_Node* _Scheduler_EDF_Thread_get_node | ( | Thread_Control * | the_thread | ) |
Gets the scheduler EDF node of the thread.
the_thread | The thread to get the scheduler node of. |
void _Scheduler_EDF_Unblock | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Performs an unblocking of the thread.
[in,out] | scheduler | The scheduler instance. |
the_thread | The unblocking thread. May be set as new heir. | |
[in,out] | node | The scheduler node for the thread. |
Priority_Control _Scheduler_EDF_Unmap_priority | ( | const Scheduler_Control * | scheduler, |
Priority_Control | priority | ||
) |
Gets the unmapped priority map of the priority control.
scheduler | Not used in this operation. |
priority | The priority control to get the priority map of. |
void _Scheduler_EDF_Update_priority | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Updates the priority of the scheduler node.
scheduler | The scheduler instance. | |
the_thread | The thread for the operation. | |
[in,out] | node | The priority node to update the priority of. |
void _Scheduler_EDF_Yield | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Executes a thread yield for the thread.
[in,out] | scheduler | The scheduler instance. |
the_thread | The thread that performs the yield. | |
[in,out] | node | The scheduler node for this thread. |