diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-10-21 14:41:19 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-02 10:05:44 +0100 |
commit | 0e754facf49586b4477e07883d3a3a97f99cd57f (patch) | |
tree | d404ac3f650b776240dd4aac064d266bb807005b /cpukit/score/include/rtems/score/schedulerimpl.h | |
parent | score: Simplify update priority scheduler op (diff) | |
download | rtems-0e754facf49586b4477e07883d3a3a97f99cd57f.tar.bz2 |
score: Delete unused scheduler ask for help X op
Diffstat (limited to 'cpukit/score/include/rtems/score/schedulerimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/schedulerimpl.h | 152 |
1 files changed, 0 insertions, 152 deletions
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h index 74cfb58e78..54ddd534fd 100644 --- a/cpukit/score/include/rtems/score/schedulerimpl.h +++ b/cpukit/score/include/rtems/score/schedulerimpl.h @@ -1297,158 +1297,6 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_Unblock_node( return unblock; } - -/** - * @brief Asks a ready scheduler node for help. - * - * @param[in] node The ready node offering help. - * @param[in] needs_help The thread needing help. - * - * @retval needs_help The thread needing help. - */ -RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Ask_ready_node_for_help( - Scheduler_Node *node, - Thread_Control *needs_help -) -{ - _Scheduler_Node_set_user( node, needs_help ); - - return needs_help; -} - -/** - * @brief Asks a scheduled scheduler node for help. - * - * @param[in] context The scheduler instance context. - * @param[in] node The scheduled node offering help. - * @param[in] offers_help The thread offering help. - * @param[in] needs_help The thread needing help. - * @param[in] previous_accepts_help The previous thread accepting help by this - * scheduler node. - * @param[in] release_idle_thread Function to release an idle thread. - * - * @retval needs_help The previous thread accepting help by this scheduler node - * which was displaced by the thread needing help. - * @retval NULL There are no more threads needing help. - */ -RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Ask_scheduled_node_for_help( - Scheduler_Context *context, - Scheduler_Node *node, - Thread_Control *offers_help, - Thread_Control *needs_help, - Thread_Control *previous_accepts_help, - Scheduler_Release_idle_thread release_idle_thread -) -{ - Thread_Control *next_needs_help = NULL; - Thread_Control *old_user = NULL; - Thread_Control *new_user = NULL; - - if ( - previous_accepts_help != needs_help - && _Scheduler_Thread_get_node( previous_accepts_help ) == node - ) { - Thread_Control *idle = _Scheduler_Release_idle_thread( - context, - node, - release_idle_thread - ); - - if ( idle != NULL ) { - old_user = idle; - } else { - _Assert( _Scheduler_Node_get_user( node ) == previous_accepts_help ); - old_user = previous_accepts_help; - } - - if ( needs_help->Scheduler.state == THREAD_SCHEDULER_READY ) { - new_user = needs_help; - } else { - _Assert( - node->help_state == SCHEDULER_HELP_ACTIVE_OWNER - || node->help_state == SCHEDULER_HELP_ACTIVE_RIVAL - ); - _Assert( offers_help->Scheduler.node == offers_help->Scheduler.own_node ); - - new_user = offers_help; - } - - if ( previous_accepts_help != offers_help ) { - next_needs_help = previous_accepts_help; - } - } else if ( needs_help->Scheduler.state == THREAD_SCHEDULER_READY ) { - Thread_Control *idle = _Scheduler_Release_idle_thread( - context, - node, - release_idle_thread - ); - - if ( idle != NULL ) { - old_user = idle; - } else { - old_user = _Scheduler_Node_get_user( node ); - } - - new_user = needs_help; - } else { - _Assert( needs_help->Scheduler.state == THREAD_SCHEDULER_SCHEDULED ); - } - - if ( new_user != old_user ) { - Per_CPU_Control *cpu_self = _Per_CPU_Get(); - Per_CPU_Control *cpu = _Thread_Get_CPU( old_user ); - - _Scheduler_Thread_change_state( old_user, THREAD_SCHEDULER_READY ); - _Scheduler_Thread_set_scheduler_and_node( - old_user, - _Thread_Scheduler_get_own_node( old_user ), - old_user - ); - - _Scheduler_Thread_change_state( new_user, THREAD_SCHEDULER_SCHEDULED ); - _Scheduler_Thread_set_scheduler_and_node( new_user, node, offers_help ); - - _Scheduler_Node_set_user( node, new_user ); - _Thread_Set_CPU( new_user, cpu ); - _Thread_Dispatch_update_heir( cpu_self, cpu, new_user ); - } - - return next_needs_help; -} - -/** - * @brief Asks a blocked scheduler node for help. - * - * @param[in] context The scheduler instance context. - * @param[in] node The scheduled node offering help. - * @param[in] offers_help The thread offering help. - * @param[in] needs_help The thread needing help. - * - * @retval true Enqueue this scheduler node. - * @retval false Otherwise. - */ -RTEMS_INLINE_ROUTINE bool _Scheduler_Ask_blocked_node_for_help( - Scheduler_Context *context, - Scheduler_Node *node, - Thread_Control *offers_help, - Thread_Control *needs_help -) -{ - bool enqueue; - - _Assert( node->help_state == SCHEDULER_HELP_PASSIVE ); - - if ( needs_help->Scheduler.state == THREAD_SCHEDULER_READY ) { - _Scheduler_Node_set_user( node, needs_help ); - _Scheduler_Thread_set_scheduler_and_node( needs_help, node, offers_help ); - - enqueue = true; - } else { - enqueue = false; - } - - return enqueue; -} #endif RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( |