source: rtems/c/src/ada-tests/sptests/sp23/sptest.adb @ 2226a03c

Last change on this file since 2226a03c was 2226a03c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:43:40

2003-09-04 Joel Sherrill <joel@…>

  • samples/base_sp/base_sp.adb, samples/base_sp/config.h, samples/base_sp/sptest.adb, samples/base_sp/sptest.ads, samples/hello/config.h, samples/hello/hello.adb, samples/hello/sptest.adb, samples/hello/sptest.ads, samples/ticker/config.h, samples/ticker/sptest.adb, samples/ticker/sptest.ads, samples/ticker/ticker.adb, sptests/sp01/config.h, sptests/sp01/sp01.adb, sptests/sp01/sptest.adb, sptests/sp01/sptest.ads, sptests/sp02/config.h, sptests/sp02/sp02.adb, sptests/sp02/sptest.adb, sptests/sp02/sptest.ads, sptests/sp03/config.h, sptests/sp03/sp03.adb, sptests/sp03/sptest.adb, sptests/sp03/sptest.ads, sptests/sp04/config.h, sptests/sp04/sp04.adb, sptests/sp04/sptest.adb, sptests/sp04/sptest.ads, sptests/sp05/config.h, sptests/sp05/sp05.adb, sptests/sp05/sptest.adb, sptests/sp05/sptest.ads, sptests/sp06/config.h, sptests/sp06/sp06.adb, sptests/sp06/sptest.adb, sptests/sp06/sptest.ads, sptests/sp07/config.h, sptests/sp07/sp07.adb, sptests/sp07/sptest.adb, sptests/sp07/sptest.ads, sptests/sp08/config.h, sptests/sp08/sp08.adb, sptests/sp08/sptest.adb, sptests/sp08/sptest.ads, sptests/sp09/config.h, sptests/sp09/sp09.adb, sptests/sp09/sptest.adb, sptests/sp09/sptest.ads, sptests/sp11/config.h, sptests/sp11/sp11.adb, sptests/sp11/sptest.adb, sptests/sp11/sptest.ads, sptests/sp12/config.h, sptests/sp12/sp12.adb, sptests/sp12/sptest.adb, sptests/sp12/sptest.ads, sptests/sp13/config.h, sptests/sp13/sp13.adb, sptests/sp13/sptest.adb, sptests/sp13/sptest.ads, sptests/sp14/config.h, sptests/sp14/sp14.adb, sptests/sp14/sptest.adb, sptests/sp14/sptest.ads, sptests/sp15/config.h, sptests/sp15/sp15.adb, sptests/sp15/sptest.adb, sptests/sp15/sptest.ads, sptests/sp16/config.h, sptests/sp16/sp16.adb, sptests/sp16/sptest.adb, sptests/sp16/sptest.ads, sptests/sp17/config.h, sptests/sp17/sp17.adb, sptests/sp17/sptest.adb, sptests/sp17/sptest.ads, sptests/sp19/config.h, sptests/sp19/sp19.adb, sptests/sp19/sptest.ads, sptests/sp20/config.h, sptests/sp20/sp20.adb, sptests/sp20/sptest.adb, sptests/sp20/sptest.ads, sptests/sp21/config.h, sptests/sp21/sp21.adb, sptests/sp21/sptest.adb, sptests/sp21/sptest.ads, sptests/sp22/config.h, sptests/sp22/sp22.adb, sptests/sp22/sptest.adb, sptests/sp22/sptest.ads, sptests/sp23/config.h, sptests/sp23/sp23.adb, sptests/sp23/sptest.adb, sptests/sp23/sptest.ads, sptests/sp24/config.h, sptests/sp24/sp24.adb, sptests/sp24/sptest.adb, sptests/sp24/sptest.ads, sptests/sp25/config.h, sptests/sp25/sp25.adb, sptests/sp25/sptest.adb, sptests/sp25/sptest.ads, sptests/spsize/spsize.adb, sptests/spsize/sptest.adb, sptests/spsize/sptest.ads, support/address_io.adb, support/address_io.ads, support/float_io.ads, support/fp.inc, support/integer.inc, support/rtems_calling_overhead.ads, support/status_io.ads, support/test_support.adb, support/test_support.ads, support/time_test_support.adb, support/time_test_support.ads, support/timer_driver.adb, support/timer_driver.ads, support/unsigned32_io.ads, tmtests/tm01/config.h, tmtests/tm01/tm01.adb, tmtests/tm01/tmtest.adb, tmtests/tm01/tmtest.ads, tmtests/tm02/config.h, tmtests/tm02/tm02.adb, tmtests/tm02/tmtest.adb, tmtests/tm02/tmtest.ads, tmtests/tm03/config.h, tmtests/tm03/tm03.adb, tmtests/tm03/tmtest.adb, tmtests/tm03/tmtest.ads, tmtests/tm04/config.h, tmtests/tm04/tm04.adb, tmtests/tm04/tmtest.adb, tmtests/tm04/tmtest.ads, tmtests/tm05/config.h, tmtests/tm05/tm05.adb, tmtests/tm05/tmtest.adb, tmtests/tm05/tmtest.ads, tmtests/tm06/config.h, tmtests/tm06/tm06.adb, tmtests/tm06/tmtest.adb, tmtests/tm06/tmtest.ads, tmtests/tm07/config.h, tmtests/tm07/tm07.adb, tmtests/tm07/tmtest.adb, tmtests/tm07/tmtest.ads, tmtests/tm08/config.h, tmtests/tm08/tm08.adb, tmtests/tm08/tmtest.adb, tmtests/tm08/tmtest.ads, tmtests/tm09/config.h, tmtests/tm09/tm09.adb, tmtests/tm09/tmtest.adb, tmtests/tm09/tmtest.ads, tmtests/tm10/config.h, tmtests/tm10/tm10.adb, tmtests/tm10/tmtest.adb, tmtests/tm10/tmtest.ads, tmtests/tm11/config.h, tmtests/tm11/tm11.adb, tmtests/tm11/tmtest.adb, tmtests/tm11/tmtest.ads, tmtests/tm12/config.h, tmtests/tm12/tm12.adb, tmtests/tm12/tmtest.adb, tmtests/tm12/tmtest.ads, tmtests/tm13/config.h, tmtests/tm13/tm13.adb, tmtests/tm13/tmtest.adb, tmtests/tm13/tmtest.ads, tmtests/tm14/config.h, tmtests/tm14/tm14.adb, tmtests/tm14/tmtest.adb, tmtests/tm14/tmtest.ads, tmtests/tm15/config.h, tmtests/tm15/tm15.adb, tmtests/tm15/tmtest.adb, tmtests/tm15/tmtest.ads, tmtests/tm16/config.h, tmtests/tm16/tm16.adb, tmtests/tm16/tmtest.adb, tmtests/tm16/tmtest.ads, tmtests/tm17/config.h, tmtests/tm17/tm17.adb, tmtests/tm17/tmtest.adb, tmtests/tm17/tmtest.ads, tmtests/tm18/config.h, tmtests/tm18/tm18.adb, tmtests/tm18/tmtest.adb, tmtests/tm18/tmtest.ads, tmtests/tm19/config.h, tmtests/tm19/tm19.adb, tmtests/tm19/tmtest.adb, tmtests/tm19/tmtest.ads, tmtests/tm20/config.h, tmtests/tm20/tm20.adb, tmtests/tm20/tmtest.adb, tmtests/tm20/tmtest.ads, tmtests/tm21/config.h, tmtests/tm21/tm21.adb, tmtests/tm21/tmtest.adb, tmtests/tm21/tmtest.ads, tmtests/tm22/config.h, tmtests/tm22/tm22.adb, tmtests/tm22/tmtest.adb, tmtests/tm22/tmtest.ads, tmtests/tm23/config.h, tmtests/tm23/tm23.adb, tmtests/tm23/tmtest.adb, tmtests/tm23/tmtest.ads, tmtests/tm24/config.h, tmtests/tm24/tm24.adb, tmtests/tm24/tmtest.adb, tmtests/tm24/tmtest.ads, tmtests/tm25/config.h, tmtests/tm25/tm25.adb, tmtests/tm25/tmtest.adb, tmtests/tm25/tmtest.ads, tmtests/tm28/config.h, tmtests/tm28/tm28.adb, tmtests/tm28/tmtest.adb, tmtests/tm28/tmtest.ads, tmtests/tm29/config.h, tmtests/tm29/tm29.adb, tmtests/tm29/tmtest.adb, tmtests/tm29/tmtest.ads, tmtests/tmck/config.h, tmtests/tmck/tmck.adb, tmtests/tmck/tmtest.adb, tmtests/tmck/tmtest.ads, tmtests/tmoverhd/config.h, tmtests/tmoverhd/dummy_rtems.adb, tmtests/tmoverhd/dummy_rtems.ads, tmtests/tmoverhd/tmoverhd.adb, tmtests/tmoverhd/tmtest.adb, tmtests/tmoverhd/tmtest.ads: URL for license changed.
  • Property mode set to 100644
File size: 5.1 KB
Line 
1--
2--  SPTEST / BODY
3--
4--  DESCRIPTION:
5--
6--  This package is the implementation of Test 23 of the RTEMS
7--  Single Processor Test Suite.
8--
9--  DEPENDENCIES:
10--
11-- 
12--
13--  COPYRIGHT (c) 1989-1997.
14--  On-Line Applications Research Corporation (OAR).
15--
16--  The license and distribution terms for this file may in
17--  the file LICENSE in this distribution or at
18--  http://www.rtems.com/license/LICENSE.
19--
20--  $Id$
21--
22
23with ADDRESS_IO;
24with INTERFACES; use INTERFACES;
25with RTEMS;
26with TEST_SUPPORT;
27with TEXT_IO;
28with UNSIGNED32_IO;
29
30package body SPTEST is
31
32--PAGE
33--
34--  INIT
35--
36
37   procedure INIT (
38      ARGUMENT : in     RTEMS.TASK_ARGUMENT
39   ) is
40      INTERNAL_AREA : RTEMS.ADDRESS;
41      EXTERNAL_AREA : RTEMS.ADDRESS;
42      STATUS        : RTEMS.STATUS_CODES;
43   begin
44
45      TEXT_IO.NEW_LINE( 2 );
46      TEXT_IO.PUT_LINE( "*** TEST 23 ***" );
47
48      SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME(  'T', 'A', '1', ' ' );
49
50      RTEMS.TASK_CREATE(
51         SPTEST.TASK_NAME( 1 ),
52         1,
53         2048,
54         RTEMS.DEFAULT_MODES,
55         RTEMS.DEFAULT_ATTRIBUTES,
56         SPTEST.TASK_ID( 1 ),
57         STATUS
58      );
59      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
60
61      RTEMS.TASK_START(
62         SPTEST.TASK_ID( 1 ),
63         SPTEST.TASK_1'ACCESS,
64         0,
65         STATUS
66      );
67      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
68
69      SPTEST.PORT_NAME( 1 ) := RTEMS.BUILD_NAME(  'D', 'P', '1', ' ' );
70
71      INTERNAL_AREA := SPTEST.INTERNAL_PORT_AREA( 0 )'ADDRESS;
72      EXTERNAL_AREA := SPTEST.EXTERNAL_PORT_AREA( 0 )'ADDRESS;
73      RTEMS.PORT_CREATE(
74         SPTEST.PORT_NAME( 1 ),
75         INTERNAL_AREA,
76         EXTERNAL_AREA,
77         SPTEST.INTERNAL_PORT_AREA'LENGTH,
78         SPTEST.PORT_ID( 1 ),
79         STATUS
80      );
81      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_CREATE OF DP1" );
82      TEXT_IO.PUT( "INIT - port_create - DP1 - internal = " );
83      ADDRESS_IO.PUT( INTERNAL_AREA, WIDTH => 8, BASE => 16 );
84      TEXT_IO.PUT( " external =  " );
85      ADDRESS_IO.PUT( EXTERNAL_AREA, WIDTH => 8, BASE => 16 );
86      TEXT_IO.NEW_LINE;
87   
88      RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
89      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
90
91   end INIT;
92
93--PAGE
94--
95--  TASK_1
96--
97
98   procedure TASK_1 (
99      ARGUMENT : in     RTEMS.TASK_ARGUMENT
100   ) is
101      DPID            : RTEMS.ID;
102      TO_BE_CONVERTED : RTEMS.ADDRESS;
103      CONVERTED       : RTEMS.ADDRESS;
104      STATUS          : RTEMS.STATUS_CODES;
105   begin
106
107      RTEMS.PORT_IDENT( SPTEST.PORT_NAME( 1 ), DPID, STATUS );
108      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_IDENT" );
109      TEXT_IO.PUT( "TA1 - port_ident - " );
110      UNSIGNED32_IO.PUT( DPID, WIDTH => 8, BASE => 16 );
111      TEXT_IO.NEW_LINE;
112
113      TO_BE_CONVERTED :=  SPTEST.EXTERNAL_PORT_AREA( 16#E# )'ADDRESS;
114      RTEMS.PORT_EXTERNAL_TO_INTERNAL(
115         SPTEST.PORT_ID( 1 ),
116         TO_BE_CONVERTED,
117         CONVERTED,
118         STATUS
119      );
120      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_EXTERNAL_TO_INTERNAL" );
121      TEXT_IO.PUT( "TA1 - port_external_to_internal - external: " );
122      ADDRESS_IO.PUT( TO_BE_CONVERTED, WIDTH => 8, BASE => 16 );
123      TEXT_IO.PUT( " => internal: " );
124      ADDRESS_IO.PUT( CONVERTED, WIDTH => 8, BASE => 16 );
125      TEXT_IO.NEW_LINE;
126   
127      TO_BE_CONVERTED :=  SPTEST.INTERNAL_PORT_AREA( 16#E# )'ADDRESS;
128      RTEMS.PORT_INTERNAL_TO_EXTERNAL(
129         SPTEST.PORT_ID( 1 ),
130         TO_BE_CONVERTED,
131         CONVERTED,
132         STATUS
133      );
134      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_INTERNAL_TO_EXTERNAL" );
135      TEXT_IO.PUT( "TA1 - port_internal_to_external - internal: " );
136      ADDRESS_IO.PUT( TO_BE_CONVERTED, WIDTH => 8, BASE => 16 );
137      TEXT_IO.PUT( " => external: " );
138      ADDRESS_IO.PUT( CONVERTED, WIDTH => 8, BASE => 16 );
139      TEXT_IO.NEW_LINE;
140   
141      TO_BE_CONVERTED :=  SPTEST.ABOVE_PORT_AREA( 16#E# )'ADDRESS;
142      RTEMS.PORT_EXTERNAL_TO_INTERNAL(
143         SPTEST.PORT_ID( 1 ),
144         TO_BE_CONVERTED,
145         CONVERTED,
146         STATUS
147      );
148      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_EXTERNAL_TO_INTERNAL" );
149      TEXT_IO.PUT( "TA1 - port_external_to_internal - external: " );
150      ADDRESS_IO.PUT( TO_BE_CONVERTED, WIDTH => 8, BASE => 16 );
151      TEXT_IO.PUT( " => internal: " );
152      ADDRESS_IO.PUT( CONVERTED, WIDTH => 8, BASE => 16 );
153      TEXT_IO.NEW_LINE;
154   
155      TO_BE_CONVERTED :=  SPTEST.BELOW_PORT_AREA( 16#E# )'ADDRESS;
156      RTEMS.PORT_INTERNAL_TO_EXTERNAL(
157         SPTEST.PORT_ID( 1 ),
158         TO_BE_CONVERTED,
159         CONVERTED,
160         STATUS
161      );
162      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_INTERNAL_TO_EXTERNAL" );
163      TEXT_IO.PUT( "TA1 - port_internal_to_external - internal: " );
164      ADDRESS_IO.PUT( TO_BE_CONVERTED, WIDTH => 8, BASE => 16 );
165      TEXT_IO.PUT( " => external: " );
166      ADDRESS_IO.PUT( CONVERTED, WIDTH => 8, BASE => 16 );
167      TEXT_IO.NEW_LINE;
168   
169      TEXT_IO.PUT_LINE( "TA1 - port_delete - DP1" );
170      RTEMS.PORT_DELETE( SPTEST.PORT_ID( 1 ), STATUS );
171      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_DELETE" );
172
173      TEXT_IO.PUT_LINE( "*** END OF TEST 23 ***" );
174      RTEMS.SHUTDOWN_EXECUTIVE( 0 );
175
176   end TASK_1;
177
178end SPTEST;
Note: See TracBrowser for help on using the repository browser.