source:
rtems/testsuites/libtests/stackchk/task1.c
@
9919946a
Last change on this file since 9919946a was 2abdd87, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:53:27 | |
---|---|
|
|
File size: 1.1 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-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.rtems.com/license/LICENSE. |
12 | * |
13 | * $Id$ |
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 | } |
Note: See TracBrowser
for help on using the repository browser.