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/] [tmtests/] [tm18/] [task1.c] - Blame information for rev 484

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

Line No. Rev Author Line
1 30 unneback
/*
2
 *
3
 *  COPYRIGHT (c) 1989-1999.
4
 *  On-Line Applications Research Corporation (OAR).
5
 *
6
 *  The license and distribution terms for this file may be
7
 *  found in the file LICENSE in this distribution or at
8
 *  http://www.OARcorp.com/rtems/license.html.
9
 *
10
 *  $Id: task1.c,v 1.2 2001-09-27 12:02:43 chris Exp $
11
 */
12
 
13
#define TEST_INIT
14
#include "system.h"
15
 
16
rtems_unsigned32 taskcount;
17
rtems_task_priority taskpri;
18
 
19
rtems_task First_task(
20
  rtems_task_argument argument
21
);
22
 
23
rtems_task Middle_tasks(
24
  rtems_task_argument argument
25
);
26
 
27
rtems_task Last_task(
28
  rtems_task_argument argument
29
);
30
 
31
 
32
void test_init();
33
 
34
rtems_task Init(
35
  rtems_task_argument argument
36
)
37
{
38
  rtems_status_code status;
39
 
40
  Print_Warning();
41
 
42
  puts( "\n\n*** TIME TEST 18 ***" );
43
 
44
  test_init();
45
 
46
  status = rtems_task_delete( RTEMS_SELF );
47
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
48
}
49
 
50
void test_init()
51
{
52
  rtems_id          id;
53
  rtems_task_entry  task_entry;
54
  rtems_unsigned32  index;
55
  rtems_status_code status;
56
 
57
  for ( index = 0 ; index <= OPERATION_COUNT ; index++ ) {
58
    status = rtems_task_create(
59
      rtems_build_name( 'T', 'I', 'M', 'E' ),
60
      128,
61
      RTEMS_MINIMUM_STACK_SIZE,
62
      RTEMS_DEFAULT_MODES,
63
      RTEMS_DEFAULT_ATTRIBUTES,
64
      &id
65
    );
66
    directive_failed( status, "rtems_task_create loop" );
67
 
68
    if ( index == OPERATION_COUNT ) task_entry = Last_task;
69
    else if ( index == 0 )          task_entry = First_task;
70
    else                            task_entry = Middle_tasks;
71
 
72
 
73
    status = rtems_task_start( id, task_entry, 0 );
74
    directive_failed( status, "rtems_task_start loop" );
75
  }
76
 
77
}
78
 
79
rtems_task First_task(
80
  rtems_task_argument argument
81
)
82
{
83
  Timer_initialize();
84
 
85
  (void) rtems_task_delete( RTEMS_SELF );
86
}
87
 
88
rtems_task Middle_tasks(
89
  rtems_task_argument argument
90
)
91
{
92
  (void) rtems_task_delete( RTEMS_SELF );
93
}
94
 
95
rtems_task Last_task(
96
  rtems_task_argument argument
97
)
98
{
99
  end_time = Read_timer();
100
 
101
  put_time(
102
    "rtems_task_delete: calling task",
103
    end_time,
104
    OPERATION_COUNT,
105
    0,
106
    CALLING_OVERHEAD_TASK_DELETE
107
  );
108
 
109
  puts( "*** END OF TEST 18 ***" );
110
  exit( 0 );
111
}

powered by: WebSVN 2.1.0

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