source: rtems/c/src/ada-tests/mptests/mp11/mptest.adb @ 23848bbd

4.104.114.95
Last change on this file since 23848bbd was 23848bbd, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 1, 2007 at 10:58:09 PM

2007-10-01 Joel Sherrill <joel.sherrill@…>

  • mptests/mp01/mptest.adb, mptests/mp01/mptest.ads, mptests/mp01/node1/Makefile.am, mptests/mp02/mptest.adb, mptests/mp02/mptest.ads, mptests/mp03/mptest.adb, mptests/mp03/mptest.ads, mptests/mp04/mptest.adb, mptests/mp04/mptest.ads, mptests/mp05/mptest.adb, mptests/mp05/mptest.ads, mptests/mp06/mptest.adb, mptests/mp06/mptest.ads, mptests/mp07/mptest.adb, mptests/mp07/mptest.ads, mptests/mp08/mptest.adb, mptests/mp08/mptest.ads, mptests/mp09/mptest.adb, mptests/mp09/mptest.ads, mptests/mp10/mptest.adb, mptests/mp10/mptest.ads, mptests/mp11/mptest.adb, mptests/mp11/mptest.ads, mptests/mp12/mptest.adb, mptests/mp12/mptest.ads, mptests/mp13/mptest.adb, mptests/mp13/mptest.ads, mptests/mp14/mptest.adb, mptests/mp14/mptest.ads, support/init.c, support/test_support.adb, support/test_support.ads: Most of single processor Ada tests now build. Some run.
  • Property mode set to 100644
File size: 3.3 KB
Line 
1--
2--  MPTEST / BODY
3--
4--  DESCRIPTION:
5--
6--  This package is the implementation for Test 11 of the RTEMS
7--  Multiprocessor 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 INTERFACES; use INTERFACES;
24with RTEMS;
25with TEST_SUPPORT;
26with TEXT_IO;
27with UNSIGNED32_IO;
28
29package body MPTEST is
30
31--PAGE
32--
33--  INIT
34--
35
36   procedure INIT (
37      ARGUMENT : in     RTEMS.TASK_ARGUMENT
38   ) is
39      STATUS : RTEMS.STATUS_CODES;
40   begin
41
42      TEXT_IO.NEW_LINE( 2 );
43      TEXT_IO.PUT( "*** TEST 11 -- NODE " );
44      UNSIGNED32_IO.PUT(
45         TEST_SUPPORT.NODE,
46         WIDTH => 1
47      );
48      TEXT_IO.PUT_LINE( " ***" );
49
50      MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME(  '1', '1', '1', ' ' );
51      MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME(  '2', '2', '2', ' ' );
52
53      MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME(  'M', 'S', 'G', ' ' );
54
55      MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME(  'S', 'E', 'M', ' ' );
56
57      MPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME(  'P', 'A', 'R', ' ' );
58
59      if TEST_SUPPORT.NODE = 1 then
60
61         TEXT_IO.PUT_LINE( "Attempting to create Test_task (Global)" );
62         RTEMS.TASK_CREATE(
63            MPTEST.TASK_NAME( 1 ),
64            1,
65            2048,
66            RTEMS.DEFAULT_MODES,
67            RTEMS.GLOBAL,
68            MPTEST.TASK_ID( 1 ),
69            STATUS
70         );
71         TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
72            STATUS,
73            RTEMS.TOO_MANY,
74            "TASK_CREATE"
75         );
76         TEXT_IO.PUT_LINE( "task_create correctly returned TOO_MANY" );
77
78         TEXT_IO.PUT_LINE( "Attempting to create Message Queue (Global)" );
79         RTEMS.MESSAGE_QUEUE_CREATE(
80            MPTEST.QUEUE_NAME( 1 ),
81            3,
82            RTEMS.GLOBAL + RTEMS.LIMIT,
83            MPTEST.QUEUE_ID( 1 ),
84            STATUS
85         );
86         TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
87            STATUS,
88            RTEMS.TOO_MANY,
89            "MESSAGE_QUEUE_CREATE"
90         );
91         TEXT_IO.PUT_LINE( 
92            "message_queue_create correctly returned TOO_MANY"
93         );
94
95         TEXT_IO.PUT_LINE( "Creating Semaphore (Global)" );
96         RTEMS.SEMAPHORE_CREATE(
97            MPTEST.SEMAPHORE_NAME( 1 ),
98            1,
99            RTEMS.GLOBAL,
100            MPTEST.SEMAPHORE_ID( 1 ),
101            STATUS
102         );
103         TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
104            STATUS, 
105            RTEMS.TOO_MANY, 
106            "SEMAPHORE_CREATE"
107         );
108         TEXT_IO.PUT_LINE( "semaphore_create correctly returned TOO_MANY" );
109
110         TEXT_IO.PUT_LINE( "Creating Partition (Global)" );
111         RTEMS.PARTITION_CREATE(
112            MPTEST.PARTITION_NAME( 1 ),
113            MPTEST.PARTITION_AREA( 0 )'ADDRESS,
114            128,
115            64,
116            RTEMS.GLOBAL,
117            MPTEST.PARTITION_ID( 1 ),
118            STATUS
119         );
120         TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
121            STATUS,
122            RTEMS.TOO_MANY,
123            "PARTITION_CREATE"
124         );
125         TEXT_IO.PUT_LINE( "partition_create correctly returned TOO_MANY" );
126
127      end if;
128
129      TEXT_IO.PUT_LINE( "*** END OF TEST 11 ***" );
130
131      RTEMS.SHUTDOWN_EXECUTIVE( 0 );
132
133   end INIT; 
134 
135end MPTEST;
Note: See TracBrowser for help on using the repository browser.