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

4.104.114.84.95
Last change on this file since 1bce637 was bf9ae83, checked in by Joel Sherrill <joel.sherrill@…>, on Jun 2, 1997 at 8:32:11 PM

modified copyright notice to be the same as RTEMS 4.0.0.

changed the CVS ID string to be a "development" version.

  • Property mode set to 100644
File size: 2.4 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   package body PER_NODE_CONFIGURATION is separate;
33
34--PAGE
35--
36--  INIT
37--
38
39   procedure INIT (
40      ARGUMENT : in     RTEMS.TASK_ARGUMENT
41   ) is
42      C      : RTEMS.CHARACTER;
43      TIME   : RTEMS.TIME_OF_DAY;
44      STATUS : RTEMS.STATUS_CODES;
45   begin
46
47      TEXT_IO.NEW_LINE( 2 );
48      TEXT_IO.PUT( "*** SAMPLE MULTIPROCESSOR APPLICATION ***" );
49      TEXT_IO.PUT( "Creating and starting an application task" );
50
51
52      MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME(  'T', 'A', '1', ' ' );
53
54      RTEMS.TASK_CREATE( 
55         MPTEST.TASK_NAME( 1 ), 
56         1, 
57         2048, 
58         RTEMS.INTERRUPT_LEVEL( 0 ),
59         RTEMS.DEFAULT_ATTRIBUTES,
60         MPTEST.TASK_ID( 1 ),
61         STATUS
62      );
63      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
64
65      RTEMS.TASK_START(
66         MPTEST.TASK_ID( 1 ),
67         MPTEST.APPLICATION_TASK'ACCESS,
68         0,
69         STATUS
70      );
71      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
72
73      RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
74      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
75
76   end INIT;
77
78--PAGE
79--
80--  APPLICATION_TASK
81--
82
83   procedure APPLICATION_TASK (
84      ARGUMENT : in     RTEMS.TASK_ARGUMENT
85   ) is
86      TIME   : RTEMS.TIME_OF_DAY;
87      TID    : RTEMS.ID;
88      STATUS : RTEMS.STATUS_CODES;
89   begin
90
91      RTEMS.TASK_IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
92      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" );
93   
94      TEXT_IO.PUT( "This task was invoked with node argument (" );
95      UNSIGNED32_IO.PUT( ARGUMENT );
96      TEXT_IO.PUT_LINE( ")" );
97
98      TEXT_IO.PUT( "This task has the id of  0x" );
99      UNSIGNED32_IO.PUT( TID, BASE => 16 );
100      TEXT_IO.NEW_LINE;
101 
102      TEXT_IO.PUT_LINE( "*** END OF SAMPLE MULTIPROCESSOR APPLICATION  ***" );
103
104      RTEMS.SHUTDOWN_EXECUTIVE( 0 );
105
106   end APPLICATION_TASK;
107
108end MPTEST;
Note: See TracBrowser for help on using the repository browser.