This group contains the Scheduler Handler implementation.
More...
|
#define | _Scheduler_Count ( (size_t) 1 ) |
| This constant contains the count of configured schedulers. More...
|
|
#define | SCHEDULER_DEFAULT_SMP_OPERATIONS |
| This define provides a set of default implementations for SMP-specific scheduler operations. More...
|
|
#define | SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION |
| This define provides the default implementation for the SMP-specific set affinity operation. More...
|
|
#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_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_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) PRIORITY_GROUP_LAST ) ) |
| Clears the priority append indicator bit.
|
|
#define | SCHEDULER_PRIORITY_APPEND(priority) ( ( priority ) | ( (Priority_Control) PRIORITY_GROUP_LAST ) ) |
| Returns the priority control with the append indicator bit set.
|
|
#define | SCHEDULER_PRIORITY_IS_APPEND(priority) ( ( ( priority ) & ( (Priority_Control) PRIORITY_GROUP_LAST ) ) != 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.
|
|
|
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...
|
|
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_Start_idle (const Scheduler_Control *scheduler, Thread_Control *the_thread, struct Per_CPU_Control *cpu) |
| Starts an idle thread. More...
|
|
void | _Scheduler_Handler_initialization (void) |
| Initializes the scheduler to the policy chosen by the user. More...
|
|
Status_Control | _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...
|
|
Status_Control | _Scheduler_Set_affinity (Thread_Control *the_thread, size_t cpusetsize, const cpu_set_t *cpuset) |
| Sets the thread's scheduler's affinity. More...
|
|
This group contains the Scheduler Handler implementation.
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
- a scheduler algorithm implementation,
- a scheduler index and an associated name, and
- a set of processors owned by the scheduler (may be empty, but never overlaps with a set owned by another scheduler).
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.
◆ _Scheduler_Count
#define _Scheduler_Count ( (size_t) 1 ) |
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_DEFAULT_SET_AFFINITY_OPERATION
#define SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION |
This define provides the default implementation for the SMP-specific set affinity operation.
The default implementation _Scheduler_default_Set_affinity() is intended for uniprocessor schedulers and SMP schedulers which only support an affinity to all online processors.
If SMP support is disabled, the define evaluates to nothing.
◆ SCHEDULER_DEFAULT_SMP_OPERATIONS
#define SCHEDULER_DEFAULT_SMP_OPERATIONS |
This define provides a set of default implementations for SMP-specific scheduler operations.
The default implementations are intended for uniprocessor schedulers. SMP schedulers shall implement the operations properly.
If SMP support is disabled, the define evaluates to nothing.
If SMP support is enabled and the system has exactly one processor, then it may use an uniprocessor scheduler. The ask for help, reconsider help request, and withdraw node operations are NULL, since they are only used if a thread has at least one helping scheduler node. At least two schedulers are required to get a helping node and each scheduler involved must own at least one processor. This is not possible on a system with exactly one processor. The processor add operation is NULL, since there is no other processor to add. The processor remove operation is NULL, since the one and only processor cannot be removed.
◆ Scheduler_Context
Scheduler context.
The scheduler context of a particular scheduler implementation must place this structure at the begin of its context structure.
◆ _Scheduler_default_Cancel_job()
Does nothing.
- Parameters
-
scheduler | This parameter is unused. |
the_thread | This parameter is unused. |
priority_node | This parameter is unused. |
queue_context | This parameter is unused. |
- Returns
- Always returns NULL.
◆ _Scheduler_default_Map_priority()
Returns the scheduler internal thread priority mapped by SCHEDULER_PRIORITY_MAP().
- Parameters
-
scheduler | Unused. |
priority | The user visible thread priority. |
- Returns
- The scheduler internal thread priority.
◆ _Scheduler_default_Node_destroy()
Does nothing.
- Parameters
-
scheduler | This parameter is unused. |
node | This parameter is unused. |
◆ _Scheduler_default_Node_initialize()
Performs the scheduler base node initialization.
- Parameters
-
| scheduler | This parameter is unused. |
[out] | node | The node to initialize. |
| the_thread | This parameter is unused. |
| priority | The thread priority. |
◆ _Scheduler_default_Release_job()
Does nothing.
- Parameters
-
scheduler | This parameter is unused. |
the_thread | This parameter is unused. |
priority_node | This parameter is unused. |
deadline | This parameter is unused. |
queue_context | This parameter is unused. |
- Returns
- Always returns NULL.
◆ _Scheduler_default_Schedule()
Does nothing.
- Parameters
-
scheduler | This parameter is unused. |
the_thread | This parameter is unused. |
◆ _Scheduler_default_Start_idle()
Starts an idle thread.
- Parameters
-
| scheduler | This parameter is unused. |
[in,out] | the_thread | An idle thread. |
| cpu | This parameter is unused. |
◆ _Scheduler_default_Unmap_priority()
Returns the user visible thread priority unmapped by SCHEDULER_PRIORITY_UNMAP().
- Parameters
-
scheduler | Unused. |
priority | The scheduler internal thread priority. |
- Returns
- priority The user visible thread priority.
◆ _Scheduler_Get_affinity()
Copies the thread's scheduler's affinity to the given cpuset.
- Parameters
-
| the_thread | The thread to get the affinity of its scheduler. |
| cpusetsize | The size of cpuset. |
[out] | cpuset | The cpuset that serves as destination for the copy operation |
- Return values
-
STATUS_SUCCESSFUL | The operation succeeded. |
STATUS_INVALID_SIZE | The processor set was too small. |
◆ _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.
◆ _Scheduler_Set_affinity()
Sets the thread's scheduler's affinity.
- Parameters
-
[in,out] | the_thread | The thread to set the affinity of. |
| cpusetsize | The size of cpuset. |
| cpuset | The cpuset to set the affinity. |
- Return values
-
STATUS_SUCCESSFUL | The operation succeeded. |
STATUS_INVALID_NUMBER | The processor set was not a valid new processor affinity set for the thread. |
◆ _Scheduler_Table