source: rtems/testsuites/tmtests/tm28/task1.c @ 3a4ae6c

4.104.114.84.95
Last change on this file since 3a4ae6c was 3a4ae6c, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 11, 1995 at 7:35:39 PM

The word "RTEMS" almost completely removed from the core.

Configuration Table Template file added and all tests
modified to use this. All gvar.h and conftbl.h files
removed from test directories.

Configuration parameter maximum_devices added.

Core semaphore and mutex handlers added and RTEMS API Semaphore
Manager updated to reflect this.

Initialization sequence changed to invoke API specific initialization
routines. Initialization tasks table now owned by RTEMS Tasks Manager.

Added user extension for post-switch.

Utilized user extensions to implement API specific functionality
like signal dispatching.

Added extensions to the System Initialization Thread so that an
API can register a function to be invoked while the system
is being initialized. These are largely equivalent to the
pre-driver and post-driver hooks.

Added the Modules file oar-go32_p5, modified oar-go32, and modified
the file make/custom/go32.cfg to look at an environment varable which
determines what CPU model is being used.

All BSPs updated to reflect named devices and clock driver's IOCTL
used by the Shared Memory Driver. Also merged clock isr into
main file and removed ckisr.c where possible.

Updated spsize to reflect new and moved variables.

Makefiles for the executive source and include files updated to show
break down of files into Core, RTEMS API, and Neither.

Header and inline files installed into subdirectory based on whether
logically in the Core or a part of the RTEMS API.

  • 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#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    4096,
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.