RTEMS
Files | Classes | Macros | Functions
Deterministic Priority Scheduler

Deterministic Priority Scheduler. More...

Files

file  schedulerpriority.h
 Thread Manipulation with the Priority-Based Scheduler.
 
file  schedulerpriorityimpl.h
 Inlined Routines Associated with the Manipulation of the Priority-Based Scheduling Structures.
 

Classes

struct  Scheduler_priority_Context
 
struct  Scheduler_priority_Ready_queue
 Data for ready queue operations. More...
 
struct  Scheduler_priority_Node
 Scheduler node specialization for Deterministic Priority schedulers. More...
 

Macros

#define SCHEDULER_PRIORITY_ENTRY_POINTS
 

Functions

void _Scheduler_priority_Initialize (const Scheduler_Control *scheduler)
 Initializes the priority scheduler. More...
 
void _Scheduler_priority_Block (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
 Blocks the thread. More...
 
void _Scheduler_priority_Schedule (const Scheduler_Control *scheduler, Thread_Control *the_thread)
 Sets the heir thread to be the next ready thread. More...
 
void _Scheduler_priority_Unblock (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
 Unblocks the thread. More...
 
void _Scheduler_priority_Update_priority (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *base_node)
 Updates the priority of the node. More...
 
void _Scheduler_priority_Node_initialize (const Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority)
 Initializes the node with the given priority. More...
 
void _Scheduler_priority_Yield (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
 Performs the yield of a thread. More...
 
static __inline__ Scheduler_priority_Context_Scheduler_priority_Get_context (const Scheduler_Control *scheduler)
 Gets the context of the scheduler. More...
 
static __inline__ Scheduler_priority_Node_Scheduler_priority_Thread_get_node (Thread_Control *the_thread)
 Gets the scheduler node of the thread. More...
 
static __inline__ Scheduler_priority_Node_Scheduler_priority_Node_downcast (Scheduler_Node *node)
 Gets the priority node of the scheduler node. More...
 
static __inline__ void _Scheduler_priority_Ready_queue_initialize (Chain_Control *ready_queues, Priority_Control maximum_priority)
 Ready queue initialization. More...
 
static __inline__ void _Scheduler_priority_Ready_queue_enqueue (Chain_Node *node, Scheduler_priority_Ready_queue *ready_queue, Priority_bit_map_Control *bit_map)
 Enqueues a node on the specified ready queue. More...
 
static __inline__ void _Scheduler_priority_Ready_queue_enqueue_first (Chain_Node *node, Scheduler_priority_Ready_queue *ready_queue, Priority_bit_map_Control *bit_map)
 Enqueues a node on the specified ready queue as first. More...
 
static __inline__ void _Scheduler_priority_Ready_queue_extract (Chain_Node *node, Scheduler_priority_Ready_queue *ready_queue, Priority_bit_map_Control *bit_map)
 Extracts a node from the specified ready queue. More...
 
static __inline__ void _Scheduler_priority_Extract_body (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
 Extracts a node from the context of the scheduler. More...
 
static __inline__ Chain_Node_Scheduler_priority_Ready_queue_first (Priority_bit_map_Control *bit_map, Chain_Control *ready_queues)
 Returns a pointer to the first node. More...
 
static __inline__ void _Scheduler_priority_Schedule_body (const Scheduler_Control *scheduler, Thread_Control *the_thread, bool force_dispatch)
 Scheduling decision logic. More...
 
static __inline__ void _Scheduler_priority_Ready_queue_update (Scheduler_priority_Ready_queue *ready_queue, unsigned int new_priority, Priority_bit_map_Control *bit_map, Chain_Control *ready_queues)
 Updates the specified ready queue data according to the new priority value. More...
 

Detailed Description

Deterministic Priority Scheduler.

Macro Definition Documentation

◆ SCHEDULER_PRIORITY_ENTRY_POINTS

#define SCHEDULER_PRIORITY_ENTRY_POINTS
Value:
{ \
_Scheduler_priority_Initialize, /* initialize entry point */ \
_Scheduler_priority_Schedule, /* schedule entry point */ \
_Scheduler_priority_Yield, /* yield entry point */ \
_Scheduler_priority_Block, /* block entry point */ \
_Scheduler_priority_Unblock, /* unblock entry point */ \
_Scheduler_priority_Update_priority, /* update priority entry point */ \
_Scheduler_default_Map_priority, /* map priority entry point */ \
_Scheduler_default_Unmap_priority, /* unmap priority entry point */ \
_Scheduler_priority_Node_initialize, /* node initialize entry point */ \
_Scheduler_default_Node_destroy, /* node destroy entry point */ \
_Scheduler_default_Release_job, /* new period of task */ \
_Scheduler_default_Cancel_job, /* cancel period of task */ \
_Scheduler_default_Tick, /* tick entry point */ \
_Scheduler_default_Start_idle /* start idle entry point */ \
SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
}
void _Scheduler_priority_Node_initialize(const Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority)
Initializes the node with the given priority.

Entry points for the Deterministic Priority Based Scheduler.

Definition at line 45 of file schedulerpriority.h.

Function Documentation

◆ _Scheduler_priority_Block()

void _Scheduler_priority_Block ( const Scheduler_Control scheduler,
Thread_Control the_thread,
Scheduler_Node node 
)

Blocks the thread.

Parameters
schedulerThe scheduler instance.
[in,out]the_threadThe thread to block.
[in,out]nodeThe thread's scheduler node.

Definition at line 26 of file schedulerpriorityblock.c.

◆ _Scheduler_priority_Extract_body()

static __inline__ void _Scheduler_priority_Extract_body ( const Scheduler_Control scheduler,
Thread_Control the_thread,
Scheduler_Node node 
)
static

Extracts a node from the context of the scheduler.

Parameters
schedulerThe scheduler instance.
the_threadThe thread of which the node will be extracted.
[in,out]Thenode which preserves the ready queue.

Definition at line 175 of file schedulerpriorityimpl.h.

◆ _Scheduler_priority_Get_context()

static __inline__ Scheduler_priority_Context* _Scheduler_priority_Get_context ( const Scheduler_Control scheduler)
static

Gets the context of the scheduler.

Parameters
schedulerThe scheduler to get the context of.
Returns
The context of the scheduler.

Definition at line 49 of file schedulerpriorityimpl.h.

◆ _Scheduler_priority_Initialize()

void _Scheduler_priority_Initialize ( const Scheduler_Control scheduler)

Initializes the priority scheduler.

This routine initializes the priority scheduler.

Parameters
schedulerThe scheduler to initialize.

Definition at line 23 of file schedulerpriority.c.

◆ _Scheduler_priority_Node_downcast()

static __inline__ Scheduler_priority_Node* _Scheduler_priority_Node_downcast ( Scheduler_Node node)
static

Gets the priority node of the scheduler node.

Parameters
nodeThe node to get the priority node of.
Returns
The priority node.

Definition at line 75 of file schedulerpriorityimpl.h.

◆ _Scheduler_priority_Node_initialize()

void _Scheduler_priority_Node_initialize ( const Scheduler_Control scheduler,
Scheduler_Node node,
Thread_Control the_thread,
Priority_Control  priority 
)

Initializes the node with the given priority.

Parameters
schedulerThe scheduler instance.
[out]nodeThe node to initialize.
the_threadThe thread of the scheduler node.
priorityThe priority for the initialization.

Definition at line 35 of file schedulerpriority.c.

◆ _Scheduler_priority_Ready_queue_enqueue()

static __inline__ void _Scheduler_priority_Ready_queue_enqueue ( Chain_Node node,
Scheduler_priority_Ready_queue ready_queue,
Priority_bit_map_Control bit_map 
)
static

Enqueues a node on the specified ready queue.

The node is placed as the last element of its priority group.

Parameters
nodeThe node to enqueue.
[in,out]ready_queueThe ready queue.
[out]bit_mapThe priority bit map of the scheduler instance.

Definition at line 111 of file schedulerpriorityimpl.h.

◆ _Scheduler_priority_Ready_queue_enqueue_first()

static __inline__ void _Scheduler_priority_Ready_queue_enqueue_first ( Chain_Node node,
Scheduler_priority_Ready_queue ready_queue,
Priority_bit_map_Control bit_map 
)
static

Enqueues a node on the specified ready queue as first.

The node is placed as the first element of its priority group.

Parameters
nodeThe node to enqueue as first.
[in,out]ready_queueThe ready queue.
[out]bit_mapThe priority bit map of the scheduler instance.

Definition at line 132 of file schedulerpriorityimpl.h.

◆ _Scheduler_priority_Ready_queue_extract()

static __inline__ void _Scheduler_priority_Ready_queue_extract ( Chain_Node node,
Scheduler_priority_Ready_queue ready_queue,
Priority_bit_map_Control bit_map 
)
static

Extracts a node from the specified ready queue.

Parameters
nodeThe node to extract.
[in,out]ready_queueThe ready queue.
[out]bit_mapThe priority bit map of the scheduler instance.

Definition at line 151 of file schedulerpriorityimpl.h.

◆ _Scheduler_priority_Ready_queue_first()

static __inline__ Chain_Node* _Scheduler_priority_Ready_queue_first ( Priority_bit_map_Control bit_map,
Chain_Control ready_queues 
)
static

Returns a pointer to the first node.

This routines returns a pointer to the first node on ready_queues.

Parameters
bit_mapThe priority bit map of the scheduler instance.
ready_queuesThe ready queues of the scheduler instance.
Returns
This method returns the first node.

Definition at line 204 of file schedulerpriorityimpl.h.

◆ _Scheduler_priority_Ready_queue_initialize()

static __inline__ void _Scheduler_priority_Ready_queue_initialize ( Chain_Control ready_queues,
Priority_Control  maximum_priority 
)
static

Ready queue initialization.

This routine initializes ready_queues for priority-based scheduling.

Parameters
[out]ready_queuesThe ready queue to initialize.
maximum_priorityThe maximum priority in the ready queue.

Definition at line 90 of file schedulerpriorityimpl.h.

◆ _Scheduler_priority_Ready_queue_update()

static __inline__ void _Scheduler_priority_Ready_queue_update ( Scheduler_priority_Ready_queue ready_queue,
unsigned int  new_priority,
Priority_bit_map_Control bit_map,
Chain_Control ready_queues 
)
static

Updates the specified ready queue data according to the new priority value.

Parameters
[in,out]ready_queueThe ready queue.
new_priorityThe new priority.
bit_mapThe priority bit map of the scheduler instance.
ready_queuesThe ready queues of the scheduler instance.

Definition at line 256 of file schedulerpriorityimpl.h.

◆ _Scheduler_priority_Schedule()

void _Scheduler_priority_Schedule ( const Scheduler_Control scheduler,
Thread_Control the_thread 
)

Sets the heir thread to be the next ready thread.

This kernel routine sets the heir thread to be the next ready thread by invoking the_scheduler->ready_queue->operations->first().

Parameters
schedulerThe scheduler instance.
the_threadThe thread for the operation.

Definition at line 24 of file schedulerpriorityschedule.c.

◆ _Scheduler_priority_Schedule_body()

static __inline__ void _Scheduler_priority_Schedule_body ( const Scheduler_Control scheduler,
Thread_Control the_thread,
bool  force_dispatch 
)
static

Scheduling decision logic.

This kernel routine implements scheduling decision logic for priority-based scheduling.

Parameters
[in,out]schedulerThe scheduler instance.
the_threadThis parameter is unused.
force_dispatchIndicates whether the dispatch happens also if the currently executing thread is set as not preemptible.

Definition at line 228 of file schedulerpriorityimpl.h.

◆ _Scheduler_priority_Thread_get_node()

static __inline__ Scheduler_priority_Node* _Scheduler_priority_Thread_get_node ( Thread_Control the_thread)
static

Gets the scheduler node of the thread.

Parameters
the_threadThe thread to get the scheduler node of.
Returns
The scheduler node of the_thread.

Definition at line 61 of file schedulerpriorityimpl.h.

◆ _Scheduler_priority_Unblock()

void _Scheduler_priority_Unblock ( const Scheduler_Control scheduler,
Thread_Control the_thread,
Scheduler_Node node 
)

Unblocks the thread.

Parameters
schedulerThe scheduler instance.
[in,out]the_threadThe thread to unblock.
[in,out]nodeThe thread's scheduler node.

Definition at line 25 of file schedulerpriorityunblock.c.

◆ _Scheduler_priority_Update_priority()

void _Scheduler_priority_Update_priority ( const Scheduler_Control scheduler,
Thread_Control the_thread,
Scheduler_Node base_node 
)

Updates the priority of the node.

Parameters
schedulerThe scheduler instance.
the_threadThe thread for the operation.
base_nodeThe thread's scheduler node.

Definition at line 24 of file schedulerprioritychangepriority.c.

◆ _Scheduler_priority_Yield()

void _Scheduler_priority_Yield ( const Scheduler_Control scheduler,
Thread_Control the_thread,
Scheduler_Node node 
)

Performs the yield of a thread.

Parameters
schedulerThe scheduler instance.
[in,out]the_threadThe thread that performed the yield operation.
nodeThe scheduler node of the_thread.

Definition at line 24 of file schedulerpriorityyield.c.