RTEMS
Modules | Files | Classes | Macros | Typedefs | Enumerations | Functions | Variables
Scheduler Handler

This handler encapsulates functionality related to managing sets of threads that are ready for execution. More...

Modules

 Deterministic Priority Scheduler
 Deterministic Priority Scheduler.
 
 EDF Scheduler
 EDF Scheduler.
 
 SMP Scheduler
 SMP Scheduler.
 
 Simple Priority Scheduler
 Simple Priority Scheduler.
 

Files

file  scheduler.h
 Constants and Structures Associated with the Scheduler.
 
file  schedulerimpl.h
 Inlined Routines Associated with the Manipulation of the Scheduler.
 
file  schedulernode.h
 Handles Scheduler Nodes.
 
file  schedulernodeimpl.h
 Scheduler Node Implementation.
 
file  scheduler.c
 Scheduler Initialize.
 
file  schedulerdefaultnodedestroy.c
 Scheduler Default Node Destruction Operation.
 
file  schedulerdefaultnodeinit.c
 Scheduler Default Node Initialization Operation.
 
file  schedulerdefaultreleasejob.c
 Default Scheduler Release Job Operation.
 
file  schedulerdefaultsetaffinity.c
 Scheduler Default Set Affinity Operation.
 
file  schedulerdefaulttick.c
 Default Scheduler At Tick Handler.
 
file  scheduleredfreleasejob.c
 Scheduler EDF Release Job.
 
file  schedulerpriorityblock.c
 Scheduler Priority Block.
 
file  schedulerprioritychangepriority.c
 Removes Thread from Thread Queue.
 
file  schedulerpriorityschedule.c
 Priority Scheduler Schedule Method.
 
file  schedulerpriorityunblock.c
 Scheduler Priority Unblock.
 
file  schedulerpriorityyield.c
 Scheduler Priority Yield.
 

Classes

struct  Scheduler_Operations
 The scheduler operations. More...
 
struct  Scheduler_Context
 Scheduler context. More...
 
struct  _Scheduler_Control
 Scheduler control. More...
 
struct  Scheduler_Assignment
 Scheduler assignment. More...
 
struct  Scheduler_Node
 Scheduler node for per-thread data. More...
 

Macros

#define SCHEDULER_ASSIGN_DEFAULT   UINT32_C(0x0)
 The scheduler assignment default attributes.
 
#define SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL   SCHEDULER_ASSIGN_DEFAULT
 The presence of this processor is optional.
 
#define SCHEDULER_ASSIGN_PROCESSOR_MANDATORY   UINT32_C(0x1)
 The presence of this processor is mandatory.
 
#define SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP
 
#define SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY   , _Scheduler_default_Set_affinity
 
#define PRIORITY_MAXIMUM   ( _Scheduler_Table[ 0 ].maximum_priority )
 This defines the lowest (least important) thread priority of the first scheduler instance.
 
#define SCHEDULER_NODE_OF_THREAD_WAIT_NODE(node)   RTEMS_CONTAINER_OF( node, Scheduler_Node, Thread.Wait_node )
 
#define SCHEDULER_NODE_OF_THREAD_SCHEDULER_NODE(node)   RTEMS_CONTAINER_OF( node, Scheduler_Node, Thread.Scheduler_node.Chain )
 
#define SCHEDULER_NODE_OF_WAIT_PRIORITY_NODE(node)   RTEMS_CONTAINER_OF( node, Scheduler_Node, Wait.Priority.Node.Node.Chain )
 
#define SCHEDULER_NODE_OF_WAIT_PRIORITY(node)   RTEMS_CONTAINER_OF( node, Scheduler_Node, Wait.Priority )
 
#define SCHEDULER_PRIORITY_APPEND_FLAG   1
 Priority append indicator for the priority control used for the scheduler node priority.
 
#define SCHEDULER_PRIORITY_MAP(priority)   ( ( priority ) << 1 )
 Maps a priority value to support the append indicator.
 
#define SCHEDULER_PRIORITY_UNMAP(priority)   ( ( priority ) >> 1 )
 Returns the plain priority value.
 
#define SCHEDULER_PRIORITY_PURIFY(priority)   ( ( priority ) & ~( (Priority_Control) SCHEDULER_PRIORITY_APPEND_FLAG ) )
 Clears the priority append indicator bit.
 
#define SCHEDULER_PRIORITY_APPEND(priority)   ( ( priority ) | SCHEDULER_PRIORITY_APPEND_FLAG )
 Returns the priority control with the append indicator bit set.
 
#define SCHEDULER_PRIORITY_IS_APPEND(priority)   ( ( ( priority ) & SCHEDULER_PRIORITY_APPEND_FLAG ) != 0 )
 Returns true, if the item should be appended to its priority group, otherwise returns false and the item should be prepended to its priority group.
 

Typedefs

typedef struct _Scheduler_Control Scheduler_Control
 
typedef struct Scheduler_Context Scheduler_Context
 Scheduler context. More...
 
typedef Thread_Control *(* Scheduler_Get_idle_thread) (Scheduler_Context *context)
 Gets an idle thread from the scheduler instance. More...
 
typedef void(* Scheduler_Release_idle_thread) (Scheduler_Context *context, Thread_Control *idle)
 Releases an idle thread to the scheduler instance for reuse. More...
 
typedef struct Scheduler_Node Scheduler_Node
 

Enumerations

enum  Scheduler_Try_to_schedule_action { SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE, SCHEDULER_TRY_TO_SCHEDULE_DO_IDLE_EXCHANGE, SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK }
 This enumeration defines what a scheduler should do with a node which could be scheduled.
 
enum  Scheduler_Node_request { SCHEDULER_NODE_REQUEST_NOT_PENDING, SCHEDULER_NODE_REQUEST_ADD, SCHEDULER_NODE_REQUEST_REMOVE, SCHEDULER_NODE_REQUEST_NOTHING }
 The scheduler node requests. More...
 

Functions

Priority_Control _Scheduler_default_Map_priority (const Scheduler_Control *scheduler, Priority_Control priority)
 Returns the scheduler internal thread priority mapped by SCHEDULER_PRIORITY_MAP(). More...
 
Priority_Control _Scheduler_default_Unmap_priority (const Scheduler_Control *scheduler, Priority_Control priority)
 Returns the user visible thread priority unmapped by SCHEDULER_PRIORITY_UNMAP(). More...
 
bool _Scheduler_default_Ask_for_help (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
 Does nothing. More...
 
void _Scheduler_default_Reconsider_help_request (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
 Does nothing. More...
 
void _Scheduler_default_Withdraw_node (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, Thread_Scheduler_state next_state)
 Does nothing. More...
 
void _Scheduler_default_Pin_or_unpin (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, struct Per_CPU_Control *cpu)
 Does nothing in a single processor system, otherwise a fatal error is issued. More...
 
void _Scheduler_default_Schedule (const Scheduler_Control *scheduler, Thread_Control *the_thread)
 Does nothing. More...
 
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. More...
 
void _Scheduler_default_Node_destroy (const Scheduler_Control *scheduler, Scheduler_Node *node)
 Does nothing. More...
 
void _Scheduler_default_Release_job (const Scheduler_Control *scheduler, Thread_Control *the_thread, Priority_Node *priority_node, uint64_t deadline, Thread_queue_Context *queue_context)
 Does nothing. More...
 
void _Scheduler_default_Cancel_job (const Scheduler_Control *scheduler, Thread_Control *the_thread, Priority_Node *priority_node, Thread_queue_Context *queue_context)
 Does nothing. More...
 
void _Scheduler_default_Tick (const Scheduler_Control *scheduler, Thread_Control *executing)
 Performs tick operations depending on the CPU budget algorithm for each executing thread. More...
 
void _Scheduler_default_Start_idle (const Scheduler_Control *scheduler, Thread_Control *the_thread, struct Per_CPU_Control *cpu)
 Starts an idle thread. More...
 
bool _Scheduler_default_Set_affinity (const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node, const Processor_mask *affinity)
 Checks if the processor set of the scheduler is the subset of the affinity set. More...
 
void _Scheduler_Handler_initialization (void)
 Initializes the scheduler to the policy chosen by the user. More...
 
static __inline__ Scheduler_Context_Scheduler_Get_context (const Scheduler_Control *scheduler)
 Gets the context of the scheduler. More...
 
static __inline__ const Scheduler_Control_Scheduler_Get_by_CPU (const Per_CPU_Control *cpu)
 Gets the scheduler for the cpu. More...
 
static __inline__ void _Scheduler_Acquire_critical (const Scheduler_Control *scheduler, ISR_lock_Context *lock_context)
 Acquires the scheduler instance inside a critical section (interrupts disabled). More...
 
static __inline__ void _Scheduler_Release_critical (const Scheduler_Control *scheduler, ISR_lock_Context *lock_context)
 Releases the scheduler instance inside a critical section (interrupts disabled). More...
 
static __inline__ bool _Scheduler_Is_non_preempt_mode_supported (const Scheduler_Control *scheduler)
 Indicate if the thread non-preempt mode is supported by the scheduler. More...
 
void _Scheduler_Request_ask_for_help (Thread_Control *the_thread)
 
static __inline__ void _Scheduler_Ask_for_help (Thread_Control *the_thread)
 Registers an ask for help request if necessary. More...
 
static __inline__ void _Scheduler_Schedule (Thread_Control *the_thread)
 General scheduling decision. More...
 
static __inline__ void _Scheduler_Yield (Thread_Control *the_thread)
 Scheduler yield with a particular thread. More...
 
static __inline__ void _Scheduler_Block (Thread_Control *the_thread)
 Blocks a thread with respect to the scheduler. More...
 
static __inline__ void _Scheduler_Unblock (Thread_Control *the_thread)
 Unblocks a thread with respect to the scheduler. More...
 
static __inline__ void _Scheduler_Update_priority (Thread_Control *the_thread)
 Propagates a priority change of a thread to the scheduler. More...
 
static __inline__ void _Scheduler_Priority_and_sticky_update (Thread_Control *the_thread, int sticky_level_change)
 Changes the sticky level of the home scheduler node and propagates a priority change of a thread to the scheduler. More...
 
static __inline__ Priority_Control _Scheduler_Map_priority (const Scheduler_Control *scheduler, Priority_Control priority)
 Maps a thread priority from the user domain to the scheduler domain. More...
 
static __inline__ Priority_Control _Scheduler_Unmap_priority (const Scheduler_Control *scheduler, Priority_Control priority)
 Unmaps a thread priority from the scheduler domain to the user domain. More...
 
static __inline__ void _Scheduler_Node_initialize (const Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority)
 Initializes a scheduler node. More...
 
static __inline__ void _Scheduler_Node_destroy (const Scheduler_Control *scheduler, Scheduler_Node *node)
 Destroys a scheduler node. More...
 
static __inline__ void _Scheduler_Release_job (Thread_Control *the_thread, Priority_Node *priority_node, uint64_t deadline, Thread_queue_Context *queue_context)
 Releases a job of a thread with respect to the scheduler. More...
 
static __inline__ void _Scheduler_Cancel_job (Thread_Control *the_thread, Priority_Node *priority_node, Thread_queue_Context *queue_context)
 Cancels a job of a thread with respect to the scheduler. More...
 
static __inline__ void _Scheduler_Tick (const Per_CPU_Control *cpu)
 Scheduler method invoked at each clock tick. More...
 
static __inline__ void _Scheduler_Start_idle (const Scheduler_Control *scheduler, Thread_Control *the_thread, Per_CPU_Control *cpu)
 Starts the idle thread for a particular processor. More...
 
static __inline__ bool _Scheduler_Has_processor_ownership (const Scheduler_Control *scheduler, uint32_t cpu_index)
 Checks if the scheduler of the cpu with the given index is equal to the given scheduler. More...
 
static __inline__ const Processor_mask * _Scheduler_Get_processors (const Scheduler_Control *scheduler)
 Gets the processors of the scheduler. More...
 
bool _Scheduler_Get_affinity (Thread_Control *the_thread, size_t cpusetsize, cpu_set_t *cpuset)
 Copies the thread's scheduler's affinity to the given cpuset. More...
 
static __inline__ bool _Scheduler_default_Set_affinity_body (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, const Processor_mask *affinity)
 Checks if the affinity is a subset of the online processors. More...
 
bool _Scheduler_Set_affinity (Thread_Control *the_thread, size_t cpusetsize, const cpu_set_t *cpuset)
 Sets the thread's scheduler's affinity. More...
 
static __inline__ void _Scheduler_Generic_block (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, void(*extract)(const Scheduler_Control *, Thread_Control *, Scheduler_Node *), void(*schedule)(const Scheduler_Control *, Thread_Control *, bool))
 Blocks the thread. More...
 
static __inline__ uint32_t _Scheduler_Get_processor_count (const Scheduler_Control *scheduler)
 Gets the number of processors of the scheduler. More...
 
static __inline__ Objects_Id _Scheduler_Build_id (uint32_t scheduler_index)
 Builds an object build id. More...
 
static __inline__ uint32_t _Scheduler_Get_index_by_id (Objects_Id id)
 Gets the scheduler index from the given object build id. More...
 
static __inline__ const Scheduler_Control_Scheduler_Get_by_id (Objects_Id id)
 Gets the scheduler from the given object build id. More...
 
static __inline__ uint32_t _Scheduler_Get_index (const Scheduler_Control *scheduler)
 Gets the index of the scheduler. More...
 
static __inline__ void _Scheduler_Thread_change_state (Thread_Control *the_thread, Thread_Scheduler_state new_state)
 Changes the threads state to the given new state. More...
 
static __inline__ void _Scheduler_Set_idle_thread (Scheduler_Node *node, Thread_Control *idle)
 Sets the scheduler node's idle thread. More...
 
static __inline__ Thread_Control_Scheduler_Use_idle_thread (Scheduler_Context *context, Scheduler_Node *node, Per_CPU_Control *cpu, Scheduler_Get_idle_thread get_idle_thread)
 Uses an idle thread for this scheduler node. More...
 
static __inline__ Scheduler_Try_to_schedule_action _Scheduler_Try_to_schedule_node (Scheduler_Context *context, Scheduler_Node *node, const Thread_Control *idle, Scheduler_Get_idle_thread get_idle_thread)
 Tries to schedule the scheduler node. More...
 
static __inline__ Thread_Control_Scheduler_Release_idle_thread (Scheduler_Context *context, Scheduler_Node *node, Scheduler_Release_idle_thread release_idle_thread)
 Releases an idle thread using this scheduler node. More...
 
static __inline__ void _Scheduler_Exchange_idle_thread (Scheduler_Node *needs_idle, Scheduler_Node *uses_idle, Thread_Control *idle)
 Exchanges an idle thread from the scheduler node that uses it right now to another scheduler node. More...
 
static __inline__ Per_CPU_Control_Scheduler_Block_node (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, bool is_scheduled, Scheduler_Get_idle_thread get_idle_thread)
 Blocks this scheduler node. More...
 
static __inline__ void _Scheduler_Discard_idle_thread (Scheduler_Context *context, Thread_Control *the_thread, Scheduler_Node *node, Scheduler_Release_idle_thread release_idle_thread)
 Discard the idle thread from the scheduler node. More...
 
static __inline__ bool _Scheduler_Unblock_node (Scheduler_Context *context, Thread_Control *the_thread, Scheduler_Node *node, bool is_scheduled, Scheduler_Release_idle_thread release_idle_thread)
 Unblocks this scheduler node. More...
 
static __inline__ void _Scheduler_Update_heir (Thread_Control *new_heir, bool force_dispatch)
 Updates the heir. More...
 
static __inline__ Status_Control _Scheduler_Set (const Scheduler_Control *new_scheduler, Thread_Control *the_thread, Priority_Control priority)
 Sets a new scheduler. More...
 
static __inline__ void _Scheduler_Node_do_initialize (const struct _Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority)
 Initializes a node. More...
 
static __inline__ const Scheduler_Control_Scheduler_Node_get_scheduler (const Scheduler_Node *node)
 Gets the scheduler of the node. More...
 
static __inline__ Thread_Control_Scheduler_Node_get_owner (const Scheduler_Node *node)
 Gets the owner of the node. More...
 
static __inline__ Priority_Control _Scheduler_Node_get_priority (Scheduler_Node *node)
 Gets the priority of the node. More...
 
static __inline__ void _Scheduler_Node_set_priority (Scheduler_Node *node, Priority_Control new_priority, bool prepend_it)
 Sets the priority of the node. More...
 
static __inline__ Thread_Control_Scheduler_Node_get_user (const Scheduler_Node *node)
 Gets the user of the node. More...
 
static __inline__ void _Scheduler_Node_set_user (Scheduler_Node *node, Thread_Control *user)
 Sets the user of the node. More...
 
static __inline__ Thread_Control_Scheduler_Node_get_idle (const Scheduler_Node *node)
 Gets the idle thread of the node. More...
 

Variables

const Scheduler_Control _Scheduler_Table []
 This table contains the configured schedulers. More...
 
const size_t _Scheduler_Count
 This constant contains the count of configured schedulers. More...
 
const Scheduler_Assignment _Scheduler_Initial_assignments []
 The scheduler assignments. More...
 
const size_t _Scheduler_Node_size
 The size of a scheduler node. More...
 

Detailed Description

This handler encapsulates functionality related to managing sets of threads that are ready for execution.

Schedulers are used by the system to manage sets of threads that are ready for execution. A scheduler consists of

Each thread uses exactly one scheduler as its home scheduler. Threads may temporarily use another scheduler due to actions of locking protocols.

All properties of a scheduler can be configured and controlled by the user. Some properties are fixed at link time (defined by application configuration options), other properties can be changed at runtime through directive calls.

The scheduler index, name, and initial processor set are defined for a particular application by the application configuration. The schedulers are registered in the _Scheduler_Table which has _Scheduler_Count entries.

Macro Definition Documentation

◆ SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP

#define SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP
Value:
_Scheduler_default_Reconsider_help_request, \
_Scheduler_default_Withdraw_node, \
_Scheduler_default_Pin_or_unpin, \
_Scheduler_default_Pin_or_unpin, \
NULL, \
NULL,
bool _Scheduler_default_Ask_for_help(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Does nothing.

Definition at line 462 of file scheduler.h.

Typedef Documentation

◆ Scheduler_Context

Scheduler context.

The scheduler context of a particular scheduler implementation must place this structure at the begin of its context structure.

◆ Scheduler_Get_idle_thread

typedef Thread_Control*( * Scheduler_Get_idle_thread) (Scheduler_Context *context)

Gets an idle thread from the scheduler instance.

Parameters
contextThe scheduler instance context.
Returns
idle An idle thread for use. This function must always return an idle thread. If none is available, then this is a fatal error.

Definition at line 877 of file schedulerimpl.h.

◆ Scheduler_Release_idle_thread

typedef void( * Scheduler_Release_idle_thread) (Scheduler_Context *context, Thread_Control *idle)

Releases an idle thread to the scheduler instance for reuse.

Parameters
contextThe scheduler instance context.
idleThe idle thread to release.

Definition at line 887 of file schedulerimpl.h.

Enumeration Type Documentation

◆ Scheduler_Node_request

The scheduler node requests.

Enumerator
SCHEDULER_NODE_REQUEST_NOT_PENDING 

The scheduler node is not on the list of pending requests.

SCHEDULER_NODE_REQUEST_ADD 

There is a pending scheduler node request to add this scheduler node to the Thread_Control::Scheduler::Scheduler_nodes chain.

SCHEDULER_NODE_REQUEST_REMOVE 

There is a pending scheduler node request to remove this scheduler node from the Thread_Control::Scheduler::Scheduler_nodes chain.

SCHEDULER_NODE_REQUEST_NOTHING 

The scheduler node is on the list of pending requests, but nothing should change.

Definition at line 47 of file schedulernode.h.

Function Documentation

◆ _Scheduler_Acquire_critical()

static __inline__ void _Scheduler_Acquire_critical ( const Scheduler_Control scheduler,
ISR_lock_Context lock_context 
)
static

Acquires the scheduler instance inside a critical section (interrupts disabled).

Parameters
schedulerThe scheduler instance.
lock_contextThe lock context to use for _Scheduler_Release_critical().

Definition at line 119 of file schedulerimpl.h.

◆ _Scheduler_Ask_for_help()

static __inline__ void _Scheduler_Ask_for_help ( Thread_Control the_thread)
static

Registers an ask for help request if necessary.

The actual ask for help operation is carried out during _Thread_Do_dispatch() on a processor related to the thread. This yields a better separation of scheduler instances. A thread of one scheduler instance should not be forced to carry out too much work for threads on other scheduler instances.

Parameters
the_threadThe thread in need for help.

Definition at line 191 of file schedulerimpl.h.

◆ _Scheduler_Block()

static __inline__ void _Scheduler_Block ( Thread_Control the_thread)
static

Blocks a thread with respect to the scheduler.

This routine removes the_thread from the scheduling decision for the scheduler. The primary task is to remove the thread from the ready queue. It performs any necessary scheduling operations including the selection of a new heir thread.

Parameters
the_threadThe thread.

Definition at line 270 of file schedulerimpl.h.

◆ _Scheduler_Block_node()

static __inline__ Per_CPU_Control* _Scheduler_Block_node ( Scheduler_Context context,
Thread_Control thread,
Scheduler_Node node,
bool  is_scheduled,
Scheduler_Get_idle_thread  get_idle_thread 
)
static

Blocks this scheduler node.

Parameters
contextThe scheduler instance context.
[in,out]threadThe thread which wants to get blocked referencing this node. This is not necessarily the user of this node in case the node participates in the scheduler helping protocol.
[in,out]nodeThe node which wants to get blocked.
is_scheduledThis node is scheduled.
get_idle_threadFunction to get an idle thread.
Return values
thread_cpuThe processor of the thread. Indicates to continue with the blocking operation.
NULLOtherwise.

Definition at line 1110 of file schedulerimpl.h.

◆ _Scheduler_Build_id()

static __inline__ Objects_Id _Scheduler_Build_id ( uint32_t  scheduler_index)
static

Builds an object build id.

Parameters
scheduler_indexThe index to build the build id out of.
Returns
The build id.

Definition at line 808 of file schedulerimpl.h.

◆ _Scheduler_Cancel_job()

static __inline__ void _Scheduler_Cancel_job ( Thread_Control the_thread,
Priority_Node priority_node,
Thread_queue_Context queue_context 
)
static

Cancels a job of a thread with respect to the scheduler.

Parameters
the_threadThe thread.
priority_nodeThe priority node of the job.
queue_contextThe thread queue context to provide the set of threads for _Thread_Priority_update().

Definition at line 585 of file schedulerimpl.h.

◆ _Scheduler_default_Ask_for_help()

bool _Scheduler_default_Ask_for_help ( const Scheduler_Control scheduler,
Thread_Control the_thread,
Scheduler_Node node 
)

Does nothing.

Parameters
schedulerThis parameter is unused.
the_threadThis parameter is unused.
nodeThis parameter is unused.
Returns
Always returns false.

Definition at line 15 of file schedulerdefaultaskforhelp.c.

◆ _Scheduler_default_Cancel_job()

void _Scheduler_default_Cancel_job ( const Scheduler_Control scheduler,
Thread_Control the_thread,
Priority_Node priority_node,
Thread_queue_Context queue_context 
)

Does nothing.

Parameters
schedulerThis parameter is unused.
the_threadThis parameter is unused.
priority_nodeThis parameter is unused.
queue_contextThis parameter is unused.
Returns
Always returns NULL.

Definition at line 39 of file schedulerdefaultreleasejob.c.

◆ _Scheduler_default_Map_priority()

Priority_Control _Scheduler_default_Map_priority ( const Scheduler_Control scheduler,
Priority_Control  priority 
)

Returns the scheduler internal thread priority mapped by SCHEDULER_PRIORITY_MAP().

Parameters
schedulerUnused.
priorityThe user visible thread priority.
Returns
The scheduler internal thread priority.

Definition at line 15 of file schedulerdefaultmappriority.c.

◆ _Scheduler_default_Node_destroy()

void _Scheduler_default_Node_destroy ( const Scheduler_Control scheduler,
Scheduler_Node node 
)

Does nothing.

Parameters
schedulerThis parameter is unused.
nodeThis parameter is unused.

Definition at line 24 of file schedulerdefaultnodedestroy.c.

◆ _Scheduler_default_Node_initialize()

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.

Parameters
schedulerThis parameter is unused.
[out]nodeThe node to initialize.
the_threadThis parameter is unused.
priorityThe thread priority.

Definition at line 24 of file schedulerdefaultnodeinit.c.

◆ _Scheduler_default_Pin_or_unpin()

void _Scheduler_default_Pin_or_unpin ( const Scheduler_Control scheduler,
Thread_Control the_thread,
Scheduler_Node node,
struct Per_CPU_Control cpu 
)

Does nothing in a single processor system, otherwise a fatal error is issued.

Parameters
schedulerThis parameter is unused.
the_threadThis parameter is unused.
nodeThis parameter is unused.
cpuThis parameter is unused.

Definition at line 17 of file schedulerdefaultpinunpin.c.

◆ _Scheduler_default_Reconsider_help_request()

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

Does nothing.

Parameters
schedulerThis parameter is unused.
the_threadThis parameter is unused.
nodeThis parameter is unused.

Definition at line 28 of file schedulerdefaultaskforhelp.c.

◆ _Scheduler_default_Release_job()

void _Scheduler_default_Release_job ( const Scheduler_Control scheduler,
Thread_Control the_thread,
Priority_Node priority_node,
uint64_t  deadline,
Thread_queue_Context queue_context 
)

Does nothing.

Parameters
schedulerThis parameter is unused.
the_threadThis parameter is unused.
priority_nodeThis parameter is unused.
deadlineThis parameter is unused.
queue_contextThis parameter is unused.
Returns
Always returns NULL.

Definition at line 24 of file schedulerdefaultreleasejob.c.

◆ _Scheduler_default_Schedule()

void _Scheduler_default_Schedule ( const Scheduler_Control scheduler,
Thread_Control the_thread 
)

Does nothing.

Parameters
schedulerThis parameter is unused.
the_threadThis parameter is unused.

Definition at line 15 of file schedulerdefaultschedule.c.

◆ _Scheduler_default_Set_affinity()

bool _Scheduler_default_Set_affinity ( const Scheduler_Control scheduler,
Thread_Control thread,
Scheduler_Node node,
const Processor_mask *  affinity 
)

Checks if the processor set of the scheduler is the subset of the affinity set.

Default implementation of the set affinity scheduler operation.

Parameters
schedulerThis parameter is unused.
threadThis parameter is unused.
nodeThis parameter is unused.
affinityThe new processor affinity set for the thread.
Return values
trueThe processor set of the scheduler is a subset of the affinity set.
falseThe processor set of the scheduler is not a subset of the affinity set.

Definition at line 24 of file schedulerdefaultsetaffinity.c.

◆ _Scheduler_default_Set_affinity_body()

static __inline__ bool _Scheduler_default_Set_affinity_body ( const Scheduler_Control scheduler,
Thread_Control the_thread,
Scheduler_Node node,
const Processor_mask *  affinity 
)
static

Checks if the affinity is a subset of the online processors.

Parameters
schedulerThis parameter is unused.
the_threadThis parameter is unused.
nodeThis parameter is unused.
affinityThe processor mask to check.
Return values
trueaffinity is a subset of the online processors.
falseaffinity is not a subset of the online processors.

Definition at line 716 of file schedulerimpl.h.

◆ _Scheduler_default_Start_idle()

void _Scheduler_default_Start_idle ( const Scheduler_Control scheduler,
Thread_Control the_thread,
struct Per_CPU_Control cpu 
)

Starts an idle thread.

Parameters
schedulerThis parameter is unused.
[in,out]the_threadAn idle thread.
cpuThis parameter is unused.

Definition at line 15 of file schedulerdefaultstartidle.c.

◆ _Scheduler_default_Tick()

void _Scheduler_default_Tick ( const Scheduler_Control scheduler,
Thread_Control executing 
)

Performs tick operations depending on the CPU budget algorithm for each executing thread.

This routine is invoked as part of processing each clock tick.

Parameters
schedulerThe scheduler.
[in,out]executingAn executing thread.

Definition at line 27 of file schedulerdefaulttick.c.

◆ _Scheduler_default_Unmap_priority()

Priority_Control _Scheduler_default_Unmap_priority ( const Scheduler_Control scheduler,
Priority_Control  priority 
)

Returns the user visible thread priority unmapped by SCHEDULER_PRIORITY_UNMAP().

Parameters
schedulerUnused.
priorityThe scheduler internal thread priority.
Returns
priority The user visible thread priority.

Definition at line 23 of file schedulerdefaultmappriority.c.

◆ _Scheduler_default_Withdraw_node()

void _Scheduler_default_Withdraw_node ( const Scheduler_Control scheduler,
Thread_Control the_thread,
Scheduler_Node node,
Thread_Scheduler_state  next_state 
)

Does nothing.

Parameters
schedulerThis parameter is unused.
the_threadThis parameter is unused..
nodeThis parameter is unused.
next_stateThis parameter is unused.

Definition at line 39 of file schedulerdefaultaskforhelp.c.

◆ _Scheduler_Discard_idle_thread()

static __inline__ void _Scheduler_Discard_idle_thread ( Scheduler_Context context,
Thread_Control the_thread,
Scheduler_Node node,
Scheduler_Release_idle_thread  release_idle_thread 
)
static

Discard the idle thread from the scheduler node.

Parameters
contextThe scheduler context.
[in,out]the_threadThe thread for the operation.
[in,out]nodeThe scheduler node to discard the idle thread from.
release_idle_threadMethod to release the idle thread from the context.

Definition at line 1161 of file schedulerimpl.h.

◆ _Scheduler_Exchange_idle_thread()

static __inline__ void _Scheduler_Exchange_idle_thread ( Scheduler_Node needs_idle,
Scheduler_Node uses_idle,
Thread_Control idle 
)
static

Exchanges an idle thread from the scheduler node that uses it right now to another scheduler node.

Parameters
needs_idleThe scheduler node that needs an idle thread.
uses_idleThe scheduler node that used the idle thread.
idleThe idle thread that is exchanged.

Definition at line 1081 of file schedulerimpl.h.

◆ _Scheduler_Generic_block()

static __inline__ void _Scheduler_Generic_block ( const Scheduler_Control scheduler,
Thread_Control the_thread,
Scheduler_Node node,
void(*)(const Scheduler_Control *, Thread_Control *, Scheduler_Node *)  extract,
void(*)(const Scheduler_Control *, Thread_Control *, bool)  schedule 
)
static

Blocks the thread.

Parameters
schedulerThe scheduler instance.
the_threadThe thread to block.
nodeThe corresponding scheduler node.
extractMethod to extract the thread.
scheduleMethod for scheduling threads.

Definition at line 754 of file schedulerimpl.h.

◆ _Scheduler_Get_affinity()

bool _Scheduler_Get_affinity ( Thread_Control the_thread,
size_t  cpusetsize,
cpu_set_t *  cpuset 
)

Copies the thread's scheduler's affinity to the given cpuset.

Parameters
the_threadThe thread to get the affinity of its scheduler.
cpusetsizeThe size of cpuset.
[out]cpusetThe cpuset that serves as destination for the copy operation
Return values
trueThe copy operation was lossless.
falseThe copy operation was not lossless

◆ _Scheduler_Get_by_CPU()

static __inline__ const Scheduler_Control* _Scheduler_Get_by_CPU ( const Per_CPU_Control cpu)
static

Gets the scheduler for the cpu.

Parameters
cpuThe cpu control to get the scheduler of.
Returns
The scheduler for the cpu.

Definition at line 99 of file schedulerimpl.h.

◆ _Scheduler_Get_by_id()

static __inline__ const Scheduler_Control* _Scheduler_Get_by_id ( Objects_Id  id)
static

Gets the scheduler from the given object build id.

Parameters
idThe object build id.
Returns
The scheduler to the object id.

Definition at line 839 of file schedulerimpl.h.

◆ _Scheduler_Get_context()

static __inline__ Scheduler_Context* _Scheduler_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 scheduler.

Definition at line 85 of file schedulerimpl.h.

◆ _Scheduler_Get_index()

static __inline__ uint32_t _Scheduler_Get_index ( const Scheduler_Control scheduler)
static

Gets the index of the scheduler.

Parameters
schedulerThe scheduler to get the index of.
Returns
The index of the given scheduler.

Definition at line 861 of file schedulerimpl.h.

◆ _Scheduler_Get_index_by_id()

static __inline__ uint32_t _Scheduler_Get_index_by_id ( Objects_Id  id)
static

Gets the scheduler index from the given object build id.

Parameters
idThe object build id.
Returns
The scheduler index.

Definition at line 825 of file schedulerimpl.h.

◆ _Scheduler_Get_processor_count()

static __inline__ uint32_t _Scheduler_Get_processor_count ( const Scheduler_Control scheduler)
static

Gets the number of processors of the scheduler.

Parameters
schedulerThe scheduler instance to get the number of processors of.
Returns
The number of processors.

Definition at line 786 of file schedulerimpl.h.

◆ _Scheduler_Get_processors()

static __inline__ const Processor_mask* _Scheduler_Get_processors ( const Scheduler_Control scheduler)
static

Gets the processors of the scheduler.

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

Definition at line 678 of file schedulerimpl.h.

◆ _Scheduler_Handler_initialization()

void _Scheduler_Handler_initialization ( void  )

Initializes the scheduler to the policy chosen by the user.

This routine initializes the scheduler to the policy chosen by the user through confdefs, or to the priority scheduler with ready chains by default.

Definition at line 24 of file scheduler.c.

◆ _Scheduler_Has_processor_ownership()

static __inline__ bool _Scheduler_Has_processor_ownership ( const Scheduler_Control scheduler,
uint32_t  cpu_index 
)
static

Checks if the scheduler of the cpu with the given index is equal to the given scheduler.

Parameters
schedulerThe scheduler for the comparison.
cpu_indexThe index of the cpu for the comparison.
Return values
trueThe scheduler of the cpu is the given scheduler.
falseThe scheduler of the cpu is not the given scheduler.

Definition at line 650 of file schedulerimpl.h.

◆ _Scheduler_Is_non_preempt_mode_supported()

static __inline__ bool _Scheduler_Is_non_preempt_mode_supported ( const Scheduler_Control scheduler)
static

Indicate if the thread non-preempt mode is supported by the scheduler.

Parameters
schedulerThe scheduler instance.
Returns
True if the non-preempt mode for threads is supported by the scheduler, otherwise false.

Definition at line 169 of file schedulerimpl.h.

◆ _Scheduler_Map_priority()

static __inline__ Priority_Control _Scheduler_Map_priority ( const Scheduler_Control scheduler,
Priority_Control  priority 
)
static

Maps a thread priority from the user domain to the scheduler domain.

Let M be the maximum scheduler priority. The mapping must be bijective in the closed interval [0, M], e.g. _Scheduler_Unmap_priority( scheduler, _Scheduler_Map_priority( scheduler, p ) ) == p for all p in [0, M]. For other values the mapping is undefined.

Parameters
schedulerThe scheduler instance.
priorityThe user domain thread priority.
Returns
The corresponding thread priority of the scheduler domain is returned.

Definition at line 480 of file schedulerimpl.h.

◆ _Scheduler_Node_destroy()

static __inline__ void _Scheduler_Node_destroy ( const Scheduler_Control scheduler,
Scheduler_Node node 
)
static

Destroys a scheduler node.

The caller must ensure that _Scheduler_Node_destroy() will be called only after a corresponding _Scheduler_Node_initialize().

Parameters
schedulerThe scheduler instance.
[out]nodeThe scheduler node to destroy.

Definition at line 541 of file schedulerimpl.h.

◆ _Scheduler_Node_do_initialize()

static __inline__ void _Scheduler_Node_do_initialize ( const struct _Scheduler_Control scheduler,
Scheduler_Node node,
Thread_Control the_thread,
Priority_Control  priority 
)
static

Initializes a node.

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

Definition at line 91 of file schedulernodeimpl.h.

◆ _Scheduler_Node_get_idle()

static __inline__ Thread_Control* _Scheduler_Node_get_idle ( const Scheduler_Node node)
static

Gets the idle thread of the node.

Parameters
nodeThe node to get the idle thread of.
Returns
The idle thread of node.

Definition at line 234 of file schedulernodeimpl.h.

◆ _Scheduler_Node_get_owner()

static __inline__ Thread_Control* _Scheduler_Node_get_owner ( const Scheduler_Node node)
static

Gets the owner of the node.

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

Definition at line 135 of file schedulernodeimpl.h.

◆ _Scheduler_Node_get_priority()

static __inline__ Priority_Control _Scheduler_Node_get_priority ( Scheduler_Node node)
static

Gets the priority of the node.

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

Definition at line 149 of file schedulernodeimpl.h.

◆ _Scheduler_Node_get_scheduler()

static __inline__ const Scheduler_Control* _Scheduler_Node_get_scheduler ( const Scheduler_Node node)
static

Gets the scheduler of the node.

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

Definition at line 121 of file schedulernodeimpl.h.

◆ _Scheduler_Node_get_user()

static __inline__ Thread_Control* _Scheduler_Node_get_user ( const Scheduler_Node node)
static

Gets the user of the node.

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

Definition at line 206 of file schedulernodeimpl.h.

◆ _Scheduler_Node_initialize()

static __inline__ void _Scheduler_Node_initialize ( const Scheduler_Control scheduler,
Scheduler_Node node,
Thread_Control the_thread,
Priority_Control  priority 
)
static

Initializes a scheduler node.

The scheduler node contains arbitrary data on function entry. The caller must ensure that _Scheduler_Node_destroy() will be called after a _Scheduler_Node_initialize() before the memory of the scheduler node is destroyed.

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

Definition at line 517 of file schedulerimpl.h.

◆ _Scheduler_Node_set_priority()

static __inline__ void _Scheduler_Node_set_priority ( Scheduler_Node node,
Priority_Control  new_priority,
bool  prepend_it 
)
static

Sets the priority of the node.

Parameters
[in,out]nodeThe node to set the priority of.
new_priorityThe new priority for node.
prepend_itIndicates whether the new priority should be prepended.

Definition at line 178 of file schedulernodeimpl.h.

◆ _Scheduler_Node_set_user()

static __inline__ void _Scheduler_Node_set_user ( Scheduler_Node node,
Thread_Control user 
)
static

Sets the user of the node.

Parameters
[out]nodeThe node to set the user of.
userThe new user for node.

Definition at line 219 of file schedulernodeimpl.h.

◆ _Scheduler_Priority_and_sticky_update()

static __inline__ void _Scheduler_Priority_and_sticky_update ( Thread_Control the_thread,
int  sticky_level_change 
)
static

Changes the sticky level of the home scheduler node and propagates a priority change of a thread to the scheduler.

Parameters
the_threadThe thread changing its priority or sticky level.
See also
_Scheduler_Update_priority().

Definition at line 417 of file schedulerimpl.h.

◆ _Scheduler_Release_critical()

static __inline__ void _Scheduler_Release_critical ( const Scheduler_Control scheduler,
ISR_lock_Context lock_context 
)
static

Releases the scheduler instance inside a critical section (interrupts disabled).

Parameters
schedulerThe scheduler instance.
lock_contextThe lock context used for _Scheduler_Acquire_critical().

Definition at line 143 of file schedulerimpl.h.

◆ _Scheduler_Release_idle_thread()

static __inline__ Thread_Control* _Scheduler_Release_idle_thread ( Scheduler_Context context,
Scheduler_Node node,
Scheduler_Release_idle_thread  release_idle_thread 
)
static

Releases an idle thread using this scheduler node.

Parameters
contextThe scheduler instance context.
[in,out]nodeThe node which may have an idle thread as user.
release_idle_threadFunction to release an idle thread.
Return values
idleThe idle thread which used this node.
NULLThis node had no idle thread as an user.

Definition at line 1054 of file schedulerimpl.h.

◆ _Scheduler_Release_job()

static __inline__ void _Scheduler_Release_job ( Thread_Control the_thread,
Priority_Node priority_node,
uint64_t  deadline,
Thread_queue_Context queue_context 
)
static

Releases a job of a thread with respect to the scheduler.

Parameters
the_threadThe thread.
priority_nodeThe priority node of the job.
deadlineThe deadline in watchdog ticks since boot.
queue_contextThe thread queue context to provide the set of threads for _Thread_Priority_update().

Definition at line 558 of file schedulerimpl.h.

◆ _Scheduler_Schedule()

static __inline__ void _Scheduler_Schedule ( Thread_Control the_thread)
static

General scheduling decision.

The preferred method to add a new scheduler is to define the jump table entries and add a case to the _Scheduler_Initialize routine.

Generic scheduling implementations that rely on the ready queue only can be found in the _Scheduler_queue_XXX functions. This kernel routine implements the scheduling decision logic for the scheduler. It does NOT dispatch.

Parameters
the_threadThe thread which state changed previously.

Definition at line 224 of file schedulerimpl.h.

◆ _Scheduler_Set()

static __inline__ Status_Control _Scheduler_Set ( const Scheduler_Control new_scheduler,
Thread_Control the_thread,
Priority_Control  priority 
)
static

Sets a new scheduler.

Parameters
new_schedulerThe new scheduler to set.
[in,out]the_threadThe thread for the operations.
priorityThe initial priority for the thread with the new scheduler.
Return values
STATUS_SUCCESSFULThe operation succeeded.
STATUS_RESOURCE_IN_USEThe thread's wait queue is not empty.
STATUS_UNSATISFIEDThe new scheduler has no processors.

Definition at line 1270 of file schedulerimpl.h.

◆ _Scheduler_Set_affinity()

bool _Scheduler_Set_affinity ( Thread_Control the_thread,
size_t  cpusetsize,
const cpu_set_t *  cpuset 
)

Sets the thread's scheduler's affinity.

Parameters
[in,out]the_threadThe thread to set the affinity of.
cpusetsizeThe size of cpuset.
cpusetThe cpuset to set the affinity.
Return values
trueThe operation succeeded.
falseThe operation did not succeed.

◆ _Scheduler_Set_idle_thread()

static __inline__ void _Scheduler_Set_idle_thread ( Scheduler_Node node,
Thread_Control idle 
)
static

Sets the scheduler node's idle thread.

Parameters
[in,out]nodeThe node to receive an idle thread.
idleThe idle thread control for the operation.

Definition at line 918 of file schedulerimpl.h.

◆ _Scheduler_Start_idle()

static __inline__ void _Scheduler_Start_idle ( const Scheduler_Control scheduler,
Thread_Control the_thread,
Per_CPU_Control cpu 
)
static

Starts the idle thread for a particular processor.

Parameters
schedulerThe scheduler instance.
[in,out]the_threadThe idle thread for the processor.
[in,out]cpuThe processor for the idle thread.
See also
_Thread_Create_idle().

Definition at line 631 of file schedulerimpl.h.

◆ _Scheduler_Thread_change_state()

static __inline__ void _Scheduler_Thread_change_state ( Thread_Control the_thread,
Thread_Scheduler_state  new_state 
)
static

Changes the threads state to the given new state.

Parameters
[out]the_threadThe thread to change the state of.
new_stateThe new state for the_thread.

Definition at line 898 of file schedulerimpl.h.

◆ _Scheduler_Tick()

static __inline__ void _Scheduler_Tick ( const Per_CPU_Control cpu)
static

Scheduler method invoked at each clock tick.

This method is invoked at each clock tick to allow the scheduler implementation to perform any activities required. For the scheduler which support standard RTEMS features, this includes time-slicing management.

Parameters
cpuThe cpu control for the operation.

Definition at line 612 of file schedulerimpl.h.

◆ _Scheduler_Try_to_schedule_node()

static __inline__ Scheduler_Try_to_schedule_action _Scheduler_Try_to_schedule_node ( Scheduler_Context context,
Scheduler_Node node,
const Thread_Control idle,
Scheduler_Get_idle_thread  get_idle_thread 
)
static

Tries to schedule the scheduler node.

When a scheduler needs to schedule a node, it shall use this function to determine what it shall do with the node. The node replaces a victim node if it can be scheduled.

This function uses the state of the node and the scheduler state of the owner thread to determine what shall be done. Each scheduler maintains its nodes independent of other schedulers. This function ensures that a thread is scheduled by at most one scheduler. If a node requires an executing thread due to some locking protocol and the owner thread is already scheduled by another scheduler, then an idle thread shall be attached to the node.

Parameters
[in,out]contextis the scheduler context.
[in,out]nodeis the node which could be scheduled.
idleis an idle thread used by the victim node or NULL.
get_idle_threadpoints to a function to get an idle thread.
Return values
SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULEThe node shall be scheduled.
SCHEDULER_TRY_TO_SCHEDULE_DO_IDLE_EXCHANGEThe node shall be scheduled and the provided idle thread shall be attached to the node. This action is returned, if the node cannot use the owner thread and shall use an idle thread instead. In this case, the idle thread is provided by the victim node.
SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCKThe node shall be blocked. This action is returned, if the owner thread is already scheduled by another scheduler.

Definition at line 1001 of file schedulerimpl.h.

◆ _Scheduler_Unblock()

static __inline__ void _Scheduler_Unblock ( Thread_Control the_thread)
static

Unblocks a thread with respect to the scheduler.

This operation must fetch the latest thread priority value for this scheduler instance and update its internal state if necessary.

Parameters
the_threadThe thread.
See also
_Scheduler_Node_get_priority().

Definition at line 332 of file schedulerimpl.h.

◆ _Scheduler_Unblock_node()

static __inline__ bool _Scheduler_Unblock_node ( Scheduler_Context context,
Thread_Control the_thread,
Scheduler_Node node,
bool  is_scheduled,
Scheduler_Release_idle_thread  release_idle_thread 
)
static

Unblocks this scheduler node.

Parameters
contextThe scheduler instance context.
[in,out]the_threadThe thread which wants to get unblocked.
[in,out]nodeThe node which wants to get unblocked.
is_scheduledThis node is scheduled.
release_idle_threadFunction to release an idle thread.
Return values
trueContinue with the unblocking operation.
falseDo not continue with the unblocking operation.

Definition at line 1197 of file schedulerimpl.h.

◆ _Scheduler_Unmap_priority()

static __inline__ Priority_Control _Scheduler_Unmap_priority ( const Scheduler_Control scheduler,
Priority_Control  priority 
)
static

Unmaps a thread priority from the scheduler domain to the user domain.

Parameters
schedulerThe scheduler instance.
priorityThe scheduler domain thread priority.
Returns
The corresponding thread priority of the user domain is returned.

Definition at line 496 of file schedulerimpl.h.

◆ _Scheduler_Update_heir()

static __inline__ void _Scheduler_Update_heir ( Thread_Control new_heir,
bool  force_dispatch 
)
static

Updates the heir.

Parameters
[in,out]new_heirThe new heir.
force_dispatchIndicates whether the dispatch happens also if the currently running thread is set as not preemptible.

Definition at line 1235 of file schedulerimpl.h.

◆ _Scheduler_Update_priority()

static __inline__ void _Scheduler_Update_priority ( Thread_Control the_thread)
static

Propagates a priority change of a thread to the scheduler.

On uni-processor configurations, this operation must evaluate the thread state. In case the thread is not ready, then the priority update should be deferred to the next scheduler unblock operation.

The operation must update the heir and thread dispatch necessary variables in case the set of scheduled threads changes.

Parameters
the_threadThe thread changing its priority.
See also
_Scheduler_Node_get_priority().

Definition at line 367 of file schedulerimpl.h.

◆ _Scheduler_Use_idle_thread()

static __inline__ Thread_Control* _Scheduler_Use_idle_thread ( Scheduler_Context context,
Scheduler_Node node,
Per_CPU_Control cpu,
Scheduler_Get_idle_thread  get_idle_thread 
)
static

Uses an idle thread for this scheduler node.

A thread whose home scheduler node has a sticky level greater than zero may use an idle thread in the home scheduler instance in the case it executes currently in another scheduler instance or in the case it is in a blocking state.

Parameters
contextThe scheduler instance context.
[in,out]nodeThe node which wants to use the idle thread.
cpuThe processor for the idle thread.
get_idle_threadFunction to get an idle thread.

Definition at line 945 of file schedulerimpl.h.

◆ _Scheduler_Yield()

static __inline__ void _Scheduler_Yield ( Thread_Control the_thread)
static

Scheduler yield with a particular thread.

This routine is invoked when a thread wishes to voluntarily transfer control of the processor to another thread.

Parameters
the_threadThe yielding thread.

Definition at line 245 of file schedulerimpl.h.

Variable Documentation

◆ _Scheduler_Count

const size_t _Scheduler_Count

This constant contains the count of configured schedulers.

In SMP configurations, the constant is defined by <rtems/confdefs.h> through the count of entries of the #CONFIGURE_SCHEDULER_TABLE_ENTRIES application configuration option.

In uniprocessor configurations, this is a compile time constant set to one. This is important so that the compiler can optimize some loops away.

See also
_Scheduler_Table.

◆ _Scheduler_Initial_assignments

const Scheduler_Assignment _Scheduler_Initial_assignments[]

The scheduler assignments.

The length of this array must be equal to the maximum processors.

Application provided via <rtems/confdefs.h>.

See also
_Scheduler_Table and rtems_configuration_get_maximum_processors().

◆ _Scheduler_Node_size

const size_t _Scheduler_Node_size

The size of a scheduler node.

This value is provided via <rtems/confdefs.h>.

◆ _Scheduler_Table

const Scheduler_Control _Scheduler_Table[]

This table contains the configured schedulers.

The table is defined by <rtems/confdefs.h> through the #CONFIGURE_SCHEDULER_TABLE_ENTRIES application configuration option.

See also
_Scheduler_Count.