source: rtems/c/src/ada-tests/mptests/mp13/mptest.adb @ 3c4d8cd1

4.115
Last change on this file since 3c4d8cd1 was 3c4d8cd1, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 16, 2011 at 3:53:16 PM

2011-02-16 Joel Sherrill <joel.sherrill@…>

  • ada-tests/mptests/mp01/mp01.adb, ada-tests/mptests/mp01/mptest.adb, ada-tests/mptests/mp01/mptest.ads, ada-tests/mptests/mp01/node1/mp01_node1.adb, ada-tests/mptests/mp01/node2/mp01_node2.adb, ada-tests/mptests/mp02/mptest.adb, ada-tests/mptests/mp02/mptest.ads, ada-tests/mptests/mp02/node1/mp02_node1.adb, ada-tests/mptests/mp02/node2/mp02_node2.adb, ada-tests/mptests/mp03/mptest.adb, ada-tests/mptests/mp03/mptest.ads, ada-tests/mptests/mp03/node1/mp03_node1.adb, ada-tests/mptests/mp03/node2/mp03_node2.adb, ada-tests/mptests/mp04/mptest.adb, ada-tests/mptests/mp04/mptest.ads, ada-tests/mptests/mp04/node1/mp04_node1.adb, ada-tests/mptests/mp04/node2/mp04_node2.adb, ada-tests/mptests/mp05/mptest.adb, ada-tests/mptests/mp05/mptest.ads, ada-tests/mptests/mp05/node1/mp05_node1.adb, ada-tests/mptests/mp05/node2/mp05_node2.adb, ada-tests/mptests/mp06/mptest.adb, ada-tests/mptests/mp06/mptest.ads, ada-tests/mptests/mp06/node1/mp06_node1.adb, ada-tests/mptests/mp06/node2/mp06_node2.adb, ada-tests/mptests/mp07/mptest.adb, ada-tests/mptests/mp07/mptest.ads, ada-tests/mptests/mp07/node1/mp07_node1.adb, ada-tests/mptests/mp07/node2/mp07_node2.adb, ada-tests/mptests/mp08/mptest.adb, ada-tests/mptests/mp08/mptest.ads, ada-tests/mptests/mp08/node1/mp08_node1.adb, ada-tests/mptests/mp08/node2/mp08_node2.adb, ada-tests/mptests/mp09/mptest.adb, ada-tests/mptests/mp09/mptest.ads, ada-tests/mptests/mp09/node1/mp09_node1.adb, ada-tests/mptests/mp09/node2/mp09_node2.adb, ada-tests/mptests/mp10/mptest.adb, ada-tests/mptests/mp10/mptest.ads, ada-tests/mptests/mp10/node1/mp10_node1.adb, ada-tests/mptests/mp10/node2/mp10_node2.adb, ada-tests/mptests/mp11/mptest.adb, ada-tests/mptests/mp11/mptest.ads, ada-tests/mptests/mp11/node1/mp11_node1.adb, ada-tests/mptests/mp11/node2/mp11_node2.adb, ada-tests/mptests/mp12/mptest.adb, ada-tests/mptests/mp12/mptest.ads, ada-tests/mptests/mp12/node1/mp12_node1.adb, ada-tests/mptests/mp12/node2/mp12_node2.adb, ada-tests/mptests/mp13/mptest.adb, ada-tests/mptests/mp13/mptest.ads, ada-tests/mptests/mp13/node1/mp13_node1.adb, ada-tests/mptests/mp13/node2/mp13_node2.adb, ada-tests/mptests/mp14/mptest.adb, ada-tests/mptests/mp14/mptest.ads, ada-tests/mptests/mp14/node1/mp14_node1.adb, ada-tests/mptests/mp14/node2/mp14_node2.adb, ada-tests/samples/base_mp/mptest.adb, ada-tests/samples/base_mp/mptest.ads, ada-tests/samples/base_sp/base_sp.adb, ada-tests/samples/base_sp/sptest.adb, ada-tests/samples/base_sp/sptest.ads, ada-tests/samples/hello/hello.adb, ada-tests/samples/hello/sptest.adb, ada-tests/samples/hello/sptest.ads, ada-tests/samples/nsecs/nsecs.adb, ada-tests/samples/nsecs/sptest.adb, ada-tests/samples/nsecs/sptest.ads, ada-tests/samples/ticker/sptest.adb, ada-tests/samples/ticker/sptest.ads, ada-tests/samples/ticker/ticker.adb, ada-tests/sptests/sp01/sp01.adb, ada-tests/sptests/sp01/sptest.adb, ada-tests/sptests/sp01/sptest.ads, ada-tests/sptests/sp02/sp02.adb, ada-tests/sptests/sp02/sptest.adb, ada-tests/sptests/sp02/sptest.ads, ada-tests/sptests/sp03/sp03.adb, ada-tests/sptests/sp03/sptest.adb, ada-tests/sptests/sp03/sptest.ads, ada-tests/sptests/sp04/sp04.adb, ada-tests/sptests/sp04/sptest.adb, ada-tests/sptests/sp04/sptest.ads, ada-tests/sptests/sp05/sp05.adb, ada-tests/sptests/sp05/sptest.adb, ada-tests/sptests/sp05/sptest.ads, ada-tests/sptests/sp06/sp06.adb, ada-tests/sptests/sp06/sptest.adb, ada-tests/sptests/sp06/sptest.ads, ada-tests/sptests/sp07/sp07.adb, ada-tests/sptests/sp07/sptest.adb, ada-tests/sptests/sp07/sptest.ads, ada-tests/sptests/sp08/sp08.adb, ada-tests/sptests/sp08/sptest.adb, ada-tests/sptests/sp08/sptest.ads, ada-tests/sptests/sp09/sp09.adb, ada-tests/sptests/sp09/sptest.adb, ada-tests/sptests/sp09/sptest.ads, ada-tests/sptests/sp11/sp11.adb, ada-tests/sptests/sp11/sptest.adb, ada-tests/sptests/sp11/sptest.ads, ada-tests/sptests/sp12/sp12.adb, ada-tests/sptests/sp12/sptest.adb, ada-tests/sptests/sp12/sptest.ads, ada-tests/sptests/sp13/sp13.adb, ada-tests/sptests/sp13/sptest.adb, ada-tests/sptests/sp13/sptest.ads, ada-tests/sptests/sp14/sp14.adb, ada-tests/sptests/sp14/sptest.adb, ada-tests/sptests/sp14/sptest.ads, ada-tests/sptests/sp15/sp15.adb, ada-tests/sptests/sp15/sptest.adb, ada-tests/sptests/sp15/sptest.ads, ada-tests/sptests/sp16/sp16.adb, ada-tests/sptests/sp16/sptest.adb, ada-tests/sptests/sp16/sptest.ads, ada-tests/sptests/sp17/sp17.adb, ada-tests/sptests/sp17/sptest.adb, ada-tests/sptests/sp17/sptest.ads, ada-tests/sptests/sp19/sp19.adb, ada-tests/sptests/sp19/sptest.adp, ada-tests/sptests/sp19/sptest.ads, ada-tests/sptests/sp20/sp20.adb, ada-tests/sptests/sp20/sptest.adb, ada-tests/sptests/sp20/sptest.ads, ada-tests/sptests/sp22/sp22.adb, ada-tests/sptests/sp22/sptest.adb, ada-tests/sptests/sp22/sptest.ads, ada-tests/sptests/sp23/sp23.adb, ada-tests/sptests/sp23/sptest.adb, ada-tests/sptests/sp23/sptest.ads, ada-tests/sptests/sp24/sp24.adb, ada-tests/sptests/sp24/sptest.adb, ada-tests/sptests/sp24/sptest.ads, ada-tests/sptests/sp25/sp25.adb, ada-tests/sptests/sp25/sptest.adb, ada-tests/sptests/sp25/sptest.ads, ada-tests/support/test_support.adb, ada-tests/tmtests/tm01/tm01.adb, ada-tests/tmtests/tm01/tmtest.adb, ada-tests/tmtests/tm01/tmtest.ads, ada-tests/tmtests/tm02/tm02.adb, ada-tests/tmtests/tm02/tmtest.adb, ada-tests/tmtests/tm02/tmtest.ads, ada-tests/tmtests/tm03/tm03.adb, ada-tests/tmtests/tm03/tmtest.adb, ada-tests/tmtests/tm03/tmtest.ads, ada-tests/tmtests/tm04/tm04.adb, ada-tests/tmtests/tm04/tmtest.adb, ada-tests/tmtests/tm04/tmtest.ads, ada-tests/tmtests/tm05/tm05.adb, ada-tests/tmtests/tm05/tmtest.adb, ada-tests/tmtests/tm05/tmtest.ads, ada-tests/tmtests/tm06/tm06.adb, ada-tests/tmtests/tm06/tmtest.adb, ada-tests/tmtests/tm06/tmtest.ads, ada-tests/tmtests/tm07/tm07.adb, ada-tests/tmtests/tm07/tmtest.adb, ada-tests/tmtests/tm07/tmtest.ads, ada-tests/tmtests/tm08/tm08.adb, ada-tests/tmtests/tm08/tmtest.adb, ada-tests/tmtests/tm08/tmtest.ads, ada-tests/tmtests/tm09/tm09.adb, ada-tests/tmtests/tm09/tmtest.adb, ada-tests/tmtests/tm09/tmtest.ads, ada-tests/tmtests/tm10/tm10.adb, ada-tests/tmtests/tm10/tmtest.adb, ada-tests/tmtests/tm10/tmtest.ads, ada-tests/tmtests/tm11/tm11.adb, ada-tests/tmtests/tm11/tmtest.adb, ada-tests/tmtests/tm11/tmtest.ads, ada-tests/tmtests/tm12/tm12.adb, ada-tests/tmtests/tm12/tmtest.adb, ada-tests/tmtests/tm12/tmtest.ads, ada-tests/tmtests/tm13/tm13.adb, ada-tests/tmtests/tm13/tmtest.adb, ada-tests/tmtests/tm13/tmtest.ads, ada-tests/tmtests/tm14/tm14.adb, ada-tests/tmtests/tm14/tmtest.adb, ada-tests/tmtests/tm14/tmtest.ads, ada-tests/tmtests/tm15/tm15.adb, ada-tests/tmtests/tm15/tmtest.adb, ada-tests/tmtests/tm15/tmtest.ads, ada-tests/tmtests/tm16/tm16.adb, ada-tests/tmtests/tm16/tmtest.adb, ada-tests/tmtests/tm16/tmtest.ads, ada-tests/tmtests/tm17/tm17.adb, ada-tests/tmtests/tm17/tmtest.adb, ada-tests/tmtests/tm17/tmtest.ads, ada-tests/tmtests/tm18/tm18.adb, ada-tests/tmtests/tm18/tmtest.adb, ada-tests/tmtests/tm18/tmtest.ads, ada-tests/tmtests/tm19/tm19.adb, ada-tests/tmtests/tm19/tmtest.adb, ada-tests/tmtests/tm19/tmtest.ads, ada-tests/tmtests/tm20/tm20.adb, ada-tests/tmtests/tm20/tmtest.adb, ada-tests/tmtests/tm20/tmtest.ads, ada-tests/tmtests/tm21/tm21.adb, ada-tests/tmtests/tm21/tmtest.adb, ada-tests/tmtests/tm21/tmtest.ads, ada-tests/tmtests/tm22/tm22.adb, ada-tests/tmtests/tm22/tmtest.adb, ada-tests/tmtests/tm22/tmtest.ads, ada-tests/tmtests/tm23/tm23.adb, ada-tests/tmtests/tm23/tmtest.adb, ada-tests/tmtests/tm23/tmtest.ads, ada-tests/tmtests/tm24/tm24.adb, ada-tests/tmtests/tm24/tmtest.adb, ada-tests/tmtests/tm24/tmtest.ads, ada-tests/tmtests/tm25/tm25.adb, ada-tests/tmtests/tm25/tmtest.adb, ada-tests/tmtests/tm25/tmtest.ads, ada-tests/tmtests/tm28/tm28.adb, ada-tests/tmtests/tm28/tmtest.adb, ada-tests/tmtests/tm28/tmtest.ads, ada-tests/tmtests/tm29/tm29.adb, ada-tests/tmtests/tm29/tmtest.adb, ada-tests/tmtests/tm29/tmtest.ads, ada-tests/tmtests/tmck/tmck.adb, ada-tests/tmtests/tmck/tmtest.adb, ada-tests/tmtests/tmck/tmtest.ads, ada-tests/tmtests/tmoverhd/dummy_rtems.adb, ada-tests/tmtests/tmoverhd/dummy_rtems.ads, ada-tests/tmtests/tmoverhd/tmoverhd.adb, ada-tests/tmtests/tmoverhd/tmtest.adb, ada-tests/tmtests/tmoverhd/tmtest.ads: Account for RTEMS binding child package rework. Eliminate all warnings.
  • Property mode set to 100644
File size: 8.6 KB
Line 
1--
2--  MPTEST / BODY
3--
4--  DESCRIPTION:
5--
6--  This package is the implementation for Test 13 of the RTEMS
7--  Multiprocessor 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--  $Id$
21--
22
23with INTERFACES; use INTERFACES;
24with RTEMS;
25with RTEMS.MESSAGE_QUEUE;
26with RTEMS.SEMAPHORE;
27with RTEMS.TASKS;
28with TEST_SUPPORT;
29with TEXT_IO;
30with UNSIGNED32_IO;
31
32package body MPTEST is
33
34--
35--  INIT
36--
37
38   procedure INIT (
39      ARGUMENT : in     RTEMS.TASKS.ARGUMENT
40   ) is
41      STATUS : RTEMS.STATUS_CODES;
42   begin
43
44      TEXT_IO.NEW_LINE( 2 );
45      TEXT_IO.PUT( "*** TEST 13 -- NODE " );
46      UNSIGNED32_IO.PUT(
47         TEST_SUPPORT.NODE,
48         WIDTH => 1
49      );
50      TEXT_IO.PUT_LINE( " ***" );
51
52      MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME(  '1', '1', '1', ' ' );
53      MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME(  '2', '2', '2', ' ' );
54
55      MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME(  'M', 'S', 'G', ' ' );
56
57      MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME(  'S', 'E', 'M', ' ' );
58
59      if TEST_SUPPORT.NODE = 1 then
60
61         TEXT_IO.PUT_LINE( "Creating Message Queue (Global)" );
62         RTEMS.MESSAGE_QUEUE.CREATE(
63            MPTEST.QUEUE_NAME( 1 ),
64            3,
65            RTEMS.GLOBAL + RTEMS.LIMIT,
66            MPTEST.QUEUE_ID( 1 ),
67            STATUS
68         );
69         TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" );
70
71         TEXT_IO.PUT_LINE( "Creating Semaphore (Global)" );
72         RTEMS.SEMAPHORE.CREATE(
73            MPTEST.SEMAPHORE_NAME( 1 ),
74            1,
75            RTEMS.GLOBAL + RTEMS.PRIORITY,
76            MPTEST.SEMAPHORE_ID( 1 ),
77            STATUS
78         );
79         TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" );
80
81         RTEMS.SEMAPHORE.OBTAIN(
82            MPTEST.SEMAPHORE_ID( 1 ),
83            RTEMS.DEFAULT_OPTIONS,
84            RTEMS.NO_TIMEOUT,
85            STATUS
86         );
87         TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
88
89      end if;
90
91      TEXT_IO.PUT_LINE( "Creating Test_task 1 (local)" );
92         RTEMS.TASKS.CREATE(
93         MPTEST.TASK_NAME( 1 ),
94         1,
95         2048,
96         RTEMS.TIMESLICE,
97         RTEMS.DEFAULT_ATTRIBUTES,
98         MPTEST.TASK_ID( 1 ),
99         STATUS
100      );
101      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
102
103      TEXT_IO.PUT_LINE( "Starting Test_task 1 (local)" );
104      RTEMS.TASKS.START(
105         MPTEST.TASK_ID( 1 ),
106         MPTEST.TEST_TASK_1'ACCESS,
107         0,
108         STATUS
109      );
110      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
111
112      TEXT_IO.PUT_LINE( "Creating Test_task 2 (local)" );
113      RTEMS.TASKS.CREATE(
114         MPTEST.TASK_NAME( 2 ),
115         1,
116         2048,
117         RTEMS.TIMESLICE,
118         RTEMS.DEFAULT_ATTRIBUTES,
119         MPTEST.TASK_ID( 2 ),
120         STATUS
121      );
122      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
123
124      TEXT_IO.PUT_LINE( "Starting Test_task 2 (local)" );
125      RTEMS.TASKS.START(
126         MPTEST.TASK_ID( 2 ),
127         MPTEST.TEST_TASK_2'ACCESS,
128         0,
129         STATUS
130      );
131      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
132
133      if TEST_SUPPORT.NODE = 1 then
134
135         RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
136         TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
137
138         TEXT_IO.PUT_LINE( "*** END OF TEST 13 ***" );
139
140         RTEMS.SHUTDOWN_EXECUTIVE( 0 );
141
142      end if;
143
144      TEXT_IO.PUT_LINE( "Deleting initialization task" );
145      RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
146      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
147
148   end INIT;
149
150--
151--  TEST_TASK_1
152--
153
154   procedure TEST_TASK_1 (
155      ARGUMENT : in     RTEMS.TASKS.ARGUMENT
156   ) is
157      COUNT               : RTEMS.UNSIGNED32;
158      RECEIVE_BUFFER_AREA : RTEMS.BUFFER;
159      RECEIVE_BUFFER      : RTEMS.BUFFER_POINTER;
160      STATUS              : RTEMS.STATUS_CODES;
161   begin
162
163      RECEIVE_BUFFER :=
164         RTEMS.TO_BUFFER_POINTER( RECEIVE_BUFFER_AREA'ADDRESS );
165
166      TEXT_IO.PUT_LINE( "Getting QID of message queue" );
167
168      loop
169
170         RTEMS.MESSAGE_QUEUE.IDENT(
171            MPTEST.QUEUE_NAME( 1 ),
172            RTEMS.SEARCH_ALL_NODES,
173            MPTEST.QUEUE_ID( 1 ),
174            STATUS
175         );
176
177         exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
178
179      end loop;
180
181      if TEST_SUPPORT.NODE = 1 then
182
183         TEXT_IO.PUT_LINE( "Receiving message ..." );
184         RTEMS.MESSAGE_QUEUE.RECEIVE(
185            MPTEST.QUEUE_ID( 1 ),
186            RECEIVE_BUFFER,
187            RTEMS.DEFAULT_OPTIONS,
188            RTEMS.NO_TIMEOUT,
189            STATUS
190         );
191         TEXT_IO.PUT_LINE( "How did I get back from here???" );
192         TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
193
194      end if;
195
196      RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
197      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
198
199      TEXT_IO.PUT_LINE( "Receiving message ..." );
200      RTEMS.MESSAGE_QUEUE.RECEIVE(
201         MPTEST.QUEUE_ID( 1 ),
202         RECEIVE_BUFFER,
203         RTEMS.DEFAULT_OPTIONS,
204         2 * TEST_SUPPORT.TICKS_PER_SECOND,
205         STATUS
206      );
207      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
208         STATUS,
209         RTEMS.TIMEOUT,
210         "MESSAGE_QUEUE_RECEIVE"
211      );
212      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
213         STATUS,
214         RTEMS.TIMEOUT,
215         "MESSAGE_QUEUE_OBTAIN"
216      );
217
218      TEXT_IO.PUT_LINE(
219         "message_queue_receive correctly returned TIMEOUT"
220      );
221
222      TEXT_IO.PUT_LINE( "Deleting self" );
223      RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
224      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
225
226   end TEST_TASK_1;
227
228--
229--  TEST_TASK_2
230--
231
232   procedure TEST_TASK_2 (
233      ARGUMENT : in     RTEMS.TASKS.ARGUMENT
234   ) is
235      STATUS : RTEMS.STATUS_CODES;
236   begin
237
238      TEXT_IO.PUT_LINE( "Getting SMID of semaphore" );
239
240      loop
241
242         RTEMS.SEMAPHORE.IDENT(
243            MPTEST.SEMAPHORE_NAME( 1 ),
244            RTEMS.SEARCH_ALL_NODES,
245            MPTEST.SEMAPHORE_ID( 1 ),
246            STATUS
247         );
248
249         exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
250
251      end loop;
252
253      if TEST_SUPPORT.NODE = 1 then
254
255         RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
256         TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
257
258         TEXT_IO.PUT_LINE( "Releasing semaphore ..." );
259         RTEMS.SEMAPHORE.RELEASE( MPTEST.SEMAPHORE_ID( 1 ), STATUS );
260         TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" );
261
262         RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND / 2, STATUS );
263         TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
264
265         TEXT_IO.PUT_LINE( "Getting semaphore ..." );
266         RTEMS.SEMAPHORE.OBTAIN(
267            MPTEST.SEMAPHORE_ID( 1 ),
268            RTEMS.DEFAULT_OPTIONS,
269            RTEMS.NO_TIMEOUT,
270            STATUS
271         );
272         TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
273
274         TEXT_IO.PUT_LINE( "Getting semaphore ..." );
275         RTEMS.SEMAPHORE.OBTAIN(
276            MPTEST.SEMAPHORE_ID( 1 ),
277            RTEMS.DEFAULT_OPTIONS,
278            RTEMS.NO_TIMEOUT,
279            STATUS
280         );
281         TEXT_IO.PUT_LINE( "How did I get back from here???" );
282         TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
283
284      end if;
285
286      RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND / 2, STATUS );
287      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
288
289      TEXT_IO.PUT_LINE( "Getting semaphore ..." );
290      RTEMS.SEMAPHORE.OBTAIN(
291         MPTEST.SEMAPHORE_ID( 1 ),
292         RTEMS.DEFAULT_OPTIONS,
293         RTEMS.NO_TIMEOUT,
294         STATUS
295      );
296      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
297
298      TEXT_IO.PUT_LINE( "Releasing semaphore ..." );
299      RTEMS.SEMAPHORE.RELEASE( MPTEST.SEMAPHORE_ID( 1 ), STATUS );
300      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" );
301
302      RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
303      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
304
305      TEXT_IO.PUT_LINE( "Getting semaphore ..." );
306      RTEMS.SEMAPHORE.OBTAIN(
307         MPTEST.SEMAPHORE_ID( 1 ),
308         RTEMS.DEFAULT_OPTIONS,
309         2 * TEST_SUPPORT.TICKS_PER_SECOND,
310         STATUS
311      );
312      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
313         STATUS,
314         RTEMS.TIMEOUT,
315         "SEMAPHORE_OBTAIN"
316      );
317      TEXT_IO.PUT_LINE( "semaphore_obtain correctly returned TIMEOUT" );
318
319      TEXT_IO.PUT_LINE( "*** END OF TEST 13 ***" );
320
321      RTEMS.SHUTDOWN_EXECUTIVE( 0 );
322
323   end TEST_TASK_2;
324
325end MPTEST;
Note: See TracBrowser for help on using the repository browser.