summaryrefslogtreecommitdiffstats
path: root/c/src/ada-tests/samples/base_sp/sptest.adb
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1997-06-02 20:19:03 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1997-06-02 20:19:03 +0000
commit6d4e604be8b43c0555cd1c9531fe78ae199a1189 (patch)
treeadc303bfeaddf541a8f45ea1597f43bf8bf7a09d /c/src/ada-tests/samples/base_sp/sptest.adb
parentChanged bitwise OR's used to build up option and attribute sets (diff)
downloadrtems-6d4e604be8b43c0555cd1c9531fe78ae199a1189.tar.bz2
Initial revision
Diffstat (limited to '')
-rw-r--r--c/src/ada-tests/samples/base_sp/sptest.adb98
1 files changed, 98 insertions, 0 deletions
diff --git a/c/src/ada-tests/samples/base_sp/sptest.adb b/c/src/ada-tests/samples/base_sp/sptest.adb
new file mode 100644
index 0000000000..f52daa1483
--- /dev/null
+++ b/c/src/ada-tests/samples/base_sp/sptest.adb
@@ -0,0 +1,98 @@
+--
+-- SPTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 1 of the RTEMS
+-- Single Processor Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+-- On-Line Applications Research Corporation (OAR).
+-- All rights assigned to U.S. Government, 1994.
+--
+-- This material may be reproduced by or for the U.S. Government pursuant
+-- to the copyright license under the clause at DFARS 252.227-7013. This
+-- notice must appear in all copies of this file and its derivatives.
+--
+-- sptest.adb,v 1.3 1995/07/12 19:40:50 joel Exp
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS;
+with TEST_SUPPORT;
+with TEXT_IO;
+with UNSIGNED32_IO;
+
+package body SPTEST is
+
+--PAGE
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASK_ARGUMENT
+ ) is
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** SAMPLE SINGLE PROCESSOR APPLICATION ***" );
+ TEXT_IO.PUT_LINE( "Creating and starting an application task" );
+
+ SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
+
+ RTEMS.TASK_CREATE(
+ SPTEST.TASK_NAME( 1 ),
+ 1,
+ 2048,
+ RTEMS.INTERRUPT_LEVEL( 0 ),
+ RTEMS.DEFAULT_ATTRIBUTES,
+ SPTEST.TASK_ID( 1 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
+
+ RTEMS.TASK_START(
+ SPTEST.TASK_ID( 1 ),
+ SPTEST.APPLICATION_TASK'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
+
+ RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--PAGE
+--
+-- APPLICATION_TASK
+--
+
+ procedure APPLICATION_TASK (
+ ARGUMENT : in RTEMS.TASK_ARGUMENT
+ ) is
+ TID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ RTEMS.TASK_IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
+
+ TEXT_IO.PUT( "Application task was invoked with argument (" );
+ UNSIGNED32_IO.PUT( ARGUMENT );
+ TEXT_IO.PUT( ") and has id of 0x" );
+ UNSIGNED32_IO.PUT( TID, BASE => 16 );
+
+ TEXT_IO.PUT_LINE( "*** END OF SAMPLE SINGLE PROCESSOR APPLICATION ***" );
+
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end APPLICATION_TASK;
+
+end SPTEST;