source: rtems/c/src/ada-tests/samples/base_mp/mptest.adb @ bd5efa92

4.104.114.84.95
Last change on this file since bd5efa92 was addebe67, checked in by Joel Sherrill <joel.sherrill@…>, on 09/03/02 at 18:31:23

2002-09-03 Joel Sherrill <joel@…>

  • base_mp now builds and can be considered a bit of an example for the other mptests.
  • mptests/mp01/node1/Makefile.am, mptests/mp01/node2/Makefile.am, samples/base_mp/mptest.adb, samples/base_mp/mptest.ads, samples/base_mp/node1/Makefile.am, samples/base_mp/node2/Makefile.am: Modified to make compile.
  • mptests/mp01/node1/mptest-per_node_configuration.adb, mptests/mp01/node2/mptest-per_node_configuration.adb, mptests/mp02/node1/mptest-per_node_configuration.adb, mptests/mp02/node2/mptest-per_node_configuration.adb, mptests/mp03/node1/mptest-per_node_configuration.adb, mptests/mp03/node2/mptest-per_node_configuration.adb, mptests/mp04/node1/mptest-per_node_configuration.adb, mptests/mp04/node2/mptest-per_node_configuration.adb, mptests/mp05/node1/mptest-per_node_configuration.adb, mptests/mp05/node2/mptest-per_node_configuration.adb, mptests/mp06/node1/mptest-per_node_configuration.adb, mptests/mp06/node2/mptest-per_node_configuration.adb, mptests/mp07/node1/mptest-per_node_configuration.adb, mptests/mp07/node2/mptest-per_node_configuration.adb, mptests/mp08/node1/mptest-per_node_configuration.adb, mptests/mp08/node2/mptest-per_node_configuration.adb, mptests/mp09/node1/mptest-per_node_configuration.adb, mptests/mp09/node2/mptest-per_node_configuration.adb, mptests/mp10/node1/mptest-per_node_configuration.adb, mptests/mp10/node2/mptest-per_node_configuration.adb, mptests/mp11/node1/mptest-per_node_configuration.adb, mptests/mp11/node2/mptest-per_node_configuration.adb, mptests/mp12/node1/mptest-per_node_configuration.adb, mptests/mp12/node2/mptest-per_node_configuration.adb, mptests/mp13/node1/mptest-per_node_configuration.adb, mptests/mp13/node2/mptest-per_node_configuration.adb, mptests/mp14/node1/mptest-per_node_configuration.adb, mptests/mp14/node2/mptest-per_node_configuration.adb, samples/base_mp/node1/mptest-per_node_configuration.adb, samples/base_mp/node2/mptest-per_node_configuration.adb: Removed as this information should come from config.h.
  • Property mode set to 100644
File size: 2.3 KB
Line 
1--
2--  MPTEST / BODY
3--
4--  DESCRIPTION:
5--
6--  This package is the implementation for Test 1 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--  Copyright assigned to U.S. Government, 1994.
16--
17--  The license and distribution terms for this file may in
18--  the file LICENSE in this distribution or at
19--  http://www.OARcorp.com/rtems/license.html.
20--
21--  $Id$
22--
23
24with INTERFACES; use INTERFACES;
25with RTEMS;
26with TEST_SUPPORT;
27with TEXT_IO;
28with UNSIGNED32_IO;
29
30package body MPTEST is
31
32--PAGE
33--
34--  INIT
35--
36
37   procedure INIT (
38      ARGUMENT : in     RTEMS.TASK_ARGUMENT
39   ) is
40      STATUS : RTEMS.STATUS_CODES;
41   begin
42
43      TEXT_IO.NEW_LINE( 2 );
44      TEXT_IO.PUT( "*** SAMPLE MULTIPROCESSOR APPLICATION ***" );
45      TEXT_IO.PUT( "Creating and starting an application task" );
46
47
48      MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME(  'T', 'A', '1', ' ' );
49
50      RTEMS.TASK_CREATE(
51         MPTEST.TASK_NAME( 1 ),
52         1,
53         2048,
54         RTEMS.INTERRUPT_LEVEL( 0 ),
55         RTEMS.DEFAULT_ATTRIBUTES,
56         MPTEST.TASK_ID( 1 ),
57         STATUS
58      );
59      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
60
61      RTEMS.TASK_START(
62         MPTEST.TASK_ID( 1 ),
63         MPTEST.APPLICATION_TASK'ACCESS,
64         0,
65         STATUS
66      );
67      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
68
69      RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
70      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
71
72   end INIT;
73
74--PAGE
75--
76--  APPLICATION_TASK
77--
78
79   procedure APPLICATION_TASK (
80      ARGUMENT : in     RTEMS.TASK_ARGUMENT
81   ) is
82      TID    : RTEMS.ID;
83      STATUS : RTEMS.STATUS_CODES;
84   begin
85
86      RTEMS.TASK_IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
87      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" );
88   
89      TEXT_IO.PUT( "This task was invoked with node argument (" );
90      UNSIGNED32_IO.PUT( ARGUMENT );
91      TEXT_IO.PUT_LINE( ")" );
92
93      TEXT_IO.PUT( "This task has the id of  0x" );
94      UNSIGNED32_IO.PUT( TID, BASE => 16 );
95      TEXT_IO.NEW_LINE;
96 
97      TEXT_IO.PUT_LINE( "*** END OF SAMPLE MULTIPROCESSOR APPLICATION  ***" );
98
99      RTEMS.SHUTDOWN_EXECUTIVE( 0 );
100
101   end APPLICATION_TASK;
102
103end MPTEST;
Note: See TracBrowser for help on using the repository browser.