diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-06-24 22:40:32 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-06-24 22:40:32 +0000 |
commit | 569b3f41413f9b7b1b43cce256f4b8594dbeabdf (patch) | |
tree | 6d4f5be119a7dcdbe17324926115b616ea4bf9b2 | |
parent | 2010-06-24 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff) | |
download | rtems-569b3f41413f9b7b1b43cce256f4b8594dbeabdf.tar.bz2 |
2010-06-24 Gedare Bloom <giddyup44@yahoo.com>
PR 1589/cpukit
* score/Makefile.am, score/include/rtems/score/thread.h,
score/inline/rtems/score/thread.inl: Make _Thread_Evaluate_mode() an
inline method. It is only used in one place and relatively simple.
* score/src/threadevaluatemode.c: Removed.
-rw-r--r-- | cpukit/ChangeLog | 8 | ||||
-rw-r--r-- | cpukit/score/Makefile.am | 2 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/thread.h | 8 | ||||
-rw-r--r-- | cpukit/score/inline/rtems/score/thread.inl | 21 | ||||
-rw-r--r-- | cpukit/score/src/threadevaluatemode.c | 53 |
5 files changed, 30 insertions, 62 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index a9f2333d76..c147b557a9 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,11 @@ +2010-06-24 Gedare Bloom <giddyup44@yahoo.com> + + PR 1589/cpukit + * score/Makefile.am, score/include/rtems/score/thread.h, + score/inline/rtems/score/thread.inl: Make _Thread_Evaluate_mode() an + inline method. It is only used in one place and relatively simple. + * score/src/threadevaluatemode.c: Removed. + 2010-06-24 Joel Sherrill <joel.sherrilL@OARcorp.com> * libfs/src/imfs/memfile.c: Fix assert. diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index 2d63c72054..7dd430fc5a 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -141,7 +141,7 @@ libscore_a_SOURCES += src/pheapallocate.c \ ## THREAD_C_FILES libscore_a_SOURCES += src/thread.c src/threadchangepriority.c \ src/threadclearstate.c src/threadclose.c src/threadcreateidle.c \ - src/threaddelayended.c src/threaddispatch.c src/threadevaluatemode.c \ + src/threaddelayended.c src/threaddispatch.c \ src/threadget.c src/threadhandler.c src/threadinitialize.c \ src/threadloadenv.c src/threadready.c src/threadreset.c \ src/threadrestart.c src/threadresume.c src/threadsetpriority.c \ diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index ff6196e972..1e05df8ed0 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -749,14 +749,6 @@ void _Thread_Resume( bool force ); -/** - * This routine evaluates the current scheduling information for the - * system and determines if a context switch is required. This - * is usually called after changing an execution mode such as preemptability - * for a thread. - */ -bool _Thread_Evaluate_mode( void ); - #if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE) /** * This routine is the body of the system idle thread. diff --git a/cpukit/score/inline/rtems/score/thread.inl b/cpukit/score/inline/rtems/score/thread.inl index 9e9b50d8b3..40735aff19 100644 --- a/cpukit/score/inline/rtems/score/thread.inl +++ b/cpukit/score/inline/rtems/score/thread.inl @@ -332,6 +332,27 @@ RTEMS_INLINE_ROUTINE void _Thread_Set_libc_reent ( _Thread_libc_reent = libc_reent; } +/** + * This routine evaluates the current scheduling information for the + * system and determines if a context switch is required. This + * is usually called after changing an execution mode such as preemptability + * for a thread. + */ +RTEMS_INLINE_ROUTINE bool _Thread_Evaluate_mode( void ) +{ + Thread_Control *executing; + + executing = _Thread_Executing; + + if ( !_States_Is_ready( executing->current_state ) || + ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { + _Context_Switch_necessary = true; + return true; + } + + return false; +} + /**@}*/ #endif diff --git a/cpukit/score/src/threadevaluatemode.c b/cpukit/score/src/threadevaluatemode.c deleted file mode 100644 index 3aa46cd539..0000000000 --- a/cpukit/score/src/threadevaluatemode.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Thread Handler - * - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include <rtems/system.h> -#include <rtems/score/apiext.h> -#include <rtems/score/context.h> -#include <rtems/score/interr.h> -#include <rtems/score/isr.h> -#include <rtems/score/object.h> -#include <rtems/score/priority.h> -#include <rtems/score/states.h> -#include <rtems/score/sysstate.h> -#include <rtems/score/thread.h> -#include <rtems/score/threadq.h> -#include <rtems/score/userext.h> -#include <rtems/score/wkspace.h> - -/*PAGE - * - * _Thread_Evaluate_mode - * - * XXX - */ - -bool _Thread_Evaluate_mode( void ) -{ - Thread_Control *executing; - - executing = _Thread_Executing; - - if ( !_States_Is_ready( executing->current_state ) || - ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { - _Context_Switch_necessary = true; - return true; - } - - return false; -} |