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

4.115
Last change on this file since abf78d5 was 7d3f9c6, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/22/11 at 07:37:03

Add HAVE_CONFIG_H.

  • 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#ifdef HAVE_CONFIG_H
17#include "config.h"
18#endif
19
20#define CONFIGURE_INIT
21#include "system.h"
22
23#include <rtems/monitor.h>
24
25rtems_task_priority Priorities[6] = { 0,   1,   1,   3,   4,   5 };
26
27rtems_task Task_1_through_5(
28  rtems_task_argument argument
29)
30{
31  rtems_status_code status;
32
33  for ( ; ; ) {
34    status = rtems_task_wake_after( 100 );
35    directive_failed( status, "rtems_task_wake_after" );
36  }
37}
38
39
40
41rtems_task Init(
42  rtems_task_argument argument
43)
44{
45  uint32_t    index;
46  rtems_status_code status;
47
48  puts( "\n\n*** MONITOR TASK TEST ***" );
49
50  Task_name[ 1 ] =  rtems_build_name( 'T', 'A', '1', ' ' );
51  Task_name[ 2 ] =  rtems_build_name( 'T', 'A', '2', ' ' );
52  Task_name[ 3 ] =  rtems_build_name( 'T', 'A', '3', ' ' );
53  Task_name[ 4 ] =  rtems_build_name( 'T', 'A', '4', ' ' );
54  Task_name[ 5 ] =  rtems_build_name( 'T', 'A', '5', ' ' );
55
56  for ( index = 1 ; index <= 5 ; index++ ) {
57    status = rtems_task_create(
58      Task_name[ index ],
59      Priorities[ index ],
60      RTEMS_MINIMUM_STACK_SIZE * 4,
61      RTEMS_DEFAULT_MODES,
62      (index == 5) ? RTEMS_FLOATING_POINT : RTEMS_DEFAULT_ATTRIBUTES,
63      &Task_id[ index ]
64    );
65    directive_failed( status, "rtems_task_create loop" );
66  }
67
68  for ( index = 1 ; index <= 5 ; index++ ) {
69    status = rtems_task_start( Task_id[ index ], Task_1_through_5, index );
70    directive_failed( status, "rtems_task_start loop" );
71  }
72
73  rtems_monitor_init( 0 );
74
75  status = rtems_task_delete( RTEMS_SELF );
76  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
77}
Note: See TracBrowser for help on using the repository browser.