OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [tests/] [libtests/] [monitor/] [init.c] - Blame information for rev 621

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
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.OARcorp.com/rtems/license.html.
12
 *
13
 *  $Id: init.c,v 1.2 2001-09-27 12:02:12 chris Exp $
14
 */
15
 
16
#define TEST_INIT
17
#include "system.h"
18
 
19
#include <rtems/monitor.h>
20
 
21
rtems_task_priority Priorities[6] = { 0,   1,   1,   3,   4,   5 };
22
 
23
rtems_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
 
37
rtems_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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.