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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [tests/] [libtests/] [stackchk/] [task1.c] - Blame information for rev 373

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

Line No. Rev Author Line
1 30 unneback
/*  task1.c
2
 *
3
 *  This set of three tasks do some simple task switching for about
4
 *  15 seconds and then call a routine to "blow the stack".
5
 *
6
 *  COPYRIGHT (c) 1989-1999.
7
 *  On-Line Applications Research Corporation (OAR).
8
 *
9
 *  The license and distribution terms for this file may be
10
 *  found in the file LICENSE in this distribution or at
11
 *  http://www.OARcorp.com/rtems/license.html.
12
 *
13
 *  $Id: task1.c,v 1.2 2001-09-27 12:02:13 chris Exp $
14
 */
15
 
16
#include "system.h"
17
 
18
rtems_task Task_1_through_3(
19
  rtems_task_argument argument
20
)
21
{
22
  rtems_id          tid;
23
  rtems_time_of_day time;
24
  rtems_status_code status;
25
 
26
  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
27
  directive_failed( status, "rtems_task_ident" );
28
 
29
  while( FOREVER ) {
30
    status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
31
    directive_failed( status, "rtems_clock_get" );
32
 
33
    if ( time.second >= 15 && tid == Task_id[ 1 ] ) {
34
       blow_stack();
35
    }
36
 
37
    put_name( Task_name[ task_number( tid ) ], FALSE );
38
    print_time( " - rtems_clock_get - ", &time, "\n" );
39
 
40
    status = rtems_task_wake_after( task_number( tid ) * 5 * TICKS_PER_SECOND );
41
    directive_failed( status, "rtems_task_wake_after" );
42
  }
43
}

powered by: WebSVN 2.1.0

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