RTEMS 6.1-rc1
|
This group contains the Simple Priority SMP Scheduler implementation. More...
Files | |
file | schedulersimplesmp.h |
This header file provides the interfaces of the Simple Priority SMP Scheduler. | |
file | schedulersimplesmp.c |
This source file contains the implementation of _Scheduler_simple_SMP_Add_processor(), _Scheduler_simple_SMP_Ask_for_help(), _Scheduler_simple_SMP_Block(), _Scheduler_simple_SMP_Initialize(), _Scheduler_simple_SMP_Node_initialize(), _Scheduler_simple_SMP_Reconsider_help_request(), _Scheduler_simple_SMP_Remove_processor(), _Scheduler_simple_SMP_Unblock(), _Scheduler_simple_SMP_Update_priority(), _Scheduler_simple_SMP_Withdraw_node(), _Scheduler_simple_SMP_Make_sticky(), _Scheduler_simple_SMP_Clean_sticky(), and _Scheduler_simple_SMP_Yield(). | |
Data Structures | |
struct | Scheduler_simple_SMP_Context |
Macros | |
#define | SCHEDULER_SIMPLE_SMP_MAXIMUM_PRIORITY 255 |
#define | SCHEDULER_SIMPLE_SMP_ENTRY_POINTS |
Entry points for the Simple SMP Scheduler. More... | |
This group contains the Simple Priority SMP Scheduler implementation.
The Simple Priority SMP Scheduler allocates a processor for the processor count highest priority ready threads. The thread priority and position in the ready chain are the only information to determine the scheduling decision. Threads with an allocated processor are in the scheduled chain. After initialization the scheduled chain has exactly processor count nodes. Each processor has exactly one allocated thread after initialization. All enqueue and extract operations may exchange threads with the scheduled chain. One thread will be added and another will be removed. The scheduled and ready chain is ordered according to the thread priority order. The chain insert operations are O(count of ready threads), thus this scheduler is unsuitable for most real-time applications.
The thread preempt mode will be ignored.
#define SCHEDULER_SIMPLE_SMP_ENTRY_POINTS |
Entry points for the Simple SMP Scheduler.
void _Scheduler_simple_SMP_Add_processor | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | idle | ||
) |
Adds idle to scheduler.
[in,out] | scheduler | The scheduler instance to add the processor to. |
idle | The idle thread control. |
bool _Scheduler_simple_SMP_Ask_for_help | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Asks for help.
scheduler | The scheduler instance to ask for help. |
the_thread | The thread needing help. |
node | The scheduler node. |
true | Ask for help was successful. |
false | Ask for help was not successful. |
void _Scheduler_simple_SMP_Block | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | thread, | ||
Scheduler_Node * | node | ||
) |
Blocks a thread.
scheduler | The scheduler instance. | |
[in,out] | thread | The thread to block. |
[in,out] | node | The scheduler node of thread. |
void _Scheduler_simple_SMP_Clean_sticky | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Cleans the sticky property from the node.
scheduler | is the scheduler of the node. | |
[in,out] | the_thread | is the thread owning the node. |
[in,out] | node | is the scheduler node to clean the sticky property. |
void _Scheduler_simple_SMP_Initialize | ( | const Scheduler_Control * | scheduler | ) |
Initializes the scheduler's context.
scheduler | The scheduler instance to initialize the context of. |
void _Scheduler_simple_SMP_Make_sticky | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Makes the node sticky.
scheduler | is the scheduler of the node. | |
[in,out] | the_thread | is the thread owning the node. |
[in,out] | node | is the scheduler node to make sticky. |
void _Scheduler_simple_SMP_Node_initialize | ( | const Scheduler_Control * | scheduler, |
Scheduler_Node * | node, | ||
Thread_Control * | the_thread, | ||
Priority_Control | priority | ||
) |
Initializes the node with the given attributes.
scheduler | The scheduler instance. | |
[out] | node | The node to initialize. |
the_thread | The user of the node, if RTEMS_SMP is defined. | |
priority | The priority of the node to initialize. |
void _Scheduler_simple_SMP_Reconsider_help_request | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Reconsiders help.
scheduler | The scheduler instance to reconsider the help request. |
the_thread | The thread reconsidering a help request. |
node | The scheduler node. |
Thread_Control * _Scheduler_simple_SMP_Remove_processor | ( | const Scheduler_Control * | scheduler, |
struct Per_CPU_Control * | cpu | ||
) |
Removes an idle thread from the given cpu.
scheduler | The scheduler instance. |
cpu | The cpu control to remove from scheduler. |
void _Scheduler_simple_SMP_Unblock | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | thread, | ||
Scheduler_Node * | node | ||
) |
Unblocks a thread.
scheduler | The scheduler instance. | |
[in,out] | thread | The thread to unblock. |
[in,out] | node | The scheduler node of thread. |
void _Scheduler_simple_SMP_Update_priority | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Updates the priority of the node.
scheduler | The scheduler instance. |
the_thread | The thread of node. |
node | The node to update the priority of. |
void _Scheduler_simple_SMP_Withdraw_node | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node, | ||
Thread_Scheduler_state | next_state | ||
) |
Withdraws node.
scheduler | The scheduler instance to withdraw the node. |
the_thread | The thread using the node. |
node | The scheduler node to withdraw. |
next_state | The next thread scheduler state in the case the node is scheduled. |
void _Scheduler_simple_SMP_Yield | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | thread, | ||
Scheduler_Node * | node | ||
) |
Performs a yield operation for the thread.
scheduler | The scheduler instance. | |
thread | The thread to yield. | |
[in,out] | node | The node of the thread to perform a yield. |