diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-03-15 19:27:46 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-03-15 19:27:46 +0000 |
commit | 59eb1254adb500437d6f7d88102e49bc36061d04 (patch) | |
tree | fb8208899faa4a45e9c0f3cc798f735c1e196784 /cpukit | |
parent | 2011-03-15 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-59eb1254adb500437d6f7d88102e49bc36061d04.tar.bz2 |
2011-03-15 Joel Sherrill <joel.sherrill@oarcorp.com>
* rtems/src/taskresume.c, score/Makefile.am,
score/include/rtems/score/thread.h: Convert _Thread_Resume and
_Thread_Suspend into macros.
* score/src/threadresume.c, score/src/threadsuspend.c: Removed.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ChangeLog | 7 | ||||
-rw-r--r-- | cpukit/rtems/src/taskresume.c | 2 | ||||
-rw-r--r-- | cpukit/score/Makefile.am | 5 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/thread.h | 11 | ||||
-rw-r--r-- | cpukit/score/src/threadresume.c | 61 | ||||
-rw-r--r-- | cpukit/score/src/threadsuspend.c | 57 |
6 files changed, 14 insertions, 129 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 4d62054e5e..4acda4f028 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,12 @@ 2011-03-15 Joel Sherrill <joel.sherrill@oarcorp.com> + * rtems/src/taskresume.c, score/Makefile.am, + score/include/rtems/score/thread.h: Convert _Thread_Resume and + _Thread_Suspend into macros. + * score/src/threadresume.c, score/src/threadsuspend.c: Removed. + +2011-03-15 Joel Sherrill <joel.sherrill@oarcorp.com> + * libmisc/cpuuse/cpuusagereport.c: Make compile again. 2011-03-15 Joel Sherrill <joel.sherrill@oarcorp.com> diff --git a/cpukit/rtems/src/taskresume.c b/cpukit/rtems/src/taskresume.c index ae5e4202f5..1c6ef490b7 100644 --- a/cpukit/rtems/src/taskresume.c +++ b/cpukit/rtems/src/taskresume.c @@ -59,7 +59,7 @@ rtems_status_code rtems_task_resume( case OBJECTS_LOCAL: if ( _States_Is_suspended( the_thread->current_state ) ) { - _Thread_Resume( the_thread, true ); + _Thread_Resume( the_thread ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index 55963b7879..8476bb42f1 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -167,11 +167,10 @@ libscore_a_SOURCES += src/thread.c src/threadchangepriority.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 \ + src/threadrestart.c src/threadsetpriority.c \ src/threadsetstate.c src/threadsettransient.c \ src/threadstackallocate.c src/threadstackfree.c src/threadstart.c \ - src/threadstartmultitasking.c src/threadsuspend.c \ - src/threadtickletimeslice.c \ + src/threadstartmultitasking.c src/threadtickletimeslice.c \ src/iterateoverthreads.c src/threadblockingoperationcancel.c ## THREADQ_C_FILES diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 73203eacc3..8754ee931d 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -697,19 +697,16 @@ void _Thread_Set_priority( * This routine updates the related suspend fields in the_thread * control block to indicate the current nested level. */ -void _Thread_Suspend( - Thread_Control *the_thread -); +#define _Thread_Suspend( _the_thread ) \ + _Thread_Set_state( _the_thread, STATES_SUSPENDED ) /** * This routine updates the related suspend fields in the_thread * control block to indicate the current nested level. A force * parameter of true will force a resume and clear the suspend count. */ -void _Thread_Resume( - Thread_Control *the_thread, - bool force -); +#define _Thread_Resume( _the_thread ) \ + _Thread_Clear_state( _the_thread, STATES_SUSPENDED ) #if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE) /** diff --git a/cpukit/score/src/threadresume.c b/cpukit/score/src/threadresume.c deleted file mode 100644 index a3a4f03ee9..0000000000 --- a/cpukit/score/src/threadresume.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Thread Handler / Thread Resume - * - * - * 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.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/scheduler.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> - -/* - * INTERRUPT LATENCY: - * priority map - * select heir - */ -void _Thread_Resume( - Thread_Control *the_thread, - bool force -) -{ - - ISR_Level level; - States_Control current_state; - - _ISR_Disable( level ); - - current_state = the_thread->current_state; - if ( current_state & STATES_SUSPENDED ) { - current_state = - the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); - - if ( _States_Is_ready( current_state ) ) { - _Scheduler_Unblock( the_thread ); - } - } - - _ISR_Enable( level ); -} diff --git a/cpukit/score/src/threadsuspend.c b/cpukit/score/src/threadsuspend.c deleted file mode 100644 index f5169a25f2..0000000000 --- a/cpukit/score/src/threadsuspend.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Thread Handler / Thread Suspend - * - * - * 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.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/scheduler.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> - -/* INTERRUPT LATENCY: - * ready chain - * select map - */ -void _Thread_Suspend( - Thread_Control *the_thread -) -{ - ISR_Level level; - - _ISR_Disable( level ); - if ( !_States_Is_ready( the_thread->current_state ) ) { - the_thread->current_state = - _States_Set( STATES_SUSPENDED, the_thread->current_state ); - _ISR_Enable( level ); - return; - } - - the_thread->current_state = STATES_SUSPENDED; - - _Scheduler_Block( the_thread ); - - _ISR_Enable( level ); -} |