From 3f317e9033d45ffb8939e60b4105d4980046ab59 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 29 Jul 2013 15:01:55 +0200 Subject: score: Move _Thread_Dispatch_if_necessary() Rename to _RTEMS_Tasks_Dispatch_if_necessary(). --- cpukit/rtems/src/taskmode.c | 21 ++++++++++++++++++++- cpukit/score/include/rtems/score/threadimpl.h | 26 -------------------------- 2 files changed, 20 insertions(+), 27 deletions(-) diff --git a/cpukit/rtems/src/taskmode.c b/cpukit/rtems/src/taskmode.c index bbe59bb6df..3d6dee8105 100644 --- a/cpukit/rtems/src/taskmode.c +++ b/cpukit/rtems/src/taskmode.c @@ -24,6 +24,25 @@ #include #include +static void _RTEMS_Tasks_Dispatch_if_necessary( + Thread_Control *executing, + bool needs_asr_dispatching +) +{ + if ( _Thread_Dispatch_is_enabled() ) { + bool dispatch_necessary = needs_asr_dispatching; + + if ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) { + dispatch_necessary = true; + _Thread_Dispatch_necessary = dispatch_necessary; + } + + if ( dispatch_necessary ) { + _Thread_Dispatch(); + } + } +} + rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, @@ -101,7 +120,7 @@ rtems_status_code rtems_task_mode( } } - _Thread_Dispatch_if_necessary( executing, needs_asr_dispatching ); + _RTEMS_Tasks_Dispatch_if_necessary( executing, needs_asr_dispatching ); return RTEMS_SUCCESSFUL; } diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h index d50980d4db..7a48c2684b 100644 --- a/cpukit/score/include/rtems/score/threadimpl.h +++ b/cpukit/score/include/rtems/score/threadimpl.h @@ -632,32 +632,6 @@ RTEMS_INLINE_ROUTINE uint32_t _Thread_Get_global_exit_status( void ) return idle->Wait.return_code; } -/** - * @brief Issues a thread dispatch if necessary. - * - * @param[in] executing The executing thread. - * @param[in] needs_asr_dispatching Indicates whether or not the API - * level signals are pending and a dispatch is necessary. - */ -RTEMS_INLINE_ROUTINE void _Thread_Dispatch_if_necessary( - Thread_Control *executing, - bool needs_asr_dispatching -) -{ - if ( _Thread_Dispatch_is_enabled() ) { - bool dispatch_necessary = needs_asr_dispatching; - - if ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) { - dispatch_necessary = true; - _Thread_Dispatch_necessary = dispatch_necessary; - } - - if ( dispatch_necessary ) { - _Thread_Dispatch(); - } - } -} - RTEMS_INLINE_ROUTINE void _Thread_Signal_notification( Thread_Control *thread ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( thread ) ) -- cgit v1.2.3