source: rtems/testsuites/tmtests/tm28/task1.c @ 03f2154e

4.104.114.84.95
Last change on this file since 03f2154e was 03f2154e, checked in by Joel Sherrill <joel.sherrill@…>, on 04/22/97 at 17:20:27

headers updated to reflect new style copyright notice as part
of switching to the modified GNU GPL.

  • Property mode set to 100644
File size: 2.7 KB
Line 
1/*
2 *
3 *  COPYRIGHT (c) 1989-1997.
4 *  On-Line Applications Research Corporation (OAR).
5 *  Copyright assigned to U.S. Government, 1994.
6 *
7 *  The license and distribution terms for this file may in
8 *  the file LICENSE in this distribution or at
9 *  http://www.OARcorp.com/rtems/license.html.
10 *
11 *  $Id$
12 */
13
14#define TEST_INIT
15#include "system.h"
16
17rtems_id Port_id;
18
19rtems_unsigned8 Internal_area[ 256 ] CPU_STRUCTURE_ALIGNMENT;
20rtems_unsigned8 External_area[ 256 ] CPU_STRUCTURE_ALIGNMENT;
21
22rtems_task Test_task(
23  rtems_task_argument argument
24);
25
26rtems_task Init(
27  rtems_task_argument argument
28)
29{
30  rtems_status_code status;
31
32  Print_Warning();
33
34  puts( "\n\n*** TIME TEST 28 ***" );
35
36  status = rtems_task_create(
37    rtems_build_name( 'T', 'I', 'M', 'E' ),
38    128,
39    RTEMS_MINIMUM_STACK_SIZE,
40    RTEMS_DEFAULT_MODES,
41    RTEMS_DEFAULT_ATTRIBUTES,
42    &Task_id[ 1 ]
43  );
44  directive_failed( status, "rtems_task_create" );
45
46  status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
47  directive_failed( status, "rtems_task_start" );
48
49  status = rtems_task_delete( RTEMS_SELF );
50  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
51}
52
53rtems_task Test_task (
54  rtems_task_argument argument
55)
56{
57  rtems_name         name;
58  rtems_unsigned32   index;
59  void              *converted;
60
61  Timer_initialize();
62    for ( index=1 ; index <= OPERATION_COUNT ; index++ )
63      (void) Empty_function();
64  overhead = Read_timer();
65
66  name = rtems_build_name( 'P', 'O', 'R', 'T' ),
67
68  Timer_initialize();
69    rtems_port_create(
70      name,
71      Internal_area,
72      External_area,
73      0xff,
74      &Port_id
75    );
76  end_time = Read_timer();
77
78  put_time(
79    "rtems_port_create",
80    end_time,
81    1,
82    0,
83    CALLING_OVERHEAD_PORT_CREATE
84  );
85
86  Timer_initialize();
87    for ( index=1 ; index <= OPERATION_COUNT ; index++ )
88      (void) rtems_port_external_to_internal(
89               Port_id,
90               &External_area[ 0xf ],
91               &converted
92             );
93  end_time = Read_timer();
94
95  put_time(
96    "rtems_port_external_to_internal",
97    end_time,
98    OPERATION_COUNT,
99    overhead,
100    CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL
101  );
102
103  Timer_initialize();
104    for ( index=1 ; index <= OPERATION_COUNT ; index++ )
105      (void) rtems_port_internal_to_external(
106               Port_id,
107               &Internal_area[ 0xf ],
108               &converted
109             );
110  end_time = Read_timer();
111
112  put_time(
113    "rtems_port_internal_to_external",
114    end_time,
115    OPERATION_COUNT,
116    overhead,
117    CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL
118  );
119
120  Timer_initialize();
121    rtems_port_delete( Port_id );
122  end_time = Read_timer();
123
124  put_time(
125    "rtems_port_delete",
126    end_time,
127    1,
128    0,
129    CALLING_OVERHEAD_PORT_DELETE
130  );
131
132  puts( "*** END OF TEST 28 ***" );
133  exit( 0 );
134}
Note: See TracBrowser for help on using the repository browser.