source: rtems/testsuites/tmtests/tm18/task1.c @ 7f6a24ab

4.104.114.84.95
Last change on this file since 7f6a24ab was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/11/95 at 17:39:37

Initial revision

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*
2 *
3 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
4 *  On-Line Applications Research Corporation (OAR).
5 *  All rights assigned to U.S. Government, 1994.
6 *
7 *  This material may be reproduced by or for the U.S. Government pursuant
8 *  to the copyright license under the clause at DFARS 252.227-7013.  This
9 *  notice must appear in all copies of this file and its derivatives.
10 *
11 *  $Id$
12 */
13
14#include "system.h"
15#undef EXTERN
16#define EXTERN
17#include "conftbl.h"
18#include "gvar.h"
19
20rtems_unsigned32 taskcount;
21rtems_task_priority taskpri;
22
23rtems_task First_task(
24  rtems_task_argument argument
25);
26
27rtems_task Middle_tasks(
28  rtems_task_argument argument
29);
30
31rtems_task Last_task(
32  rtems_task_argument argument
33);
34
35
36void test_init();
37
38rtems_task Init(
39  rtems_task_argument argument
40)
41{
42  rtems_status_code status;
43
44  puts( "\n\n*** TIME TEST 18 ***" );
45
46  test_init();
47
48  status = rtems_task_delete( RTEMS_SELF );
49  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
50}
51
52void test_init()
53{
54  rtems_id          id;
55  rtems_task_entry  task_entry;
56  rtems_unsigned32  index;
57  rtems_status_code status;
58
59  for ( index = 0 ; index <= OPERATION_COUNT ; index++ ) {
60    status = rtems_task_create(
61      rtems_build_name( 'T', 'I', 'M', 'E' ),
62      128,
63      1024,
64      RTEMS_DEFAULT_MODES,
65      RTEMS_DEFAULT_ATTRIBUTES,
66      &id
67    );
68    directive_failed( status, "rtems_task_create loop" );
69
70    if ( index == OPERATION_COUNT ) task_entry = Last_task;
71    else if ( index == 0 )          task_entry = First_task;
72    else                            task_entry = Middle_tasks;
73
74
75    status = rtems_task_start( id, task_entry, 0 );
76    directive_failed( status, "rtems_task_start loop" );
77  }
78
79}
80
81rtems_task First_task(
82  rtems_task_argument argument
83)
84{
85  Timer_initialize();
86
87  (void) rtems_task_delete( RTEMS_SELF );
88}
89
90rtems_task Middle_tasks(
91  rtems_task_argument argument
92)
93{
94  (void) rtems_task_delete( RTEMS_SELF );
95}
96
97rtems_task Last_task(
98  rtems_task_argument argument
99)
100{
101  end_time = Read_timer();
102
103  put_time(
104    "rtems_task_delete self",
105    end_time,
106    OPERATION_COUNT,
107    0,
108    CALLING_OVERHEAD_TASK_DELETE
109  );
110
111  exit( 0 );
112}
Note: See TracBrowser for help on using the repository browser.