summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-18 16:11:03 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-31 08:29:43 +0200
commitdcd5e2609b00f3b327cd175b28fae70a20572238 (patch)
treea3e5574d2c2a4a0122745a4afd64a34f5f7bb3d8
parentscore: Use thread action for thread restart (diff)
downloadrtems-dcd5e2609b00f3b327cd175b28fae70a20572238.tar.bz2
score: Move _Thread_Reset() and make static
-rw-r--r--cpukit/score/Makefile.am2
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h17
-rw-r--r--cpukit/score/src/threadreset.c49
-rw-r--r--cpukit/score/src/threadrestart.c28
4 files changed, 29 insertions, 67 deletions
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index ed69b9b84b..c6dd47b781 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 b8647276a5..57eb85612f 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 6b566c3200..0000000000
--- 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 d982f720e7..2ee91500aa 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,