RTEMS
|
SMP Scheduler Implementation. More...
#include <rtems/score/schedulersmp.h>
#include <rtems/score/assert.h>
#include <rtems/score/chainimpl.h>
#include <rtems/score/schedulersimpleimpl.h>
#include <rtems/bspIo.h>
Go to the source code of this file.
Typedefs | |
typedef bool(* | Scheduler_SMP_Has_ready) (Scheduler_Context *context) |
typedef Scheduler_Node *(* | Scheduler_SMP_Get_highest_ready) (Scheduler_Context *context, Scheduler_Node *node) |
typedef Scheduler_Node *(* | Scheduler_SMP_Get_lowest_scheduled) (Scheduler_Context *context, Scheduler_Node *filter) |
typedef void(* | Scheduler_SMP_Extract) (Scheduler_Context *context, Scheduler_Node *node_to_extract) |
typedef void(* | Scheduler_SMP_Insert) (Scheduler_Context *context, Scheduler_Node *node_to_insert, Priority_Control insert_priority) |
typedef void(* | Scheduler_SMP_Move) (Scheduler_Context *context, Scheduler_Node *node_to_move) |
typedef bool(* | Scheduler_SMP_Ask_for_help) (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node) |
typedef void(* | Scheduler_SMP_Update) (Scheduler_Context *context, Scheduler_Node *node_to_update, Priority_Control new_priority) |
typedef void(* | Scheduler_SMP_Set_affinity) (Scheduler_Context *context, Scheduler_Node *node, void *arg) |
typedef bool(* | Scheduler_SMP_Enqueue) (Scheduler_Context *context, Scheduler_Node *node_to_enqueue, Priority_Control priority) |
typedef void(* | Scheduler_SMP_Allocate_processor) (Scheduler_Context *context, Scheduler_Node *scheduled, Scheduler_Node *victim, Per_CPU_Control *victim_cpu) |
typedef void(* | Scheduler_SMP_Register_idle) (Scheduler_Context *context, Scheduler_Node *idle, Per_CPU_Control *cpu) |
Functions | |
static void | _Scheduler_SMP_Do_nothing_register_idle (Scheduler_Context *context, Scheduler_Node *idle, Per_CPU_Control *cpu) |
Does nothing. More... | |
static bool | _Scheduler_SMP_Priority_less_equal (const void *to_insert, const Chain_Node *next) |
Checks if to_insert is less or equal than the priority of the chain node. More... | |
static Scheduler_SMP_Context * | _Scheduler_SMP_Get_self (Scheduler_Context *context) |
Gets the scheduler smp context. More... | |
static void | _Scheduler_SMP_Initialize (Scheduler_SMP_Context *self) |
Initializes the scheduler smp context. More... | |
static Scheduler_SMP_Node * | _Scheduler_SMP_Thread_get_node (Thread_Control *thread) |
Gets the scheduler smp node of the thread. More... | |
static Scheduler_SMP_Node * | _Scheduler_SMP_Thread_get_own_node (Thread_Control *thread) |
Gets the scheduler smp node of the thread. More... | |
static Scheduler_SMP_Node * | _Scheduler_SMP_Node_downcast (Scheduler_Node *node) |
Gets the scheduler smp node. More... | |
static Scheduler_SMP_Node_state | _Scheduler_SMP_Node_state (const Scheduler_Node *node) |
Gets the state of the node. More... | |
static Priority_Control | _Scheduler_SMP_Node_priority (const Scheduler_Node *node) |
Gets the priority of the node. More... | |
static void | _Scheduler_SMP_Node_initialize (const Scheduler_Control *scheduler, Scheduler_SMP_Node *node, Thread_Control *thread, Priority_Control priority) |
Initializes the scheduler smp node. More... | |
static void | _Scheduler_SMP_Node_update_priority (Scheduler_SMP_Node *node, Priority_Control new_priority) |
Updates the priority of the node to the new priority. More... | |
static void | _Scheduler_SMP_Node_change_state (Scheduler_Node *node, Scheduler_SMP_Node_state new_state) |
Changes the state of the node to the given state. More... | |
static bool | _Scheduler_SMP_Is_processor_owned_by_us (const Scheduler_Context *context, const Per_CPU_Control *cpu) |
Checks if the processor is owned by the given context. More... | |
static Thread_Control * | _Scheduler_SMP_Get_idle_thread (Scheduler_Context *context) |
Gets The first idle thread of the given context. More... | |
static void | _Scheduler_SMP_Release_idle_thread (Scheduler_Context *context, Thread_Control *idle) |
Releases the thread and adds it to the idle threads. More... | |
static void | _Scheduler_SMP_Exctract_idle_thread (Thread_Control *idle) |
Extracts the node of the idle thread. More... | |
static void | _Scheduler_SMP_Allocate_processor_lazy (Scheduler_Context *context, Scheduler_Node *scheduled, Scheduler_Node *victim, Per_CPU_Control *victim_cpu) |
Allocates the cpu for the scheduled thread. More... | |
static void | _Scheduler_SMP_Allocate_processor_exact (Scheduler_Context *context, Scheduler_Node *scheduled, Scheduler_Node *victim, Per_CPU_Control *victim_cpu) |
Allocates the cpu for the scheduled thread. More... | |
static void | _Scheduler_SMP_Allocate_processor (Scheduler_Context *context, Scheduler_Node *scheduled, Scheduler_Node *victim, Per_CPU_Control *victim_cpu, Scheduler_SMP_Allocate_processor allocate_processor) |
Allocates the cpu for the scheduled thread using the given allocation function. More... | |
static Thread_Control * | _Scheduler_SMP_Preempt (Scheduler_Context *context, Scheduler_Node *scheduled, Scheduler_Node *victim, Scheduler_SMP_Allocate_processor allocate_processor) |
Preempts the victim's thread and allocates a cpu for the scheduled thread. More... | |
static Scheduler_Node * | _Scheduler_SMP_Get_lowest_scheduled (Scheduler_Context *context, Scheduler_Node *filter) |
Returns the lowest member of the scheduled nodes. More... | |
static void | _Scheduler_SMP_Enqueue_to_scheduled (Scheduler_Context *context, Scheduler_Node *node, Priority_Control priority, Scheduler_Node *lowest_scheduled, Scheduler_SMP_Insert insert_scheduled, Scheduler_SMP_Move move_from_scheduled_to_ready, Scheduler_SMP_Allocate_processor allocate_processor) |
Tries to schedule the given node. More... | |
static bool | _Scheduler_SMP_Enqueue (Scheduler_Context *context, Scheduler_Node *node, Priority_Control insert_priority, Chain_Node_order order, Scheduler_SMP_Insert insert_ready, Scheduler_SMP_Insert insert_scheduled, Scheduler_SMP_Move move_from_scheduled_to_ready, Scheduler_SMP_Get_lowest_scheduled get_lowest_scheduled, Scheduler_SMP_Allocate_processor allocate_processor) |
Enqueues a node according to the specified order function. More... | |
static bool | _Scheduler_SMP_Enqueue_scheduled (Scheduler_Context *context, Scheduler_Node *const node, Priority_Control insert_priority, Chain_Node_order order, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Get_highest_ready get_highest_ready, Scheduler_SMP_Insert insert_ready, Scheduler_SMP_Insert insert_scheduled, Scheduler_SMP_Move move_from_ready_to_scheduled, Scheduler_SMP_Allocate_processor allocate_processor) |
Enqueues a scheduled node according to the specified order function. More... | |
static void | _Scheduler_SMP_Extract_from_scheduled (Scheduler_Context *context, Scheduler_Node *node) |
Extracts a scheduled node from the scheduled nodes. More... | |
static void | _Scheduler_SMP_Schedule_highest_ready (Scheduler_Context *context, Scheduler_Node *victim, Per_CPU_Control *victim_cpu, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Get_highest_ready get_highest_ready, Scheduler_SMP_Move move_from_ready_to_scheduled, Scheduler_SMP_Allocate_processor allocate_processor) |
Schedules the highest ready node. More... | |
static void | _Scheduler_SMP_Preempt_and_schedule_highest_ready (Scheduler_Context *context, Scheduler_Node *victim, Per_CPU_Control *victim_cpu, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Get_highest_ready get_highest_ready, Scheduler_SMP_Move move_from_ready_to_scheduled, Scheduler_SMP_Allocate_processor allocate_processor) |
Schedules the highest ready node and preempts a currently executing one. More... | |
static void | _Scheduler_SMP_Block (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, Scheduler_SMP_Extract extract_from_scheduled, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Get_highest_ready get_highest_ready, Scheduler_SMP_Move move_from_ready_to_scheduled, Scheduler_SMP_Allocate_processor allocate_processor) |
Blocks the thread. More... | |
static void | _Scheduler_SMP_Unblock (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, Scheduler_SMP_Update update, Scheduler_SMP_Enqueue enqueue) |
Unblocks the thread. More... | |
static void | _Scheduler_SMP_Update_priority (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Update update, Scheduler_SMP_Enqueue enqueue, Scheduler_SMP_Enqueue enqueue_scheduled, Scheduler_SMP_Ask_for_help ask_for_help) |
Updates the priority of the node and the position in the queues it is in. More... | |
static void | _Scheduler_SMP_Yield (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Enqueue enqueue, Scheduler_SMP_Enqueue enqueue_scheduled) |
Performs a yield and asks for help if necessary. More... | |
static void | _Scheduler_SMP_Insert_scheduled (Scheduler_Context *context, Scheduler_Node *node_to_insert, Priority_Control priority_to_insert) |
Inserts the node with the given priority into the scheduled nodes. More... | |
static bool | _Scheduler_SMP_Ask_for_help (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, Chain_Node_order order, Scheduler_SMP_Insert insert_ready, Scheduler_SMP_Insert insert_scheduled, Scheduler_SMP_Move move_from_scheduled_to_ready, Scheduler_SMP_Get_lowest_scheduled get_lowest_scheduled, Scheduler_SMP_Allocate_processor allocate_processor) |
Asks for help. More... | |
static void | _Scheduler_SMP_Reconsider_help_request (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, Scheduler_SMP_Extract extract_from_ready) |
Reconsiders help request. More... | |
static void | _Scheduler_SMP_Withdraw_node (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, Thread_Scheduler_state next_state, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Get_highest_ready get_highest_ready, Scheduler_SMP_Move move_from_ready_to_scheduled, Scheduler_SMP_Allocate_processor allocate_processor) |
Withdraws the node. More... | |
static void | _Scheduler_SMP_Do_start_idle (Scheduler_Context *context, Thread_Control *idle, Per_CPU_Control *cpu, Scheduler_SMP_Register_idle register_idle) |
Starts the idle thread on the given processor. More... | |
static void | _Scheduler_SMP_Add_processor (Scheduler_Context *context, Thread_Control *idle, Scheduler_SMP_Has_ready has_ready, Scheduler_SMP_Enqueue enqueue_scheduled, Scheduler_SMP_Register_idle register_idle) |
Adds the idle thread to the processor. More... | |
static Thread_Control * | _Scheduler_SMP_Remove_processor (Scheduler_Context *context, Per_CPU_Control *cpu, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Enqueue enqueue) |
Removes an idle thread from the processor. More... | |
static void | _Scheduler_SMP_Set_affinity (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, void *arg, Scheduler_SMP_Set_affinity set_affinity, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Get_highest_ready get_highest_ready, Scheduler_SMP_Move move_from_ready_to_scheduled, Scheduler_SMP_Enqueue enqueue, Scheduler_SMP_Allocate_processor allocate_processor) |
Sets the affinity of the node. More... | |
SMP Scheduler Implementation.
Definition in file schedulersmpimpl.h.