RTEMS
Files | Classes | Macros | Functions
Simple Priority Scheduler

Simple Priority Scheduler. More...

Files

file  schedulersimple.h
 Manipulation of Threads Simple-Priority-Based Ready Queue.
 
file  schedulersimpleimpl.h
 Inlined Routines Associated with the Manipulation of the Priority-Based Scheduling Structures.
 

Classes

struct  Scheduler_simple_Context
 Simple scheduler context. More...
 

Macros

#define SCHEDULER_SIMPLE_MAXIMUM_PRIORITY   255
 
#define SCHEDULER_SIMPLE_ENTRY_POINTS
 

Functions

void _Scheduler_simple_Initialize (const Scheduler_Control *scheduler)
 Initializes simple scheduler. More...
 
void _Scheduler_simple_Schedule (const Scheduler_Control *scheduler, Thread_Control *the_thread)
 Schedules threads. More...
 
void _Scheduler_simple_Yield (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
 Performs the yield of a thread. More...
 
void _Scheduler_simple_Block (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
 Blocks the thread. More...
 
void _Scheduler_simple_Unblock (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
 Unblocks the thread. More...
 
void _Scheduler_simple_Update_priority (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
 Updates the priority of the node. More...
 
static __inline__ Scheduler_simple_Context_Scheduler_simple_Get_context (const Scheduler_Control *scheduler)
 Gets context of the scheduler. More...
 
static __inline__ bool _Scheduler_simple_Priority_less_equal (const void *to_insert, const Chain_Node *next)
 Checks if the priority is less or equal than the priority of the node. More...
 
static __inline__ void _Scheduler_simple_Insert (Chain_Control *chain, Thread_Control *to_insert, unsigned int insert_priority)
 Inserts the thread control with the given priority into the chain. More...
 
static __inline__ void _Scheduler_simple_Extract (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
 Extracts the threads node. More...
 
static __inline__ void _Scheduler_simple_Schedule_body (const Scheduler_Control *scheduler, Thread_Control *the_thread, bool force_dispatch)
 Scheduling decision logic. More...
 

Detailed Description

Simple Priority Scheduler.

Macro Definition Documentation

◆ SCHEDULER_SIMPLE_ENTRY_POINTS

#define SCHEDULER_SIMPLE_ENTRY_POINTS
Value:
{ \
_Scheduler_simple_Initialize, /* initialize entry point */ \
_Scheduler_simple_Schedule, /* schedule entry point */ \
_Scheduler_simple_Yield, /* yield entry point */ \
_Scheduler_simple_Block, /* block entry point */ \
_Scheduler_simple_Unblock, /* unblock entry point */ \
_Scheduler_simple_Update_priority, /* update priority entry point */ \
_Scheduler_default_Map_priority, /* map priority entry point */ \
_Scheduler_default_Unmap_priority, /* unmap priority entry point */ \
_Scheduler_default_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_default_Node_initialize(const Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority)
Performs the scheduler base node initialization.

Entry points for Scheduler Simple

Definition at line 45 of file schedulersimple.h.

Function Documentation

◆ _Scheduler_simple_Block()

void _Scheduler_simple_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.

◆ _Scheduler_simple_Extract()

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

Extracts the threads node.

Parameters
schedulerThis parameter is unused.
[in,out]the_threadThe thread of which to extract the node out of its chain.
nodeThis parameter is unused.

Definition at line 102 of file schedulersimpleimpl.h.

◆ _Scheduler_simple_Get_context()

static __inline__ Scheduler_simple_Context* _Scheduler_simple_Get_context ( const Scheduler_Control scheduler)
static

Gets context of the scheduler.

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

Definition at line 46 of file schedulersimpleimpl.h.

◆ _Scheduler_simple_Initialize()

void _Scheduler_simple_Initialize ( const Scheduler_Control scheduler)

Initializes simple scheduler.

This routine initializes the simple scheduler.

Parameters
schedulerThe scheduler to be initialized.

◆ _Scheduler_simple_Insert()

static __inline__ void _Scheduler_simple_Insert ( Chain_Control chain,
Thread_Control to_insert,
unsigned int  insert_priority 
)
static

Inserts the thread control with the given priority into the chain.

Parameters
[in,out]chainThe chain to insert to_insert in.
[in,out]to_insertThe node to insert into chain.
insert_priorityThe priority to insert to_insert with.

Definition at line 81 of file schedulersimpleimpl.h.

◆ _Scheduler_simple_Priority_less_equal()

static __inline__ bool _Scheduler_simple_Priority_less_equal ( const void *  to_insert,
const Chain_Node next 
)
static

Checks if the priority is less or equal than the priority of the node.

Parameters
to_insertThe priority to check whether it is less or equal than next.
nextThe Chain node to compare the priority of.
Return values
trueto_insert is smaller or equal than the priority of next.
falseto_insert is greater than the priority of next.

Definition at line 60 of file schedulersimpleimpl.h.

◆ _Scheduler_simple_Schedule()

void _Scheduler_simple_Schedule ( const Scheduler_Control scheduler,
Thread_Control the_thread 
)

Schedules threads.

This routine sets the heir thread to be the next ready thread on the ready queue by getting the first node in the scheduler information.

Parameters
schedulerThe scheduler instance.
the_threadcausing the scheduling operation.

◆ _Scheduler_simple_Schedule_body()

static __inline__ void _Scheduler_simple_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 the simple scheduler.

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 124 of file schedulersimpleimpl.h.

◆ _Scheduler_simple_Unblock()

void _Scheduler_simple_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.

◆ _Scheduler_simple_Update_priority()

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

Updates the priority of the node.

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

◆ _Scheduler_simple_Yield()

void _Scheduler_simple_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.