OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [tests/] [itrontests/] [itrontask03/] [preempt.c] - Blame information for rev 1026

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  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
 *  preempt.c,v 1.4 1999/11/17 16:47:54 jennifer Exp
18
 */
19
 
20
#include <assert.h>
21
#include "system.h"
22
 
23
int Preempt_task_Count;
24
 
25
void 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
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.