source: rtems/testsuites/libtests/monitor/init.c @ 5a8e7503

4.104.114.95
Last change on this file since 5a8e7503 was 5a8e7503, checked in by Joel Sherrill <joel.sherrill@…>, on 02/01/08 at 00:45:04

2008-01-31 Joel Sherrill <joel.sherrill@…>

  • cpuuse/init.c, malloctest/init.c, monitor/init.c, monitor02/init.c, putenvtest/init.c, rtems++/Init.cc, rtmonuse/init.c, stackchk/init.c: Change TEST_INIT to CONFIGURE_INIT. Make tmacros.h available to all POSIX tests. Add a clock_settime case for < 1988.
  • 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 CONFIGURE_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_task_argument 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.