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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [tests/] [itrontests/] [itrontask03/] [preempt.c] - Blame information for rev 507

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

Line No. Rev Author Line
1 30 unneback
/*  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: preempt.c,v 1.2 2001-09-27 12:02:11 chris 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.