mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-22 18:44:34 +08:00
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.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
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.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
/**
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
@@ -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 );
|
||||
}
|
||||
Reference in New Issue
Block a user