23 #ifndef _RTEMS_SCORE_SCHEDULERSMPIMPL_H 24 #define _RTEMS_SCORE_SCHEDULERSMPIMPL_H 278 typedef bool ( *Scheduler_SMP_Has_ready )(
292 typedef void ( *Scheduler_SMP_Extract )(
297 typedef void ( *Scheduler_SMP_Insert )(
303 typedef void ( *Scheduler_SMP_Move )(
308 typedef bool ( *Scheduler_SMP_Ask_for_help )(
314 typedef void ( *Scheduler_SMP_Update )(
320 typedef void ( *Scheduler_SMP_Set_affinity )(
326 typedef bool ( *Scheduler_SMP_Enqueue )(
332 typedef void ( *Scheduler_SMP_Allocate_processor )(
339 typedef void ( *Scheduler_SMP_Register_idle )(
373 const void *to_insert,
383 return *priority_to_insert <= node_next->
priority;
531 the_node->
state = new_state;
548 return cpu->Scheduler.
context == context;
626 heir = scheduled_cpu->
heir;
634 heir = scheduled_thread;
637 heir = scheduled_thread;
640 if ( heir != victim_thread ) {
690 Scheduler_SMP_Allocate_processor allocate_processor
694 ( *allocate_processor )( context, scheduled, victim, victim_cpu );
711 Scheduler_SMP_Allocate_processor allocate_processor
731 _Per_CPU_Acquire( victim_cpu, &per_cpu_lock_context );
736 _Per_CPU_Release( victim_cpu, &per_cpu_lock_context );
750 return victim_thread;
778 return lowest_scheduled;
802 Scheduler_SMP_Insert insert_scheduled,
803 Scheduler_SMP_Move move_from_scheduled_to_ready,
804 Scheduler_SMP_Allocate_processor allocate_processor
816 if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE ) {
824 ( *insert_scheduled )( context, node, priority );
825 ( *move_from_scheduled_to_ready )( context, lowest_scheduled );
832 }
else if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_IDLE_EXCHANGE ) {
839 ( *insert_scheduled )( context, node, priority );
840 ( *move_from_scheduled_to_ready )( context, lowest_scheduled );
848 _Assert( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
880 Scheduler_SMP_Insert insert_ready,
881 Scheduler_SMP_Insert insert_scheduled,
882 Scheduler_SMP_Move move_from_scheduled_to_ready,
883 Scheduler_SMP_Get_lowest_scheduled get_lowest_scheduled,
884 Scheduler_SMP_Allocate_processor allocate_processor
890 lowest_scheduled = ( *get_lowest_scheduled )( context, node );
892 if ( ( *order )( &insert_priority, &lowest_scheduled->
Node.
Chain ) ) {
899 move_from_scheduled_to_ready,
904 ( *insert_ready )( context, node, insert_priority );
935 Scheduler_SMP_Extract extract_from_ready,
936 Scheduler_SMP_Get_highest_ready get_highest_ready,
937 Scheduler_SMP_Insert insert_ready,
938 Scheduler_SMP_Insert insert_scheduled,
939 Scheduler_SMP_Move move_from_ready_to_scheduled,
940 Scheduler_SMP_Allocate_processor allocate_processor
947 highest_ready = ( *get_highest_ready )( context, node );
955 && ( *order )( &insert_priority, &highest_ready->
Node.
Chain )
957 ( *insert_scheduled )( context, node, insert_priority );
993 if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE ) {
1003 ( *insert_ready )( context, node, insert_priority );
1004 ( *move_from_ready_to_scheduled )( context, highest_ready );
1011 return ( idle == NULL );
1012 }
else if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_IDLE_EXCHANGE ) {
1019 ( *insert_ready )( context, node, insert_priority );
1020 ( *move_from_ready_to_scheduled )( context, highest_ready );
1029 _Assert( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
1036 ( *extract_from_ready )( context, highest_ready );
1074 Scheduler_SMP_Extract extract_from_ready,
1075 Scheduler_SMP_Get_highest_ready get_highest_ready,
1076 Scheduler_SMP_Move move_from_ready_to_scheduled,
1077 Scheduler_SMP_Allocate_processor allocate_processor
1083 Scheduler_Node *highest_ready = ( *get_highest_ready )( context, victim );
1092 if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE ) {
1101 ( *move_from_ready_to_scheduled )( context, highest_ready );
1103 _Assert( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
1110 ( *extract_from_ready )( context, highest_ready );
1112 }
while ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
1133 Scheduler_SMP_Extract extract_from_ready,
1134 Scheduler_SMP_Get_highest_ready get_highest_ready,
1135 Scheduler_SMP_Move move_from_ready_to_scheduled,
1136 Scheduler_SMP_Allocate_processor allocate_processor
1142 Scheduler_Node *highest_ready = ( *get_highest_ready )( context, victim );
1151 if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE ) {
1159 ( *move_from_ready_to_scheduled )( context, highest_ready );
1161 _Assert( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
1168 ( *extract_from_ready )( context, highest_ready );
1170 }
while ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
1193 Scheduler_SMP_Extract extract_from_scheduled,
1194 Scheduler_SMP_Extract extract_from_ready,
1195 Scheduler_SMP_Get_highest_ready get_highest_ready,
1196 Scheduler_SMP_Move move_from_ready_to_scheduled,
1197 Scheduler_SMP_Allocate_processor allocate_processor
1213 if ( thread_cpu != NULL ) {
1217 ( *extract_from_scheduled )( context, node );
1224 move_from_ready_to_scheduled,
1228 ( *extract_from_ready )( context, node );
1247 Scheduler_SMP_Update update,
1248 Scheduler_SMP_Enqueue enqueue
1271 ( *update )( context, node, priority );
1279 needs_help = ( *enqueue )( context, node, insert_priority );
1316 Scheduler_SMP_Extract extract_from_ready,
1317 Scheduler_SMP_Update update,
1318 Scheduler_SMP_Enqueue enqueue,
1319 Scheduler_SMP_Enqueue enqueue_scheduled,
1320 Scheduler_SMP_Ask_for_help ask_for_help
1332 ( *ask_for_help )( context, thread, node );
1342 ( *update )( context, node, priority );
1343 ( *enqueue_scheduled )( context, node, insert_priority );
1345 ( *extract_from_ready )( context, node );
1346 ( *update )( context, node, priority );
1347 ( *enqueue )( context, node, insert_priority );
1349 ( *update )( context, node, priority );
1352 ( *ask_for_help )( context, thread, node );
1372 Scheduler_SMP_Extract extract_from_ready,
1373 Scheduler_SMP_Enqueue enqueue,
1374 Scheduler_SMP_Enqueue enqueue_scheduled
1387 ( *enqueue_scheduled )( context, node, insert_priority );
1390 ( *extract_from_ready )( context, node );
1392 needs_help = ( *enqueue )( context, node, insert_priority );
1422 &priority_to_insert,
1454 Scheduler_SMP_Insert insert_ready,
1455 Scheduler_SMP_Insert insert_scheduled,
1456 Scheduler_SMP_Move move_from_scheduled_to_ready,
1457 Scheduler_SMP_Get_lowest_scheduled get_lowest_scheduled,
1458 Scheduler_SMP_Allocate_processor allocate_processor
1473 lowest_scheduled = ( *get_lowest_scheduled )( context, node );
1487 if ( ( *order )( &insert_priority, &lowest_scheduled->
Node.
Chain ) ) {
1502 ( *insert_scheduled )( context, node, insert_priority );
1503 ( *move_from_scheduled_to_ready )( context, lowest_scheduled );
1514 ( *insert_ready )( context, node, insert_priority );
1556 Scheduler_SMP_Extract extract_from_ready
1569 ( *extract_from_ready )( context, node );
1595 Scheduler_SMP_Extract extract_from_ready,
1596 Scheduler_SMP_Get_highest_ready get_highest_ready,
1597 Scheduler_SMP_Move move_from_ready_to_scheduled,
1598 Scheduler_SMP_Allocate_processor allocate_processor
1623 move_from_ready_to_scheduled,
1628 ( *extract_from_ready )( context, node );
1647 Scheduler_SMP_Register_idle register_idle
1660 ( *register_idle )( context, &node->
Base, cpu );
1677 Scheduler_SMP_Has_ready has_ready,
1678 Scheduler_SMP_Enqueue enqueue_scheduled,
1679 Scheduler_SMP_Register_idle register_idle
1692 if ( ( *has_ready )( &
self->Base ) ) {
1697 ( *enqueue_scheduled )( &
self->Base, node, insert_priority );
1717 Scheduler_SMP_Extract extract_from_ready,
1718 Scheduler_SMP_Enqueue enqueue
1741 if ( !victim_owner->
is_idle ) {
1751 ( *extract_from_ready )( &
self->Base, idle_node );
1764 ( *enqueue )( context, victim_node, insert_priority );
1767 _Assert( victim_owner == victim_user );
1769 idle = victim_owner;
1800 Scheduler_SMP_Set_affinity set_affinity,
1801 Scheduler_SMP_Extract extract_from_ready,
1802 Scheduler_SMP_Get_highest_ready get_highest_ready,
1803 Scheduler_SMP_Move move_from_ready_to_scheduled,
1804 Scheduler_SMP_Enqueue enqueue,
1805 Scheduler_SMP_Allocate_processor allocate_processor
1823 move_from_ready_to_scheduled,
1826 ( *set_affinity )( context, node, arg );
1827 ( *enqueue )( context, node, insert_priority );
1829 ( *extract_from_ready )( context, node );
1830 ( *set_affinity )( context, node, arg );
1831 ( *enqueue )( context, node, insert_priority );
1834 ( *set_affinity )( context, node, arg );
static void _Scheduler_SMP_Release_idle_thread(Scheduler_Context *context, Thread_Control *idle)
Releases the thread and adds it to the idle threads.
Scheduler context specialization for SMP schedulers.
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.
int sticky_level
The sticky level determines if this scheduler node should use an idle thread in case this node is sch...
bool(* Chain_Node_order)(const void *left, const Chain_Node *right)
Chain node order.
static __inline__ Chain_Node * _Chain_First(const Chain_Control *the_chain)
Returns pointer to chain's first node.
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.
static void _Scheduler_SMP_Do_nothing_register_idle(Scheduler_Context *context, Scheduler_Node *idle, Per_CPU_Control *cpu)
Does nothing.
Scheduler_Try_to_schedule_action
This enumeration defines what a scheduler should do with a node which could be scheduled.
uint64_t Priority_Control
The thread priority control.
Inlined Routines Associated with the Manipulation of the Priority-Based Scheduling Structures...
static Scheduler_SMP_Node * _Scheduler_SMP_Thread_get_own_node(Thread_Control *thread)
Gets the scheduler smp node of the thread.
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...
static void _Scheduler_SMP_Extract_from_scheduled(Scheduler_Context *context, Scheduler_Node *node)
Extracts a scheduled node from the scheduled nodes.
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.
static Scheduler_SMP_Node_state _Scheduler_SMP_Node_state(const Scheduler_Node *node)
Gets the state of the node.
#define SCHEDULER_PRIORITY_APPEND(priority)
Returns the priority control with the append indicator bit set.
union Scheduler_Node::@18 Node
Chain node for usage in various scheduler data structures.
static __inline__ bool _Thread_Is_executing_on_a_processor(const Thread_Control *the_thread)
Checks if the thread executes currently on some processor in the system.
Priority_Control priority
The current priority of thread owning this node.
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.
static Thread_Control * _Scheduler_SMP_Get_idle_thread(Scheduler_Context *context)
Gets The first idle thread of the given context.
static Scheduler_SMP_Node * _Scheduler_SMP_Thread_get_node(Thread_Control *thread)
Gets the scheduler smp node of the thread.
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.
This scheduler node is ready.
This thread is scheduled with respect to the scheduler.
This thread is ready with respect to the scheduler.
static __inline__ Chain_Node * _Chain_Get_first_unprotected(Chain_Control *the_chain)
Gets the first node (unprotected).
static Scheduler_SMP_Context * _Scheduler_SMP_Get_self(Scheduler_Context *context)
Gets the scheduler smp context.
Thread_Scheduler_control Scheduler
Scheduler related control.
const struct Scheduler_Context * context
The scheduler context of the scheduler owning this processor.
The scheduler node is scheduled.
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.
Scheduler_SMP_Node_state
SMP scheduler node states.
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.
static __inline__ Priority_Control _Scheduler_Node_get_priority(Scheduler_Node *node)
Gets the priority of the node.
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.
Chain_Control Threads_in_need_for_help
Chain of threads in need for help.
#define _ISR_Get_level()
Return current interrupt level.
#define SCHEDULER_PRIORITY_PURIFY(priority)
Clears the priority append indicator bit.
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.
struct _Thread_Control * idle
The idle thread claimed by this node in case the sticky level is greater than zero and the thread is ...
Scheduler_SMP_Node_state state
The state of this node.
size_t helping_nodes
Count of nodes scheduler nodes minus one.
Information for the Assert Handler.
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.
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.
static __inline__ void _Chain_Append_unprotected(Chain_Control *the_chain, Chain_Node *the_node)
Appends a node (unprotected).
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.
static __inline__ void _Chain_Prepend_unprotected(Chain_Control *the_chain, Chain_Node *the_node)
Prepends a node (unprotected).
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.
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.
This scheduler node is blocked.
static __inline__ void _Thread_Scheduler_cancel_need_for_help(Thread_Control *the_thread, Per_CPU_Control *cpu)
Cancels the thread's need for help.
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.
Thread_Scheduler_state
The thread state with respect to the scheduler.
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.
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.
static __inline__ void _Scheduler_Ask_for_help(Thread_Control *the_thread)
Registers an ask for help request if necessary.
static __inline__ Scheduler_Node * _Thread_Scheduler_get_home_node(const Thread_Control *the_thread)
Gets the scheduler's home node.
static __inline__ Chain_Node * _Chain_Next(const Chain_Node *the_node)
Returns pointer to the next node from this node.
static __inline__ void _Thread_Set_CPU(Thread_Control *thread, Per_CPU_Control *cpu)
Sets the cpu of the thread's scheduler.
static Priority_Control _Scheduler_SMP_Node_priority(const Scheduler_Node *node)
Gets the priority of the node.
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.
static __inline__ Thread_Control * _Scheduler_Node_get_owner(const Scheduler_Node *node)
Gets the owner of the node.
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.
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.
static __inline__ void _Chain_Extract_unprotected(Chain_Node *the_node)
Extracts this node (unprotected).
static __inline__ Thread_Control * _Scheduler_Node_get_idle(const Scheduler_Node *node)
Gets the idle thread of the node.
Scheduler node specialization for SMP schedulers.
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.
Chain_Node Help_node
Node for the Per_CPU_Control::Threads_in_need_for_help chain.
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.
static __inline__ void _Thread_Scheduler_acquire_critical(Thread_Control *the_thread, ISR_lock_Context *lock_context)
Acquires the lock context in a critical section.
static __inline__ void _Thread_Scheduler_release_critical(Thread_Control *the_thread, ISR_lock_Context *lock_context)
Releases the lock context in a critical section.
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.
Thread_Scheduler_state state
The current scheduler state of this thread.
static void _Scheduler_SMP_Exctract_idle_thread(Thread_Control *idle)
Extracts the node of the idle thread.
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.
const struct _Scheduler_Control * pinned_scheduler
The pinned scheduler of this thread.
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.
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.
Interface to Kernel Print Methods.
struct _Thread_Control * heir
This is the heir thread for this processor.
Scheduler_Node Base
Basic scheduler node.
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.
static __inline__ Per_CPU_Control * _Thread_Get_CPU(const Thread_Control *thread)
Gets the cpu of the thread's scheduler.
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.
static Scheduler_SMP_Node * _Scheduler_SMP_Node_downcast(Scheduler_Node *node)
Gets the scheduler smp node.
static __inline__ void _Chain_Initialize_empty(Chain_Control *the_chain)
Initializes this chain as empty.
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.
static Scheduler_Node * _Scheduler_SMP_Get_lowest_scheduled(Scheduler_Context *context, Scheduler_Node *filter)
Returns the lowest member of the scheduled nodes.
Scheduler node for per-thread data.
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.
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.
static __inline__ Chain_Node * _Chain_Last(const Chain_Control *the_chain)
Returns pointer to chain's last node.
static __inline__ void _Thread_Dispatch_update_heir(Per_CPU_Control *cpu_self, Per_CPU_Control *cpu_for_heir, Thread_Control *heir)
Updates the used cpu time for the heir and dispatches a new heir.
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.
Local ISR lock context for acquire and release pairs.
static __inline__ bool _Thread_Is_ready(const Thread_Control *the_thread)
Checks if the thread is ready.
static __inline__ void _Chain_Insert_ordered_unprotected(Chain_Control *the_chain, Chain_Node *to_insert, const void *left, Chain_Node_order order)
Inserts a node into the chain according to the order relation.
Chain_Node Chain
The node for Thread_Control::Scheduler::Scheduler_nodes.
static __inline__ bool _Chain_Is_empty(const Chain_Control *the_chain)
Checks if the chain is empty.
static __inline__ Thread_Control * _Scheduler_Node_get_user(const Scheduler_Node *node)
Gets the user of the node.
static __inline__ Chain_Node * _Chain_Tail(Chain_Control *the_chain)
Returns pointer to chain tail.
static __inline__ const Chain_Node * _Chain_Immutable_tail(const Chain_Control *the_chain)
Returns pointer to immutable chain tail.
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.
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG.
static void _Scheduler_SMP_Initialize(Scheduler_SMP_Context *self)
Initializes the scheduler smp context.