source: rtems/testsuites/tmtests/tm28/task1.c @ 4b374f36

4.104.114.84.95
Last change on this file since 4b374f36 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.8 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_id Port_id;
21
22rtems_unsigned8 Internal_area[ 256 ];
23rtems_unsigned8 External_area[ 256 ];
24
25rtems_task Test_task(
26  rtems_task_argument argument
27);
28
29rtems_task Init(
30  rtems_task_argument argument
31)
32{
33  rtems_status_code status;
34
35  puts( "\n\n*** TIME TEST 28 ***" );
36
37  status = rtems_task_create(
38    rtems_build_name( 'T', 'I', 'M', 'E' ),
39    128,
40    4096,
41    RTEMS_DEFAULT_MODES,
42    RTEMS_DEFAULT_ATTRIBUTES,
43    &Task_id[ 1 ]
44  );
45  directive_failed( status, "rtems_task_create" );
46
47  status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
48  directive_failed( status, "rtems_task_start" );
49
50  status = rtems_task_delete( RTEMS_SELF );
51  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
52}
53
54rtems_task Test_task (
55  rtems_task_argument argument
56)
57{
58  rtems_name         name;
59  rtems_unsigned32   index;
60  void              *converted;
61
62  Timer_initialize();
63    for ( index=1 ; index <= OPERATION_COUNT ; index++ )
64      (void) Empty_function();
65  overhead = Read_timer();
66
67  name = rtems_build_name( 'P', 'O', 'R', 'T' ),
68
69  Timer_initialize();
70    rtems_port_create(
71      name,
72      Internal_area,
73      External_area,
74      0xff,
75      &Port_id
76    );
77  end_time = Read_timer();
78
79  put_time(
80    "rtems_port_create",
81    end_time,
82    1,
83    0,
84    CALLING_OVERHEAD_PORT_CREATE
85  );
86
87  Timer_initialize();
88    for ( index=1 ; index <= OPERATION_COUNT ; index++ )
89      (void) rtems_port_external_to_internal(
90               Port_id,
91               &External_area[ 0xf ],
92               &converted
93             );
94  end_time = Read_timer();
95
96  put_time(
97    "rtems_port_external_to_internal",
98    end_time,
99    OPERATION_COUNT,
100    overhead,
101    CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL
102  );
103
104  Timer_initialize();
105    for ( index=1 ; index <= OPERATION_COUNT ; index++ )
106      (void) rtems_port_internal_to_external(
107               Port_id,
108               &Internal_area[ 0xf ],
109               &converted
110             );
111  end_time = Read_timer();
112
113  put_time(
114    "rtems_port_internal_to_external",
115    end_time,
116    OPERATION_COUNT,
117    overhead,
118    CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL
119  );
120
121  Timer_initialize();
122    rtems_port_delete( Port_id );
123  end_time = Read_timer();
124
125  put_time(
126    "rtems_port_delete",
127    end_time,
128    1,
129    0,
130    CALLING_OVERHEAD_PORT_DELETE
131  );
132
133  exit( 0 );
134}
Note: See TracBrowser for help on using the repository browser.