source: rtems/testsuites/itrontests/itrontask03/preempt.c @ 3d54837

4.104.115
Last change on this file since 3d54837 was 1b4f2b30, checked in by Ralf Corsepius <ralf.corsepius@…>, on Apr 16, 2004 at 9:24:30 AM

Remove stray white spaces.

  • 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.rtems.com/license/LICENSE.
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}
Note: See TracBrowser for help on using the repository browser.