[bd1b8de] | 1 | /* Task_1_through_3 |
---|
| 2 | * |
---|
| 3 | * This routine serves as a test task. It verifies the basic task |
---|
| 4 | * switching capabilities of the executive. |
---|
| 5 | * |
---|
| 6 | * Input parameters: |
---|
| 7 | * argument - task argument |
---|
| 8 | * |
---|
| 9 | * Output parameters: NONE |
---|
| 10 | * |
---|
| 11 | * COPYRIGHT (c) 1989-1999. |
---|
| 12 | * On-Line Applications Research Corporation (OAR). |
---|
| 13 | * |
---|
| 14 | * The license and distribution terms for this file may be |
---|
| 15 | * found in the file LICENSE in this distribution or at |
---|
| 16 | * http://www.rtems.com/license/LICENSE. |
---|
| 17 | * |
---|
| 18 | * $Id$ |
---|
| 19 | */ |
---|
| 20 | |
---|
[4e8589d] | 21 | #ifdef HAVE_CONFIG_H |
---|
| 22 | #include "config.h" |
---|
| 23 | #endif |
---|
| 24 | |
---|
[bd1b8de] | 25 | #include "system.h" |
---|
| 26 | |
---|
| 27 | rtems_task Task_1_through_3( |
---|
| 28 | rtems_task_argument argument |
---|
| 29 | ) |
---|
| 30 | { |
---|
| 31 | rtems_id tid; |
---|
| 32 | rtems_time_of_day time; |
---|
| 33 | rtems_status_code status; |
---|
| 34 | rtems_interval ticks; |
---|
| 35 | |
---|
| 36 | status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); |
---|
| 37 | directive_failed( status, "rtems_task_ident" ); |
---|
| 38 | |
---|
| 39 | /* |
---|
| 40 | * Use TOD_MILLISECONDS_TO_TICKS not RTEMS_MILLISECONDS_TO_TICKS to |
---|
| 41 | * test C implementation in SuperCore -- not macro version used |
---|
| 42 | * everywhere else. |
---|
| 43 | */ |
---|
| 44 | ticks = TOD_MILLISECONDS_TO_TICKS( task_number( tid ) * 5 * 1000 ); |
---|
| 45 | |
---|
| 46 | while( FOREVER ) { |
---|
| 47 | status = rtems_clock_get_tod( &time ); |
---|
| 48 | directive_failed( status, "rtems_clock_get_tod" ); |
---|
| 49 | |
---|
| 50 | if ( time.second >= 35 ) { |
---|
| 51 | puts( "*** END OF CBS SCHEDULER TEST 1 ***" ); |
---|
| 52 | rtems_test_exit( 0 ); |
---|
| 53 | } |
---|
| 54 | |
---|
| 55 | put_name( Task_name[ task_number( tid ) ], FALSE ); |
---|
| 56 | print_time( " - rtems_clock_get_tod - ", &time, "\n" ); |
---|
| 57 | |
---|
| 58 | status = rtems_task_wake_after( ticks ); |
---|
| 59 | directive_failed( status, "rtems_task_wake_after" ); |
---|
| 60 | } |
---|
| 61 | } |
---|