source: rtems/testsuites/libtests/monitor/init.c @ 4c84d7b

4.104.114.84.95
Last change on this file since 4c84d7b was 2abdd87, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:53:27

2003-09-04 Joel Sherrill <joel@…>

  • cpuuse/init.c, cpuuse/system.h, cpuuse/task1.c, cpuuse/task2.c, cpuuse/task3.c, cpuuse/tswitch.c, malloctest/init.c, malloctest/system.h, malloctest/task1.c, monitor/init.c, monitor/system.h, putenvtest/init.c, rtems++/Init.cc, rtems++/System.h, rtems++/Task1.cc, rtems++/Task2.cc, rtems++/Task3.cc, rtems++/rtems++.doc, rtmonuse/getall.c, rtmonuse/init.c, rtmonuse/system.h, rtmonuse/task1.c, stackchk/blow.c, stackchk/init.c, stackchk/system.h, stackchk/task1.c: URL for license changed.
  • 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-1999.
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#define TEST_INIT
17#include "system.h"
18
19#include <rtems/monitor.h>
20
21rtems_task_priority Priorities[6] = { 0,   1,   1,   3,   4,   5 };
22
23rtems_task Task_1_through_5(
24  rtems_unsigned32 argument
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
37rtems_task Init(
38  rtems_task_argument argument
39)
40{
41  rtems_unsigned32  index;
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}
Note: See TracBrowser for help on using the repository browser.