[rtems commit] score: Move _Thread_Reset() and make static

Sebastian Huber sebh at rtems.org
Mon Mar 31 08:09:16 UTC 2014


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Mar 18 16:11:03 2014 +0100

score: Move _Thread_Reset() and make static

---

 cpukit/score/Makefile.am                      |    2 +-
 cpukit/score/include/rtems/score/threadimpl.h |   17 ---------
 cpukit/score/src/threadreset.c                |   49 -------------------------
 cpukit/score/src/threadrestart.c              |   28 ++++++++++++++
 4 files changed, 29 insertions(+), 67 deletions(-)

diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index ed69b9b..c6dd47b 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -276,7 +276,7 @@ libscore_a_SOURCES += src/thread.c src/threadchangepriority.c \
     src/threaddelayended.c src/threaddispatch.c \
     src/threadenabledispatch.c src/threaddisabledispatch.c \
     src/threadget.c src/threadhandler.c src/threadinitialize.c \
-    src/threadloadenv.c src/threadready.c src/threadreset.c \
+    src/threadloadenv.c src/threadready.c \
     src/threadrestart.c src/threadsetpriority.c \
     src/threadsetstate.c src/threadsettransient.c \
     src/threadstackallocate.c src/threadstackfree.c src/threadstart.c \
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index b864727..57eb856 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -202,23 +202,6 @@ bool _Thread_Restart(
   Thread_Entry_numeric_type  numeric_argument
 );
 
-/**
- *  @brief Resets a thread to its initial state.
- *
- *  This routine resets a thread to its initial state but does
- *  not restart it. Some APIs do this in separate
- *  operations and this division helps support this.
- *
- *  @param[in] the_thread is the thread to resets
- *  @param[in] pointer_argument
- *  @param[in] numeric_argument
- */
-void _Thread_Reset(
-  Thread_Control            *the_thread,
-  void                      *pointer_argument,
-  Thread_Entry_numeric_type  numeric_argument
-);
-
 void _Thread_Life_action_handler(
   Thread_Control  *executing,
   Thread_Action   *action,
diff --git a/cpukit/score/src/threadreset.c b/cpukit/score/src/threadreset.c
deleted file mode 100644
index 6b566c3..0000000
--- a/cpukit/score/src/threadreset.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * @file
- * 
- * @brief Reset a Thread to its Initial State
- * @ingroup ScoreThread
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- */
-
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/threadqimpl.h>
-#include <rtems/score/watchdogimpl.h>
-
-void _Thread_Reset(
-  Thread_Control            *the_thread,
-  void                      *pointer_argument,
-  Thread_Entry_numeric_type  numeric_argument
-)
-{
-  the_thread->resource_count   = 0;
-  the_thread->is_preemptible   = the_thread->Start.is_preemptible;
-  the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
-  the_thread->budget_callout   = the_thread->Start.budget_callout;
-
-  the_thread->Start.pointer_argument = pointer_argument;
-  the_thread->Start.numeric_argument = numeric_argument;
-
-  if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
-
-    if ( _Watchdog_Is_active( &the_thread->Timer ) )
-      (void) _Watchdog_Remove( &the_thread->Timer );
-  }
-
-  if ( the_thread->current_priority != the_thread->Start.initial_priority ) {
-    the_thread->real_priority = the_thread->Start.initial_priority;
-    _Thread_Set_priority( the_thread, the_thread->Start.initial_priority );
-  }
-}
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c
index d982f72..2ee9150 100644
--- a/cpukit/score/src/threadrestart.c
+++ b/cpukit/score/src/threadrestart.c
@@ -19,7 +19,9 @@
 #endif
 
 #include <rtems/score/threadimpl.h>
+#include <rtems/score/threadqimpl.h>
 #include <rtems/score/userextimpl.h>
+#include <rtems/score/watchdogimpl.h>
 
 void _Thread_Life_action_handler(
   Thread_Control  *executing,
@@ -37,6 +39,32 @@ void _Thread_Life_action_handler(
   _Thread_Restart_self( executing );
 }
 
+static void _Thread_Reset(
+  Thread_Control            *the_thread,
+  void                      *pointer_argument,
+  Thread_Entry_numeric_type  numeric_argument
+)
+{
+  the_thread->resource_count   = 0;
+  the_thread->is_preemptible   = the_thread->Start.is_preemptible;
+  the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
+  the_thread->budget_callout   = the_thread->Start.budget_callout;
+
+  the_thread->Start.pointer_argument = pointer_argument;
+  the_thread->Start.numeric_argument = numeric_argument;
+
+  if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
+
+    if ( _Watchdog_Is_active( &the_thread->Timer ) )
+      (void) _Watchdog_Remove( &the_thread->Timer );
+  }
+
+  if ( the_thread->current_priority != the_thread->Start.initial_priority ) {
+    the_thread->real_priority = the_thread->Start.initial_priority;
+    _Thread_Set_priority( the_thread, the_thread->Start.initial_priority );
+  }
+}
+
 static void _Thread_Request_life_change(
   Thread_Control            *the_thread,
   void                      *pointer_argument,




More information about the vc mailing list