source: rtems/testsuites/libtests/monitor/init.c @ 9919946

4.104.114.84.9
Last change on this file since 9919946 was 9919946, checked in by Ralf Corsepius <ralf.corsepius@…>, on Mar 30, 2004 at 11:12:47 AM

2004-03-30 Ralf Corsepius <ralf_corsepius@…>

  • cpuuse/system.h, cpuuse/task1.c, cpuuse/tswitch.c, monitor/init.c, monitor/system.h, rtems++/System.h, rtems++/Task1.cc, rtems++/Task2.cc, rtems++/Task3.cc, rtmonuse/init.c, rtmonuse/system.h, rtmonuse/task1.c, stackchk/blow.c: Convert to using c99 fixed size types.
  • 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  uint32_t   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  uint32_t    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.