[rtems commit] score: Move _Thread_Dispatch_if_necessary()

Sebastian Huber sebh at rtems.org
Tue Jul 30 07:48:50 UTC 2013


Module:    rtems
Branch:    master
Commit:    3f317e9033d45ffb8939e60b4105d4980046ab59
Changeset: http://git.rtems.org/rtems/commit/?id=3f317e9033d45ffb8939e60b4105d4980046ab59

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Jul 29 15:01:55 2013 +0200

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 bbe59bb..3d6dee8 100644
--- a/cpukit/rtems/src/taskmode.c
+++ b/cpukit/rtems/src/taskmode.c
@@ -24,6 +24,25 @@
 #include <rtems/score/threadimpl.h>
 #include <rtems/config.h>
 
+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 d50980d..7a48c26 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 ) )




More information about the vc mailing list