4.104.115
Last change
on this file since 8de136b was
de7adaf,
checked in by Joel Sherrill <joel.sherrill@…>, on 08/12/09 at 20:50:26
|
2009-08-12 Joel Sherrill <joel.sherrill@…>
- malloctest/task1.c, stackchk/task1.c: Eliminate test routines
TICKS_PER_SECOND and get_ticks_per_second() in favor of new
rtems_clock_get_ticks_per_second().
|
-
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-2009. |
---|
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_tod( &time ); |
---|
31 | directive_failed( status, "rtems_clock_get_tod" ); |
---|
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_tod - ", &time, "\n" ); |
---|
39 | |
---|
40 | status = rtems_task_wake_after( |
---|
41 | task_number( tid ) * 5 * rtems_clock_get_ticks_per_second() ); |
---|
42 | directive_failed( status, "rtems_task_wake_after" ); |
---|
43 | } |
---|
44 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.