summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-03-27 21:13:29 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-08 11:48:15 +0200
commit1461aba8da79b7e37d789b2bd6032e09d7f888c2 (patch)
tree6fb0c23f615bd95438102776a5ff53fcff8024d2
parentrtems: Atomically suspend/resume tasks (diff)
downloadrtems-1461aba8da79b7e37d789b2bd6032e09d7f888c2.tar.bz2
score: Use _Thread_Clear_state() for _Thread_Ready
-rw-r--r--cpukit/score/Makefile.am2
-rw-r--r--cpukit/score/include/rtems/score/statesimpl.h3
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h30
-rw-r--r--cpukit/score/src/threadready.c38
4 files changed, 19 insertions, 54 deletions
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index 112f7e80a1..dc51e9a691 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -284,7 +284,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/threadloadenv.c \
src/threadrestart.c src/threadsetpriority.c \
src/threadsetstate.c \
src/threadstackallocate.c src/threadstackfree.c src/threadstart.c \
diff --git a/cpukit/score/include/rtems/score/statesimpl.h b/cpukit/score/include/rtems/score/statesimpl.h
index 4251b3c84d..074b3528e3 100644
--- a/cpukit/score/include/rtems/score/statesimpl.h
+++ b/cpukit/score/include/rtems/score/statesimpl.h
@@ -118,6 +118,9 @@ extern "C" {
STATES_WAITING_ON_THREAD_QUEUE | \
STATES_INTERRUPTIBLE_BY_SIGNAL )
+/** All state bits set to one (provided for _Thread_Ready()) */
+#define STATES_ALL_SET 0xffffffff
+
/**
* This function sets the given states_to_set into the current_state
* passed in. The result is returned to the user in current_state.
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index 0f37655e0c..a13a0decc1 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -227,21 +227,6 @@ void _Thread_Kill_zombies( void );
void _Thread_Close( Thread_Control *the_thread, Thread_Control *executing );
/**
- * @brief Removes any set states for @a the_thread.
- *
- * This routine removes any set states for @a the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- *
- * - INTERRUPT LATENCY:
- * + ready chain
- * + select heir
- */
-void _Thread_Ready(
- Thread_Control *the_thread
-);
-
-/**
* @brief Clears the specified thread state.
*
* In case the previous state is a non-ready state and the next state is the
@@ -274,6 +259,21 @@ States_Control _Thread_Set_state(
);
/**
+ * @brief Clears all thread states.
+ *
+ * In case the previous state is a non-ready state, then the thread is
+ * unblocked by the scheduler.
+ *
+ * @param[in] the_thread The thread.
+ */
+RTEMS_INLINE_ROUTINE void _Thread_Ready(
+ Thread_Control *the_thread
+)
+{
+ _Thread_Clear_state( the_thread, STATES_ALL_SET );
+}
+
+/**
* @brief Initializes enviroment for a thread.
*
* This routine initializes the context of @a the_thread to its
diff --git a/cpukit/score/src/threadready.c b/cpukit/score/src/threadready.c
deleted file mode 100644
index 5375294fe9..0000000000
--- a/cpukit/score/src/threadready.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * @file
- *
- * @brief Thread Ready
- * @ingroup ScoreThread
- */
-
-/*
- * COPYRIGHT (c) 1989-2011.
- * 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/isrlevel.h>
-#include <rtems/score/schedulerimpl.h>
-
-void _Thread_Ready(
- Thread_Control *the_thread
-)
-{
- ISR_lock_Context lock_context;
-
- _Scheduler_Acquire( the_thread, &lock_context );
-
- the_thread->current_state = STATES_READY;
-
- _Scheduler_Unblock( the_thread );
-
- _Scheduler_Release( the_thread, &lock_context );
-}