[ac7d5ef0] | 1 | /* Task_1 |
---|
| 2 | * |
---|
| 3 | * This routine serves as a test task. It verifies the task manager. |
---|
| 4 | * |
---|
| 5 | * Input parameters: |
---|
| 6 | * argument - task argument |
---|
| 7 | * |
---|
| 8 | * Output parameters: NONE |
---|
| 9 | * |
---|
| 10 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
| 11 | * On-Line Applications Research Corporation (OAR). |
---|
| 12 | * All rights assigned to U.S. Government, 1994. |
---|
| 13 | * |
---|
| 14 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
| 15 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
| 16 | * notice must appear in all copies of this file and its derivatives. |
---|
| 17 | * |
---|
[eb5a7e07] | 18 | * $Id$ |
---|
[ac7d5ef0] | 19 | */ |
---|
| 20 | |
---|
| 21 | #include "system.h" |
---|
| 22 | |
---|
| 23 | rtems_task Task_1( |
---|
| 24 | rtems_task_argument argument |
---|
| 25 | ) |
---|
| 26 | { |
---|
| 27 | rtems_id tid2; |
---|
| 28 | rtems_id tid3; |
---|
| 29 | rtems_status_code status; |
---|
| 30 | rtems_unsigned32 previous_priority; |
---|
| 31 | |
---|
| 32 | puts( "TA1 - rtems_task_wake_after - sleep 1 second" ); |
---|
| 33 | status = rtems_task_wake_after( 1*TICKS_PER_SECOND ); |
---|
| 34 | directive_failed( status, "rtems_task_wake_after" ); |
---|
| 35 | |
---|
| 36 | status = rtems_task_ident( Task_name[ 2 ], RTEMS_SEARCH_ALL_NODES, &tid2 ); |
---|
| 37 | directive_failed( status, "rtems_task_ident of TA2" ); |
---|
| 38 | |
---|
| 39 | printf( "TA1 - rtems_task_ident - tid of TA2 (0x%.8x)\n", tid2 ); |
---|
| 40 | |
---|
| 41 | status = rtems_task_ident( Task_name[ 3 ], RTEMS_SEARCH_ALL_NODES, &tid3 ); |
---|
| 42 | directive_failed( status, "rtems_task_ident of TA3" ); |
---|
| 43 | |
---|
| 44 | printf( "TA1 - rtems_task_ident - tid of TA3 (0x%.8x)\n", tid3 ); |
---|
| 45 | |
---|
| 46 | status = rtems_task_set_priority( tid3, 2, &previous_priority ); |
---|
| 47 | directive_failed( status, "rtems_task_set_priority" ); |
---|
| 48 | |
---|
| 49 | puts( "TA1 - rtems_task_set_priority - set TA3's priority to 2" ); |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | puts( "TA1 - rtems_task_suspend - suspend TA2" ); |
---|
| 53 | status = rtems_task_suspend( tid2 ); |
---|
| 54 | directive_failed( status, "rtems_task_suspend of TA2" ); |
---|
| 55 | |
---|
| 56 | puts( "TA1 - rtems_task_delete - delete TA2" ); |
---|
| 57 | status = rtems_task_delete( tid2 ); |
---|
| 58 | directive_failed( status, "rtems_task_delete of TA2" ); |
---|
| 59 | |
---|
| 60 | puts( "TA1 - rtems_task_wake_after - sleep for 5 seconds" ); |
---|
| 61 | status = rtems_task_wake_after( 5*TICKS_PER_SECOND ); |
---|
| 62 | directive_failed( status, "rtems_task_wake_after" ); |
---|
| 63 | |
---|
| 64 | puts( "*** END OF TEST 2 ***" ); |
---|
| 65 | exit( 0 ); |
---|
| 66 | } |
---|