diff options
author | Jennifer Averett <Jennifer.Averett@OARcorp.com> | 1999-11-15 21:25:53 +0000 |
---|---|---|
committer | Jennifer Averett <Jennifer.Averett@OARcorp.com> | 1999-11-15 21:25:53 +0000 |
commit | 06380cfeac48b3963f9abd5fe256cd73d845bcd3 (patch) | |
tree | 38360ad8e625bc3e4f67ce716b33be081ccdc6de /testsuites/itrontests/itrontask03/preempt.c | |
parent | + Changed preempt routine into two dummy tasks one that is in dormant (diff) | |
download | rtems-06380cfeac48b3963f9abd5fe256cd73d845bcd3.tar.bz2 |
+ Added check that a task could be sent to a dormant state
then sta_tsk used to restart the task to its initial state.
+ Added calls to ref_tsk to yellow paths for suspended and
ready but not running tasks.
+ Fixed output file to correctly state test name
+ Added priority of preempt to the header file. Allows ref_tsk verification.
Diffstat (limited to 'testsuites/itrontests/itrontask03/preempt.c')
-rw-r--r-- | testsuites/itrontests/itrontask03/preempt.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/testsuites/itrontests/itrontask03/preempt.c b/testsuites/itrontests/itrontask03/preempt.c index 6f8f89f0c2..1ed269cc60 100644 --- a/testsuites/itrontests/itrontask03/preempt.c +++ b/testsuites/itrontests/itrontask03/preempt.c @@ -21,11 +21,35 @@ #include <assert.h> #include "system.h" +int Preempt_task_Count; + void Preempt_task() { - ER status; + ER status; + T_RTSK pk_rtsk; + + puts( "PREEMPT - ref_tsk validation" ); + status = ref_tsk( &pk_rtsk, PREEMPT_TASK_ID ); + assert( status == E_OK ); + assert( pk_rtsk.tskpri == PREEMPT_PRIORITY ); + assert( pk_rtsk.itskpri == PREEMPT_PRIORITY ); + assert( pk_rtsk.task == Preempt_task ); + assert( pk_rtsk.stksz >= RTEMS_MINIMUM_STACK_SIZE ); + assert( pk_rtsk.tskstat == (TTS_RUN | TTS_RDY) ); - puts( "PREEMPT - exd_tsk" ); - exd_tsk( ); - assert( 0 ); + if ( Preempt_task_Count == 0 ) { + Preempt_task_Count ++; + puts( "PREEMPT - chg_pri increment priority "); + status = chg_pri( PREEMPT_TASK_ID, (PREEMPT_PRIORITY+1) ); + directive_failed( status, "chg_pri" ); + puts( "PREEMPT - ext_tsk - going to DORMANT state" ); + ext_tsk( ); + assert( 0 ); + } else { + Preempt_task_Count ++; + puts( "PREEMPT - exd_tsk - Exit and Delete task" ); + exd_tsk( ); + assert( 0 ); + } } + |