diff options
Diffstat (limited to 'cpukit/score/include/rtems/score/schedulersmpimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/schedulersmpimpl.h | 59 |
1 files changed, 19 insertions, 40 deletions
diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h index a4890df4d0..156307db24 100644 --- a/cpukit/score/include/rtems/score/schedulersmpimpl.h +++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h @@ -425,16 +425,12 @@ static inline bool _Scheduler_SMP_Is_processor_owned_by_us( } static inline Thread_Control *_Scheduler_SMP_Get_idle_thread( - Scheduler_Context *context, - Scheduler_SMP_Extract extract_from_ready + Scheduler_Context *context ) { Scheduler_SMP_Context *self = _Scheduler_SMP_Get_self( context ); Thread_Control *idle = (Thread_Control *) _Chain_Get_first_unprotected( &self->Idle_threads ); - Scheduler_Node *own_node = _Scheduler_Thread_get_own_node( idle ); - - ( *extract_from_ready )( &self->Base, own_node ); _Assert( &idle->Object.Node != _Chain_Tail( &self->Idle_threads ) ); @@ -442,16 +438,13 @@ static inline Thread_Control *_Scheduler_SMP_Get_idle_thread( } static inline void _Scheduler_SMP_Release_idle_thread( - Scheduler_Context *context, - Thread_Control *idle, - Scheduler_SMP_Insert insert_ready + Scheduler_Context *context, + Thread_Control *idle ) { Scheduler_SMP_Context *self = _Scheduler_SMP_Get_self( context ); - Scheduler_Node *own_node = _Scheduler_Thread_get_own_node( idle ); _Chain_Prepend_unprotected( &self->Idle_threads, &idle->Object.Node ); - ( *insert_ready )( context, own_node ); } static inline void _Scheduler_SMP_Allocate_processor_lazy( @@ -536,8 +529,7 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_to_scheduled( Scheduler_Node *lowest_scheduled, Scheduler_SMP_Insert insert_scheduled, Scheduler_SMP_Move move_from_scheduled_to_ready, - Scheduler_SMP_Allocate_processor allocate_processor, - Scheduler_Release_idle_thread release_idle_thread + Scheduler_SMP_Allocate_processor allocate_processor ) { Thread_Control *user = _Scheduler_Node_get_user( node ); @@ -570,7 +562,7 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_to_scheduled( idle = _Scheduler_Release_idle_thread( context, lowest_scheduled, - release_idle_thread + _Scheduler_SMP_Release_idle_thread ); if ( idle == NULL ) { needs_help = lowest_scheduled_user; @@ -603,7 +595,6 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_to_scheduled( * if this pointer is passed as the second argument to the order function. * @param[in] allocate_processor Function to allocate a processor to a node * based on the rules of the scheduler. - * @param[in] release_idle_thread Function to release an idle thread. */ static inline Thread_Control *_Scheduler_SMP_Enqueue_ordered( Scheduler_Context *context, @@ -614,8 +605,7 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_ordered( 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, - Scheduler_Release_idle_thread release_idle_thread + Scheduler_SMP_Allocate_processor allocate_processor ) { Scheduler_Node *lowest_scheduled = @@ -628,8 +618,7 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_ordered( lowest_scheduled, insert_scheduled, move_from_scheduled_to_ready, - allocate_processor, - release_idle_thread + allocate_processor ); } else { ( *insert_ready )( context, node ); @@ -656,8 +645,6 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_ordered( * of ready nodes to the set of scheduled nodes. * @param[in] allocate_processor Function to allocate a processor to a node * based on the rules of the scheduler. - * @param[in] get_idle_thread Function to get an idle thread. - * @param[in] release_idle_thread Function to release an idle thread. */ static inline Thread_Control *_Scheduler_SMP_Enqueue_scheduled_ordered( Scheduler_Context *context, @@ -668,9 +655,7 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_scheduled_ordered( Scheduler_SMP_Insert insert_ready, Scheduler_SMP_Insert insert_scheduled, Scheduler_SMP_Move move_from_ready_to_scheduled, - Scheduler_SMP_Allocate_processor allocate_processor, - Scheduler_Get_idle_thread get_idle_thread, - Scheduler_Release_idle_thread release_idle_thread + Scheduler_SMP_Allocate_processor allocate_processor ) { Thread_Control *needs_help; @@ -692,7 +677,7 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_scheduled_ordered( _Scheduler_Try_to_schedule_node( context, highest_ready, - get_idle_thread + _Scheduler_SMP_Get_idle_thread ) ) { Thread_Control *user = _Scheduler_Node_get_user( node ); @@ -717,7 +702,7 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_scheduled_ordered( idle = _Scheduler_Release_idle_thread( context, node, - release_idle_thread + _Scheduler_SMP_Release_idle_thread ); if ( idle == NULL ) { needs_help = user; @@ -752,8 +737,7 @@ static inline void _Scheduler_SMP_Schedule_highest_ready( 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, - Scheduler_Get_idle_thread get_idle_thread + Scheduler_SMP_Allocate_processor allocate_processor ) { while ( true ) { @@ -763,7 +747,7 @@ static inline void _Scheduler_SMP_Schedule_highest_ready( _Scheduler_Try_to_schedule_node( context, highest_ready, - get_idle_thread + _Scheduler_SMP_Get_idle_thread ) ) { _Scheduler_SMP_Allocate_processor( @@ -797,7 +781,6 @@ static inline void _Scheduler_SMP_Schedule_highest_ready( * @param[in] get_highest_ready Function to get the highest ready node. * @param[in] move_from_ready_to_scheduled Function to move a node from the set * of ready nodes to the set of scheduled nodes. - * @param[in] get_idle_thread Function to get an idle thread. */ static inline void _Scheduler_SMP_Block( Scheduler_Context *context, @@ -805,8 +788,7 @@ static inline void _Scheduler_SMP_Block( 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, - Scheduler_Get_idle_thread get_idle_thread + Scheduler_SMP_Allocate_processor allocate_processor ) { Scheduler_SMP_Node *node = _Scheduler_SMP_Thread_get_node( thread ); @@ -815,7 +797,7 @@ static inline void _Scheduler_SMP_Block( context, &node->Base, is_scheduled, - get_idle_thread + _Scheduler_SMP_Get_idle_thread ); if ( block ) { @@ -830,8 +812,7 @@ static inline void _Scheduler_SMP_Block( extract_from_ready, get_highest_ready, move_from_ready_to_scheduled, - allocate_processor, - get_idle_thread + allocate_processor ); } else { ( *extract_from_ready )( context, &node->Base ); @@ -842,8 +823,7 @@ static inline void _Scheduler_SMP_Block( static inline Thread_Control *_Scheduler_SMP_Unblock( Scheduler_Context *context, Thread_Control *thread, - Scheduler_SMP_Enqueue enqueue_fifo, - Scheduler_Release_idle_thread release_idle_thread + Scheduler_SMP_Enqueue enqueue_fifo ) { Scheduler_SMP_Node *node = _Scheduler_SMP_Thread_get_node( thread ); @@ -853,7 +833,7 @@ static inline Thread_Control *_Scheduler_SMP_Unblock( thread, &node->Base, is_scheduled, - release_idle_thread + _Scheduler_SMP_Release_idle_thread ); Thread_Control *needs_help; @@ -917,8 +897,7 @@ static inline Thread_Control *_Scheduler_SMP_Ask_for_help( Scheduler_Context *context, Thread_Control *offers_help, Thread_Control *needs_help, - Scheduler_SMP_Enqueue enqueue_fifo, - Scheduler_Release_idle_thread release_idle_thread + Scheduler_SMP_Enqueue enqueue_fifo ) { Scheduler_SMP_Node *node = _Scheduler_SMP_Thread_get_own_node( offers_help ); @@ -940,7 +919,7 @@ static inline Thread_Control *_Scheduler_SMP_Ask_for_help( offers_help, needs_help, previous_accepts_help, - release_idle_thread + _Scheduler_SMP_Release_idle_thread ); break; case SCHEDULER_SMP_NODE_BLOCKED: |