source: rtems/c/src/ada-tests/sptests/sp25/sptest.adb @ f619250

4.115
Last change on this file since f619250 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on May 3, 2012 at 3:09:24 PM

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 10.7 KB
Line 
1--
2--  SPTEST / BODY
3--
4--  DESCRIPTION:
5--
6--  This package is the implementation of Test 25 of the RTEMS
7--  Single Processor Test Suite.
8--
9--  DEPENDENCIES:
10--
11-- 
12--
13--  COPYRIGHT (c) 1989-2011.
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
21with TEST_SUPPORT;
22with TEXT_IO;
23with UNSIGNED32_IO;
24with RTEMS.REGION;
25
26package body SPTEST is
27
28--
29--  INIT
30--
31
32   procedure INIT (
33      ARGUMENT : in     RTEMS.TASKS.ARGUMENT
34   ) is
35      pragma Unreferenced(ARGUMENT);
36      STATUS : RTEMS.STATUS_CODES;
37   begin
38
39      TEXT_IO.NEW_LINE( 2 );
40      TEXT_IO.PUT_LINE( "*** TEST 25 ***" );
41
42      SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME(  'T', 'A', '1', ' ' );
43
44      RTEMS.TASKS.CREATE( 
45         SPTEST.TASK_NAME( 1 ), 
46         SPTEST.BASE_PRIORITY, 
47         2048, 
48         RTEMS.DEFAULT_MODES,
49         RTEMS.DEFAULT_ATTRIBUTES,
50         SPTEST.TASK_ID( 1 ),
51         STATUS
52      );
53      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
54
55      RTEMS.TASKS.START(
56         SPTEST.TASK_ID( 1 ),
57         SPTEST.TASK_1'ACCESS,
58         0,
59         STATUS
60      );
61      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
62
63      SPTEST.REGION_NAME( 1 ) := RTEMS.BUILD_NAME(  'R', 'N', '1', ' ' );
64
65      RTEMS.REGION.CREATE(
66         SPTEST.REGION_NAME( 1 ), 
67         SPTEST.AREA_1'ADDRESS,
68         64000, 
69         32,
70         RTEMS.DEFAULT_ATTRIBUTES,
71         SPTEST.REGION_ID( 1 ),
72         STATUS
73      );
74      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN1" );
75
76      RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
77      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
78
79   end INIT;
80
81--
82--  PUT_ADDRESS_FROM_AREA_1
83--
84
85   procedure PUT_ADDRESS_FROM_AREA_1 (
86      TO_BE_PRINTED : in     RTEMS.ADDRESS
87   ) is
88
89   begin
90
91      UNSIGNED32_IO.PUT(
92         RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_1'ADDRESS ),
93         WIDTH => 8,
94         BASE => 16
95      );
96
97   end PUT_ADDRESS_FROM_AREA_1;
98
99--
100--  TASK_1
101--
102
103   procedure TASK_1 (
104      ARGUMENT : in     RTEMS.TASKS.ARGUMENT
105   ) is
106      pragma Unreferenced(ARGUMENT);
107      RNID              : RTEMS.ID;
108      SEGMENT_ADDRESS_1 : RTEMS.ADDRESS;
109      SEGMENT_ADDRESS_2 : RTEMS.ADDRESS;
110      SEGMENT_ADDRESS_3 : RTEMS.ADDRESS;
111      SEGMENT_ADDRESS_4 : RTEMS.ADDRESS;
112      SEGMENT_ADDRESS_5 : RTEMS.ADDRESS;
113      SEGMENT_ADDRESS_6 : RTEMS.ADDRESS;
114      SEGMENT_ADDRESS_7 : RTEMS.ADDRESS;
115      SEGMENT_ADDRESS_8 : RTEMS.ADDRESS;
116      STATUS            : RTEMS.STATUS_CODES;
117   begin
118
119      RTEMS.REGION.IDENT( SPTEST.REGION_NAME( 1 ), RNID, STATUS );
120      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_IDENT OF RN1" );
121      TEXT_IO.PUT( "TA1 - region_ident - rnid => " );
122      UNSIGNED32_IO.PUT( RNID, WIDTH => 8, BASE => 16 );
123      TEXT_IO.NEW_LINE;
124       
125      TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
126      TEXT_IO.PUT_LINE( "64 byte segment from region 1" );
127      RTEMS.REGION.GET_SEGMENT(
128         SPTEST.REGION_ID( 1 ),
129         64,
130         RTEMS.DEFAULT_OPTIONS,
131         RTEMS.NO_TIMEOUT,
132         SEGMENT_ADDRESS_1,
133         STATUS
134      );
135      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
136      TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
137      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 );
138      TEXT_IO.NEW_LINE;
139
140      TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
141      TEXT_IO.PUT_LINE( "128 byte segment from region 1" );
142      RTEMS.REGION.GET_SEGMENT(
143         SPTEST.REGION_ID( 1 ),
144         128,
145         RTEMS.DEFAULT_OPTIONS,
146         RTEMS.NO_TIMEOUT,
147         SEGMENT_ADDRESS_2,
148         STATUS
149      );
150      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
151      TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
152      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_2 );
153      TEXT_IO.NEW_LINE;
154
155      TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
156      TEXT_IO.PUT_LINE( "256 byte segment from region 1" );
157      RTEMS.REGION.GET_SEGMENT(
158         SPTEST.REGION_ID( 1 ),
159         256,
160         RTEMS.DEFAULT_OPTIONS,
161         RTEMS.NO_TIMEOUT,
162         SEGMENT_ADDRESS_3,
163         STATUS
164      );
165      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
166      TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
167      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_3 );
168      TEXT_IO.NEW_LINE;
169
170      TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
171      TEXT_IO.PUT_LINE( "512 byte segment from region 1" );
172      RTEMS.REGION.GET_SEGMENT(
173         SPTEST.REGION_ID( 1 ),
174         512,
175         RTEMS.DEFAULT_OPTIONS,
176         RTEMS.NO_TIMEOUT,
177         SEGMENT_ADDRESS_4,
178         STATUS
179      );
180      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
181      TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
182      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 );
183      TEXT_IO.NEW_LINE;
184
185      TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
186      TEXT_IO.PUT_LINE( "1024 byte segment from region 1" );
187      RTEMS.REGION.GET_SEGMENT(
188         SPTEST.REGION_ID( 1 ),
189         1024,
190         RTEMS.DEFAULT_OPTIONS,
191         RTEMS.NO_TIMEOUT,
192         SEGMENT_ADDRESS_5,
193         STATUS
194      );
195      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
196      TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
197      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_5 );
198      TEXT_IO.NEW_LINE;
199
200      TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
201      TEXT_IO.PUT_LINE( "2048 byte segment from region 1" );
202      RTEMS.REGION.GET_SEGMENT(
203         SPTEST.REGION_ID( 1 ),
204         2048,
205         RTEMS.DEFAULT_OPTIONS,
206         RTEMS.NO_TIMEOUT,
207         SEGMENT_ADDRESS_6,
208         STATUS
209      );
210      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
211      TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
212      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_6 );
213      TEXT_IO.NEW_LINE;
214
215      TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
216      TEXT_IO.PUT_LINE( "4096 byte segment from region 1" );
217      RTEMS.REGION.GET_SEGMENT(
218         SPTEST.REGION_ID( 1 ),
219         4096,
220         RTEMS.DEFAULT_OPTIONS,
221         RTEMS.NO_TIMEOUT,
222         SEGMENT_ADDRESS_7,
223         STATUS
224      );
225      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
226      TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
227      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_7 );
228      TEXT_IO.NEW_LINE;
229
230      TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
231      TEXT_IO.PUT_LINE( "8192 byte segment from region 1" );
232      RTEMS.REGION.GET_SEGMENT(
233         SPTEST.REGION_ID( 1 ),
234         8192,
235         RTEMS.DEFAULT_OPTIONS,
236         RTEMS.NO_TIMEOUT,
237         SEGMENT_ADDRESS_8,
238         STATUS
239      );
240      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
241      TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
242      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_8 );
243      TEXT_IO.NEW_LINE;
244
245TEST_SUPPORT.PAUSE;
246
247      TEXT_IO.PUT( 
248         "TA1 - region_return_segment - return segment to region 1 - "
249      );
250      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_3 );
251      RTEMS.REGION.RETURN_SEGMENT(
252         SPTEST.REGION_ID( 1 ),
253         SEGMENT_ADDRESS_3,
254         STATUS
255      );
256      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
257      TEXT_IO.NEW_LINE;
258      -- SEGMENT_ADDRESS_3 := RTEMS.NULL_ADDRESS;
259
260      TEXT_IO.PUT( 
261         "TA1 - region_return_segment - return segment to region 1 - "
262      );
263      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 );
264      RTEMS.REGION.RETURN_SEGMENT(
265         SPTEST.REGION_ID( 1 ),
266         SEGMENT_ADDRESS_4,
267         STATUS
268      );
269      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
270      TEXT_IO.NEW_LINE;
271      -- SEGMENT_ADDRESS_4 := RTEMS.NULL_ADDRESS;
272
273      TEXT_IO.PUT( 
274         "TA1 - region_return_segment - return segment to region 1 - "
275      );
276      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 );
277      RTEMS.REGION.RETURN_SEGMENT(
278         SPTEST.REGION_ID( 1 ),
279         SEGMENT_ADDRESS_1,
280         STATUS
281      );
282      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
283      TEXT_IO.NEW_LINE;
284      -- SEGMENT_ADDRESS_1 := RTEMS.NULL_ADDRESS;
285
286      TEXT_IO.PUT( 
287         "TA1 - region_return_segment - return segment to region 1 - "
288      );
289      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_2 );
290      RTEMS.REGION.RETURN_SEGMENT(
291         SPTEST.REGION_ID( 1 ),
292         SEGMENT_ADDRESS_2,
293         STATUS
294      );
295      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
296      TEXT_IO.NEW_LINE;
297      -- SEGMENT_ADDRESS_2 := RTEMS.NULL_ADDRESS;
298
299      TEXT_IO.PUT( 
300         "TA1 - region_return_segment - return segment to region 1 - "
301      );
302      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_7 );
303      RTEMS.REGION.RETURN_SEGMENT(
304         SPTEST.REGION_ID( 1 ),
305         SEGMENT_ADDRESS_7,
306         STATUS
307      );
308      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
309      TEXT_IO.NEW_LINE;
310      -- SEGMENT_ADDRESS_7 := RTEMS.NULL_ADDRESS;
311
312      TEXT_IO.PUT( 
313         "TA1 - region_return_segment - return segment to region 1 - "
314      );
315      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_6 );
316      RTEMS.REGION.RETURN_SEGMENT(
317         SPTEST.REGION_ID( 1 ),
318         SEGMENT_ADDRESS_6,
319         STATUS
320      );
321      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
322      TEXT_IO.NEW_LINE;
323      -- SEGMENT_ADDRESS_6 := RTEMS.NULL_ADDRESS;
324
325      TEXT_IO.PUT( 
326         "TA1 - region_return_segment - return segment to region 1 - "
327      );
328      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_8 );
329      RTEMS.REGION.RETURN_SEGMENT(
330         SPTEST.REGION_ID( 1 ),
331         SEGMENT_ADDRESS_8,
332         STATUS
333      );
334      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
335      TEXT_IO.NEW_LINE;
336      -- SEGMENT_ADDRESS_8 := RTEMS.NULL_ADDRESS;
337
338      TEXT_IO.PUT( 
339         "TA1 - region_return_segment - return segment to region 1 - "
340      );
341      SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_5 );
342      RTEMS.REGION.RETURN_SEGMENT(
343         SPTEST.REGION_ID( 1 ),
344         SEGMENT_ADDRESS_5,
345         STATUS
346      );
347      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
348      TEXT_IO.NEW_LINE;
349      -- SEGMENT_ADDRESS_5 := RTEMS.NULL_ADDRESS;
350
351      TEXT_IO.PUT_LINE(
352         "TA1 - region_delete - walks heap if debug enabled"
353      );
354      RTEMS.REGION.DELETE( SPTEST.REGION_ID( 1 ), STATUS );
355      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_DELETE OF RN1" );
356
357      TEXT_IO.PUT_LINE( "*** END OF TEST 25 ***" );
358      RTEMS.SHUTDOWN_EXECUTIVE( 0 );
359
360   end TASK_1;
361
362end SPTEST;
Note: See TracBrowser for help on using the repository browser.