source: rtems/testsuites/libtests/monitor/init.c @ 60b791ad

4.104.114.84.95
Last change on this file since 60b791ad was 60b791ad, checked in by Joel Sherrill <joel.sherrill@…>, on 02/17/98 at 23:46:28

updated copyright to 1998

  • Property mode set to 100644
File size: 1.9 KB
Line 
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
4 *  a variety of RTEMS objects. 
5 *
6 *  COPYRIGHT (c) 1989-1998.
7 *  On-Line Applications Research Corporation (OAR).
8 *  Copyright assigned to U.S. Government, 1994.
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17#define TEST_INIT
18#include "system.h"
19
20#include <rtems/monitor.h>
21
22rtems_task_priority Priorities[6] = { 0,   1,   1,   3,   4,   5 };
23
24rtems_task Task_1_through_5(
25  rtems_unsigned32 argument
26)
27{
28  rtems_status_code status;
29
30  for ( ; ; ) {
31    status = rtems_task_wake_after( 100 );
32    directive_failed( status, "rtems_task_wake_after" );
33  }
34}
35
36
37
38rtems_task Init(
39  rtems_task_argument argument
40)
41{
42  rtems_unsigned32  index;
43  rtems_status_code status;
44
45  puts( "\n\n*** MONITOR TASK TEST ***" );
46
47  Task_name[ 1 ] =  rtems_build_name( 'T', 'A', '1', ' ' );
48  Task_name[ 2 ] =  rtems_build_name( 'T', 'A', '2', ' ' );
49  Task_name[ 3 ] =  rtems_build_name( 'T', 'A', '3', ' ' );
50  Task_name[ 4 ] =  rtems_build_name( 'T', 'A', '4', ' ' );
51  Task_name[ 5 ] =  rtems_build_name( 'T', 'A', '5', ' ' );
52
53  for ( index = 1 ; index <= 5 ; index++ ) {
54    status = rtems_task_create(
55      Task_name[ index ],
56      Priorities[ index ],
57      RTEMS_MINIMUM_STACK_SIZE * 4,
58      RTEMS_DEFAULT_MODES,
59      (index == 5) ? RTEMS_FLOATING_POINT : RTEMS_DEFAULT_ATTRIBUTES,
60      &Task_id[ index ]
61    );
62    directive_failed( status, "rtems_task_create loop" );
63  }
64
65  for ( index = 1 ; index <= 5 ; index++ ) {
66    status = rtems_task_start( Task_id[ index ], Task_1_through_5, index );
67    directive_failed( status, "rtems_task_start loop" );
68  }
69
70  rtems_monitor_init( 0 );
71
72  status = rtems_task_delete( RTEMS_SELF );
73  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
74}
Note: See TracBrowser for help on using the repository browser.