[f37e656d] | 1 | /* |
---|
| 2 | * This is a simple test whose only purpose is to start the Monitor |
---|
| 3 | * task. The Monitor task can be used to obtain information about |
---|
[8f71a36] | 4 | * a variety of RTEMS objects. |
---|
[f37e656d] | 5 | * |
---|
[08311cc3] | 6 | * COPYRIGHT (c) 1989-1999. |
---|
[f37e656d] | 7 | * On-Line Applications Research Corporation (OAR). |
---|
| 8 | * |
---|
[98e4ebf5] | 9 | * The license and distribution terms for this file may be |
---|
| 10 | * found in the file LICENSE in this distribution or at |
---|
[2abdd87] | 11 | * http://www.rtems.com/license/LICENSE. |
---|
[f37e656d] | 12 | * |
---|
[6f9c75c3] | 13 | * $Id$ |
---|
[f37e656d] | 14 | */ |
---|
| 15 | |
---|
| 16 | #define TEST_INIT |
---|
| 17 | #include "system.h" |
---|
| 18 | |
---|
| 19 | #include <rtems/monitor.h> |
---|
| 20 | |
---|
| 21 | rtems_task_priority Priorities[6] = { 0, 1, 1, 3, 4, 5 }; |
---|
| 22 | |
---|
| 23 | rtems_task Task_1_through_5( |
---|
[9919946a] | 24 | uint32_t argument |
---|
[f37e656d] | 25 | ) |
---|
| 26 | { |
---|
| 27 | rtems_status_code status; |
---|
| 28 | |
---|
| 29 | for ( ; ; ) { |
---|
| 30 | status = rtems_task_wake_after( 100 ); |
---|
| 31 | directive_failed( status, "rtems_task_wake_after" ); |
---|
| 32 | } |
---|
| 33 | } |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | rtems_task Init( |
---|
| 38 | rtems_task_argument argument |
---|
| 39 | ) |
---|
| 40 | { |
---|
[9919946a] | 41 | uint32_t index; |
---|
[f37e656d] | 42 | rtems_status_code status; |
---|
| 43 | |
---|
| 44 | puts( "\n\n*** MONITOR TASK TEST ***" ); |
---|
| 45 | |
---|
| 46 | Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); |
---|
| 47 | Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' ); |
---|
| 48 | Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' ); |
---|
| 49 | Task_name[ 4 ] = rtems_build_name( 'T', 'A', '4', ' ' ); |
---|
| 50 | Task_name[ 5 ] = rtems_build_name( 'T', 'A', '5', ' ' ); |
---|
| 51 | |
---|
| 52 | for ( index = 1 ; index <= 5 ; index++ ) { |
---|
| 53 | status = rtems_task_create( |
---|
| 54 | Task_name[ index ], |
---|
| 55 | Priorities[ index ], |
---|
| 56 | RTEMS_MINIMUM_STACK_SIZE * 4, |
---|
| 57 | RTEMS_DEFAULT_MODES, |
---|
| 58 | (index == 5) ? RTEMS_FLOATING_POINT : RTEMS_DEFAULT_ATTRIBUTES, |
---|
| 59 | &Task_id[ index ] |
---|
| 60 | ); |
---|
| 61 | directive_failed( status, "rtems_task_create loop" ); |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | for ( index = 1 ; index <= 5 ; index++ ) { |
---|
| 65 | status = rtems_task_start( Task_id[ index ], Task_1_through_5, index ); |
---|
| 66 | directive_failed( status, "rtems_task_start loop" ); |
---|
| 67 | } |
---|
| 68 | |
---|
| 69 | rtems_monitor_init( 0 ); |
---|
| 70 | |
---|
| 71 | status = rtems_task_delete( RTEMS_SELF ); |
---|
| 72 | directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); |
---|
| 73 | } |
---|