source: rtems/testsuites/itrontests/itrontask03/preempt.c @ 4e917492

4.104.114.84.95
Last change on this file since 4e917492 was 9d9a3dd, checked in by Jennifer Averett <Jennifer.Averett@…>, on 11/17/99 at 16:47:58

+ Updated copyright information.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*  Preempt_task
2 *
3 *  This routine serves as a test task.  It verifies the task manager.
4 *
5 *  Input parameters:
6 *    argument - task argument
7 *
8 *  Output parameters:  NONE
9 *
10 *  COPYRIGHT (c) 1989-1999.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.OARcorp.com/rtems/license.html.
16 *
17 *  $Id$
18 */
19
20#include <assert.h>
21#include "system.h"
22
23int Preempt_task_Count;
24
25void Preempt_task()
26{
27  ER       status;
28  T_RTSK   pk_rtsk;
29
30  puts( "PREEMPT - ref_tsk validation"  );
31  status = ref_tsk( &pk_rtsk, PREEMPT_TASK_ID );
32  fatal_directive_status( status, E_OK , "ref_tsk of PREEMPT");
33  assert( pk_rtsk.tskpri  == PREEMPT_PRIORITY );
34  assert( pk_rtsk.itskpri == PREEMPT_PRIORITY );
35  assert( pk_rtsk.task    == Preempt_task );
36  assert( pk_rtsk.stksz   >= RTEMS_MINIMUM_STACK_SIZE );
37  assert( pk_rtsk.tskstat == (TTS_RUN | TTS_RDY) );
38
39  if ( Preempt_task_Count == 0 ) {
40    Preempt_task_Count ++;
41    puts( "PREEMPT - chg_pri increment priority ");
42    status = chg_pri( PREEMPT_TASK_ID, (PREEMPT_PRIORITY+1) );
43    directive_failed( status, "chg_pri" );
44    puts( "PREEMPT - ext_tsk - going to DORMANT state" );
45    ext_tsk( );
46    assert( 0 );
47  } else {
48    Preempt_task_Count ++;
49    puts( "PREEMPT - exd_tsk - Exit and Delete task" );
50    exd_tsk(  );
51    assert( 0 );
52  }
53}
54
Note: See TracBrowser for help on using the repository browser.