source: rtems/testsuites/libtests/stackchk/task1.c @ 03f2154e

4.104.114.84.95
Last change on this file since 03f2154e was 03f2154e, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 22, 1997 at 5:20:27 PM

headers updated to reflect new style copyright notice as part
of switching to the modified GNU GPL.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*  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-1997.
7 *  On-Line Applications Research Corporation (OAR).
8 *  Copyright assigned to U.S. Government, 1994.
9 *
10 *  The license and distribution terms for this file may in
11 *  the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17#include "system.h"
18
19rtems_task Task_1_through_3(
20  rtems_task_argument argument
21)
22{
23  rtems_id          tid;
24  rtems_time_of_day time;
25  rtems_status_code status;
26
27  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
28  directive_failed( status, "rtems_task_ident" );
29
30  while( FOREVER ) {
31    status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
32    directive_failed( status, "rtems_clock_get" );
33
34    if ( time.second >= 15 && tid == Task_id[ 1 ] ) {
35       blow_stack();
36    }
37
38    put_name( Task_name[ task_number( tid ) ], FALSE );
39    print_time( " - rtems_clock_get - ", &time, "\n" );
40
41    status = rtems_task_wake_after( task_number( tid ) * 5 * TICKS_PER_SECOND );
42    directive_failed( status, "rtems_task_wake_after" );
43  }
44}
Note: See TracBrowser for help on using the repository browser.