summaryrefslogtreecommitdiffstats
path: root/testsuites/ada/tmtests
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-12 10:00:10 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-12 10:53:16 +0200
commitee537ea3dd964d4de3565a36b4857af31fb5a3f4 (patch)
treead8b328a58469ca0632e3e61cd94f37c9d97cc25 /testsuites/ada/tmtests
parentada-tests: Use _SUBDIRS instead of SUBDIRS (diff)
downloadrtems-ee537ea3dd964d4de3565a36b4857af31fb5a3f4.tar.bz2
ada-tests: Move to testsuites/ada
This solves a build dependency issue, e.g. building tests before librtemsbsp.a exists. Close #3079.
Diffstat (limited to 'testsuites/ada/tmtests')
-rw-r--r--testsuites/ada/tmtests/Makefile.am33
-rw-r--r--testsuites/ada/tmtests/tm01/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm01/config.h32
-rw-r--r--testsuites/ada/tmtests/tm01/tm01.adb55
-rw-r--r--testsuites/ada/tmtests/tm01/tmtest.adb273
-rw-r--r--testsuites/ada/tmtests/tm01/tmtest.ads67
-rw-r--r--testsuites/ada/tmtests/tm02/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm02/config.h33
-rw-r--r--testsuites/ada/tmtests/tm02/tm02.adb55
-rw-r--r--testsuites/ada/tmtests/tm02/tmtest.adb206
-rw-r--r--testsuites/ada/tmtests/tm02/tmtest.ads104
-rw-r--r--testsuites/ada/tmtests/tm03/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm03/config.h33
-rw-r--r--testsuites/ada/tmtests/tm03/tm03.adb55
-rw-r--r--testsuites/ada/tmtests/tm03/tmtest.adb190
-rw-r--r--testsuites/ada/tmtests/tm03/tmtest.ads96
-rw-r--r--testsuites/ada/tmtests/tm04/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm04/config.h32
-rw-r--r--testsuites/ada/tmtests/tm04/tm04.adb55
-rw-r--r--testsuites/ada/tmtests/tm04/tmtest.adb494
-rw-r--r--testsuites/ada/tmtests/tm04/tmtest.ads163
-rw-r--r--testsuites/ada/tmtests/tm05/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm05/config.h33
-rw-r--r--testsuites/ada/tmtests/tm05/tm05.adb55
-rw-r--r--testsuites/ada/tmtests/tm05/tmtest.adb170
-rw-r--r--testsuites/ada/tmtests/tm05/tmtest.ads114
-rw-r--r--testsuites/ada/tmtests/tm06/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm06/config.h33
-rw-r--r--testsuites/ada/tmtests/tm06/tm06.adb55
-rw-r--r--testsuites/ada/tmtests/tm06/tmtest.adb202
-rw-r--r--testsuites/ada/tmtests/tm06/tmtest.ads104
-rw-r--r--testsuites/ada/tmtests/tm07/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm07/config.h33
-rw-r--r--testsuites/ada/tmtests/tm07/tm07.adb55
-rw-r--r--testsuites/ada/tmtests/tm07/tmtest.adb170
-rw-r--r--testsuites/ada/tmtests/tm07/tmtest.ads112
-rw-r--r--testsuites/ada/tmtests/tm08/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm08/config.h33
-rw-r--r--testsuites/ada/tmtests/tm08/tm08.adb55
-rw-r--r--testsuites/ada/tmtests/tm08/tmtest.adb299
-rw-r--r--testsuites/ada/tmtests/tm08/tmtest.ads96
-rw-r--r--testsuites/ada/tmtests/tm09/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm09/config.h32
-rw-r--r--testsuites/ada/tmtests/tm09/tm09.adb55
-rw-r--r--testsuites/ada/tmtests/tm09/tmtest.adb297
-rw-r--r--testsuites/ada/tmtests/tm09/tmtest.ads99
-rw-r--r--testsuites/ada/tmtests/tm10/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm10/config.h32
-rw-r--r--testsuites/ada/tmtests/tm10/tm10.adb55
-rw-r--r--testsuites/ada/tmtests/tm10/tmtest.adb220
-rw-r--r--testsuites/ada/tmtests/tm10/tmtest.ads118
-rw-r--r--testsuites/ada/tmtests/tm11/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm11/config.h32
-rw-r--r--testsuites/ada/tmtests/tm11/tm11.adb55
-rw-r--r--testsuites/ada/tmtests/tm11/tmtest.adb218
-rw-r--r--testsuites/ada/tmtests/tm11/tmtest.ads115
-rw-r--r--testsuites/ada/tmtests/tm12/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm12/config.h32
-rw-r--r--testsuites/ada/tmtests/tm12/tm12.adb55
-rw-r--r--testsuites/ada/tmtests/tm12/tmtest.adb204
-rw-r--r--testsuites/ada/tmtests/tm12/tmtest.ads106
-rw-r--r--testsuites/ada/tmtests/tm13/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm13/config.h32
-rw-r--r--testsuites/ada/tmtests/tm13/tm13.adb55
-rw-r--r--testsuites/ada/tmtests/tm13/tmtest.adb216
-rw-r--r--testsuites/ada/tmtests/tm13/tmtest.ads115
-rw-r--r--testsuites/ada/tmtests/tm14/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm14/config.h32
-rw-r--r--testsuites/ada/tmtests/tm14/tm14.adb55
-rw-r--r--testsuites/ada/tmtests/tm14/tmtest.adb214
-rw-r--r--testsuites/ada/tmtests/tm14/tmtest.ads106
-rw-r--r--testsuites/ada/tmtests/tm15/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm15/config.h32
-rw-r--r--testsuites/ada/tmtests/tm15/tm15.adb55
-rw-r--r--testsuites/ada/tmtests/tm15/tmtest.adb267
-rw-r--r--testsuites/ada/tmtests/tm15/tmtest.ads109
-rw-r--r--testsuites/ada/tmtests/tm16/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm16/config.h32
-rw-r--r--testsuites/ada/tmtests/tm16/tm16.adb55
-rw-r--r--testsuites/ada/tmtests/tm16/tmtest.adb196
-rw-r--r--testsuites/ada/tmtests/tm16/tmtest.ads112
-rw-r--r--testsuites/ada/tmtests/tm17/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm17/config.h32
-rw-r--r--testsuites/ada/tmtests/tm17/tm17.adb55
-rw-r--r--testsuites/ada/tmtests/tm17/tmtest.adb155
-rw-r--r--testsuites/ada/tmtests/tm17/tmtest.ads110
-rw-r--r--testsuites/ada/tmtests/tm18/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm18/config.h32
-rw-r--r--testsuites/ada/tmtests/tm18/tm18.adb55
-rw-r--r--testsuites/ada/tmtests/tm18/tmtest.adb151
-rw-r--r--testsuites/ada/tmtests/tm18/tmtest.ads97
-rw-r--r--testsuites/ada/tmtests/tm19/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm19/config.h32
-rw-r--r--testsuites/ada/tmtests/tm19/tm19.adb55
-rw-r--r--testsuites/ada/tmtests/tm19/tmtest.adb287
-rw-r--r--testsuites/ada/tmtests/tm19/tmtest.ads147
-rw-r--r--testsuites/ada/tmtests/tm20/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm20/config.h33
-rw-r--r--testsuites/ada/tmtests/tm20/tm20.adb55
-rw-r--r--testsuites/ada/tmtests/tm20/tmtest.adb455
-rw-r--r--testsuites/ada/tmtests/tm20/tmtest.ads151
-rw-r--r--testsuites/ada/tmtests/tm21/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm21/config.h38
-rw-r--r--testsuites/ada/tmtests/tm21/tm21.adb55
-rw-r--r--testsuites/ada/tmtests/tm21/tmtest.adb304
-rw-r--r--testsuites/ada/tmtests/tm21/tmtest.ads121
-rw-r--r--testsuites/ada/tmtests/tm22/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm22/config.h32
-rw-r--r--testsuites/ada/tmtests/tm22/tm22.adb55
-rw-r--r--testsuites/ada/tmtests/tm22/tmtest.adb252
-rw-r--r--testsuites/ada/tmtests/tm22/tmtest.ads120
-rw-r--r--testsuites/ada/tmtests/tm23/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm23/config.h32
-rw-r--r--testsuites/ada/tmtests/tm23/tm23.adb55
-rw-r--r--testsuites/ada/tmtests/tm23/tmtest.adb388
-rw-r--r--testsuites/ada/tmtests/tm23/tmtest.ads132
-rw-r--r--testsuites/ada/tmtests/tm24/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm24/config.h31
-rw-r--r--testsuites/ada/tmtests/tm24/tm24.adb55
-rw-r--r--testsuites/ada/tmtests/tm24/tmtest.adb161
-rw-r--r--testsuites/ada/tmtests/tm24/tmtest.ads99
-rw-r--r--testsuites/ada/tmtests/tm25/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm25/config.h32
-rw-r--r--testsuites/ada/tmtests/tm25/tm25.adb55
-rw-r--r--testsuites/ada/tmtests/tm25/tmtest.adb155
-rw-r--r--testsuites/ada/tmtests/tm25/tmtest.ads80
-rw-r--r--testsuites/ada/tmtests/tm28/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm28/config.h32
-rw-r--r--testsuites/ada/tmtests/tm28/tm28.adb55
-rw-r--r--testsuites/ada/tmtests/tm28/tmtest.adb171
-rw-r--r--testsuites/ada/tmtests/tm28/tmtest.ads105
-rw-r--r--testsuites/ada/tmtests/tm29/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tm29/config.h32
-rw-r--r--testsuites/ada/tmtests/tm29/tm29.adb55
-rw-r--r--testsuites/ada/tmtests/tm29/tmtest.adb236
-rw-r--r--testsuites/ada/tmtests/tm29/tmtest.ads96
-rw-r--r--testsuites/ada/tmtests/tmck/Makefile.am13
-rw-r--r--testsuites/ada/tmtests/tmck/config.h32
-rw-r--r--testsuites/ada/tmtests/tmck/tmck.adb55
-rw-r--r--testsuites/ada/tmtests/tmck/tmtest.adb214
-rw-r--r--testsuites/ada/tmtests/tmck/tmtest.ads96
-rw-r--r--testsuites/ada/tmtests/tmoverhd/Makefile.am14
-rw-r--r--testsuites/ada/tmtests/tmoverhd/README5
-rw-r--r--testsuites/ada/tmtests/tmoverhd/config.h32
-rw-r--r--testsuites/ada/tmtests/tmoverhd/dummy_rtems.adb891
-rw-r--r--testsuites/ada/tmtests/tmoverhd/dummy_rtems.ads445
-rw-r--r--testsuites/ada/tmtests/tmoverhd/tmoverhd.adb55
-rw-r--r--testsuites/ada/tmtests/tmoverhd/tmtest.adb1363
-rw-r--r--testsuites/ada/tmtests/tmoverhd/tmtest.ads156
149 files changed, 15661 insertions, 0 deletions
diff --git a/testsuites/ada/tmtests/Makefile.am b/testsuites/ada/tmtests/Makefile.am
new file mode 100644
index 0000000000..4cf9517425
--- /dev/null
+++ b/testsuites/ada/tmtests/Makefile.am
@@ -0,0 +1,33 @@
+_SUBDIRS =
+_SUBDIRS += tm01
+_SUBDIRS += tm02
+_SUBDIRS += tm03
+_SUBDIRS += tm04
+_SUBDIRS += tm05
+_SUBDIRS += tm06
+_SUBDIRS += tm07
+_SUBDIRS += tm08
+_SUBDIRS += tm09
+_SUBDIRS += tm10
+_SUBDIRS += tm11
+_SUBDIRS += tm12
+_SUBDIRS += tm13
+_SUBDIRS += tm14
+_SUBDIRS += tm15
+_SUBDIRS += tm16
+_SUBDIRS += tm17
+_SUBDIRS += tm18
+_SUBDIRS += tm19
+_SUBDIRS += tm20
+_SUBDIRS += tm21
+_SUBDIRS += tm22
+_SUBDIRS += tm23
+_SUBDIRS += tm24
+_SUBDIRS += tm25
+_SUBDIRS += tm28
+_SUBDIRS += tm29
+_SUBDIRS += tmck
+_SUBDIRS += tmoverhd
+
+include $(top_srcdir)/../automake/subdirs.am
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm01/Makefile.am b/testsuites/ada/tmtests/tm01/Makefile.am
new file mode 100644
index 0000000000..4fb8798b24
--- /dev/null
+++ b/testsuites/ada/tmtests/tm01/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm01
+ada_tm01_SOURCES = tm01.adb config.h tmtest.adb tmtest.ads
+ada_tm01_SOURCES += ../../support/init.c
+
+ada_tm01$(EXEEXT): tm01.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm01/config.h b/testsuites/ada/tmtests/tm01/config.h
new file mode 100644
index 0000000000..7730385b3c
--- /dev/null
+++ b/testsuites/ada/tmtests/tm01/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 2
+#define CONFIGURE_MAXIMUM_SEMAPHORES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm01/tm01.adb b/testsuites/ada/tmtests/tm01/tm01.adb
new file mode 100644
index 0000000000..47c83a17e0
--- /dev/null
+++ b/testsuites/ada/tmtests/tm01/tm01.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM01 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM01 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM01;
+
diff --git a/testsuites/ada/tmtests/tm01/tmtest.adb b/testsuites/ada/tmtests/tm01/tmtest.adb
new file mode 100644
index 0000000000..31e54aa40f
--- /dev/null
+++ b/testsuites/ada/tmtests/tm01/tmtest.adb
@@ -0,0 +1,273 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 1 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+with RTEMS.SEMAPHORE;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 1 ***" );
+
+ TMTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
+ TMTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
+ TMTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
+
+ RTEMS.TASKS.CREATE(
+ TMTEST.TASK_NAME( 1 ),
+ 1,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( 1 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
+
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( 1 ),
+ TMTEST.TASK_1'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TASK_1
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ SEMAPHORE_OBTAIN_TIME : RTEMS.UNSIGNED32;
+ SEMAPHORE_RELEASE_TIME : RTEMS.UNSIGNED32;
+ SEMAPHORE_OBTAIN_NO_WAIT_TIME : RTEMS.UNSIGNED32;
+ SEMAPHORE_OBTAIN_LOOP_TIME : RTEMS.UNSIGNED32;
+ SEMAPHORE_RELEASE_LOOP_TIME : RTEMS.UNSIGNED32;
+ NAME : RTEMS.NAME;
+ SMID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ NAME := RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' );
+
+ SEMAPHORE_OBTAIN_TIME := 0;
+ SEMAPHORE_RELEASE_TIME := 0;
+ SEMAPHORE_OBTAIN_NO_WAIT_TIME := 0;
+ SEMAPHORE_OBTAIN_LOOP_TIME := 0;
+ SEMAPHORE_RELEASE_LOOP_TIME := 0;
+
+-- Time one invocation of SEMAPHORE_CREATE
+
+ TIMER_DRIVER.INITIALIZE;
+
+ RTEMS.SEMAPHORE.CREATE(
+ NAME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ RTEMS.TASKS.NO_PRIORITY,
+ SMID,
+ STATUS
+ );
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SEMAPHORE_CREATE",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.SEMAPHORE_CREATE
+ );
+
+-- Time one invocation of SEMAPHORE_DELETE
+
+ TIMER_DRIVER.INITIALIZE;
+
+ RTEMS.SEMAPHORE.DELETE( SMID, STATUS );
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SEMAPHORE_DELETE",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.SEMAPHORE_DELETE
+ );
+
+-- Create semaphore for repeated operations.
+
+ RTEMS.SEMAPHORE.CREATE(
+ NAME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ RTEMS.TASKS.NO_PRIORITY,
+ SMID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" );
+
+-- Perform repeated SEMAPHORE OBTAIN's and RELEASE's
+
+ for ITERATIONS in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ SEMAPHORE_OBTAIN_LOOP_TIME := SEMAPHORE_OBTAIN_LOOP_TIME +
+ TMTEST.END_TIME;
+ SEMAPHORE_RELEASE_LOOP_TIME := SEMAPHORE_RELEASE_LOOP_TIME +
+ TMTEST.END_TIME;
+
+ -- Semaphore_obtain (available loop)
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.SEMAPHORE.OBTAIN(
+ SMID,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ STATUS
+ );
+
+ end loop;
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ SEMAPHORE_OBTAIN_TIME := SEMAPHORE_OBTAIN_TIME + TMTEST.END_TIME;
+
+ -- Semaphore_release
+
+ TIMER_DRIVER.INITIALIZE;
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.SEMAPHORE.RELEASE( SMID, STATUS );
+
+ end loop;
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ SEMAPHORE_RELEASE_TIME := SEMAPHORE_RELEASE_TIME +
+ TMTEST.END_TIME;
+
+ -- Semaphore_p (NO_WAIT)
+
+ TIMER_DRIVER.INITIALIZE;
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.SEMAPHORE.OBTAIN(
+ SMID,
+ RTEMS.NO_WAIT,
+ RTEMS.NO_TIMEOUT,
+ STATUS
+ );
+
+ end loop;
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ SEMAPHORE_OBTAIN_NO_WAIT_TIME :=
+ SEMAPHORE_OBTAIN_NO_WAIT_TIME + TMTEST.END_TIME;
+
+ -- Semaphore_v
+
+ TIMER_DRIVER.INITIALIZE;
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.SEMAPHORE.RELEASE( SMID, STATUS );
+
+ end loop;
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ SEMAPHORE_RELEASE_TIME := SEMAPHORE_RELEASE_TIME +
+ TMTEST.END_TIME;
+
+ end loop;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SEMAPHORE_OBTAIN (semaphore available)",
+ SEMAPHORE_OBTAIN_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT *
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ SEMAPHORE_OBTAIN_LOOP_TIME,
+ RTEMS_CALLING_OVERHEAD.SEMAPHORE_OBTAIN
+ );
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SEMAPHORE_OBTAIN (NO_WAIT)",
+ SEMAPHORE_OBTAIN_NO_WAIT_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT *
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ SEMAPHORE_OBTAIN_LOOP_TIME,
+ RTEMS_CALLING_OVERHEAD.SEMAPHORE_OBTAIN
+ );
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SEMAPHORE_RELEASE (no task waiting)",
+ SEMAPHORE_RELEASE_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT *
+ TIME_TEST_SUPPORT.OPERATION_COUNT * 2,
+ SEMAPHORE_RELEASE_LOOP_TIME * 2,
+ RTEMS_CALLING_OVERHEAD.SEMAPHORE_RELEASE
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 1 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end TASK_1;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm01/tmtest.ads b/testsuites/ada/tmtests/tm01/tmtest.ads
new file mode 100644
index 0000000000..6d00d05715
--- /dev/null
+++ b/testsuites/ada/tmtests/tm01/tmtest.ads
@@ -0,0 +1,67 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 1 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- These arrays contain the IDs and NAMEs of all RTEMS tasks created
+-- by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
+ TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TASK_1
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task performs the all of the timing operations in this test.
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TASK_1);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm02/Makefile.am b/testsuites/ada/tmtests/tm02/Makefile.am
new file mode 100644
index 0000000000..a35c09450d
--- /dev/null
+++ b/testsuites/ada/tmtests/tm02/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm02
+ada_tm02_SOURCES = tm02.adb config.h tmtest.adb tmtest.ads
+ada_tm02_SOURCES += ../../support/init.c
+
+ada_tm02$(EXEEXT): tm02.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm02/config.h b/testsuites/ada/tmtests/tm02/config.h
new file mode 100644
index 0000000000..b03802dcc5
--- /dev/null
+++ b/testsuites/ada/tmtests/tm02/config.h
@@ -0,0 +1,33 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_TIMERS 110
+#define CONFIGURE_MAXIMUM_SEMAPHORES 101
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm02/tm02.adb b/testsuites/ada/tmtests/tm02/tm02.adb
new file mode 100644
index 0000000000..9476c87878
--- /dev/null
+++ b/testsuites/ada/tmtests/tm02/tm02.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM02 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM02 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM02;
+
diff --git a/testsuites/ada/tmtests/tm02/tmtest.adb b/testsuites/ada/tmtests/tm02/tmtest.adb
new file mode 100644
index 0000000000..8fc9df5b18
--- /dev/null
+++ b/testsuites/ada/tmtests/tm02/tmtest.adb
@@ -0,0 +1,206 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 2 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+with RTEMS.SEMAPHORE;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 2 ***" );
+
+ TMTEST.TEST_INIT;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_INIT
+--
+
+ procedure TEST_INIT is
+ PRIORITY : RTEMS.TASKS.PRIORITY;
+ HIGH_ID : RTEMS.ID;
+ LOW_ID : RTEMS.ID;
+ TASK_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ PRIORITY := 5;
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ),
+ PRIORITY,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ HIGH_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF HIGH TASK" );
+
+ PRIORITY := PRIORITY + 1;
+
+ RTEMS.TASKS.START(
+ HIGH_ID,
+ TMTEST.HIGH_TASK'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF HIGH TASK" );
+
+ for INDEX in 2 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'M', 'I', 'D', ' ' ),
+ PRIORITY,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE MIDDLE" );
+
+ PRIORITY := PRIORITY + 1;
+
+ RTEMS.TASKS.START(
+ TASK_ID,
+ TMTEST.MIDDLE_TASKS'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START MIDDLE" );
+
+ end loop;
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ),
+ PRIORITY,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ LOW_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF LOW TASK" );
+
+ RTEMS.TASKS.START( LOW_ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF LOW TASK" );
+
+ RTEMS.SEMAPHORE.CREATE(
+ RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ),
+ 0,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ RTEMS.TASKS.NO_PRIORITY,
+ TMTEST.SEMAPHORE_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" );
+
+ end TEST_INIT;
+
+--
+-- HIGH_TASK
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.SEMAPHORE.OBTAIN(
+ TMTEST.SEMAPHORE_ID,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
+
+ end HIGH_TASK;
+
+--
+-- MIDDLE_TASKS
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ RTEMS.SEMAPHORE.OBTAIN(
+ TMTEST.SEMAPHORE_ID,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
+
+ end MIDDLE_TASKS;
+
+--
+-- LOW_TASK
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ begin
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SEMAPHORE_OBTAIN (blocking)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.SEMAPHORE_OBTAIN
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 2 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end LOW_TASK;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm02/tmtest.ads b/testsuites/ada/tmtests/tm02/tmtest.ads
new file mode 100644
index 0000000000..0857c93313
--- /dev/null
+++ b/testsuites/ada/tmtests/tm02/tmtest.ads
@@ -0,0 +1,104 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 2 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- The following is the ID of the semaphore used for timing operations.
+--
+
+ SEMAPHORE_ID : RTEMS.ID;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_INIT
+--
+-- DESCRIPTION:
+--
+-- This subprogram performs test initialization.
+--
+
+ procedure TEST_INIT;
+
+--
+-- HIGH_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task starts the timer and performs a blocking
+-- SEMAPHORE_OBTAIN.
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASK);
+
+--
+-- MIDDLE_TASKS
+--
+-- DESCRIPTION:
+--
+-- These RTEMS task start the timer and performs a blocking
+-- SEMAPHORE_OBTAIN.
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, MIDDLE_TASKS);
+
+--
+-- LOW_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task stops the timer and reports the execution time for
+-- a blocking SEMAPHORE_OBTAIN.
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, LOW_TASK);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm03/Makefile.am b/testsuites/ada/tmtests/tm03/Makefile.am
new file mode 100644
index 0000000000..81aa66358f
--- /dev/null
+++ b/testsuites/ada/tmtests/tm03/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm03
+ada_tm03_SOURCES = tm03.adb config.h tmtest.adb tmtest.ads
+ada_tm03_SOURCES += ../../support/init.c
+
+ada_tm03$(EXEEXT): tm03.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm03/config.h b/testsuites/ada/tmtests/tm03/config.h
new file mode 100644
index 0000000000..b03802dcc5
--- /dev/null
+++ b/testsuites/ada/tmtests/tm03/config.h
@@ -0,0 +1,33 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_TIMERS 110
+#define CONFIGURE_MAXIMUM_SEMAPHORES 101
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm03/tm03.adb b/testsuites/ada/tmtests/tm03/tm03.adb
new file mode 100644
index 0000000000..9a95e5e1d0
--- /dev/null
+++ b/testsuites/ada/tmtests/tm03/tm03.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM03 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM03 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM03;
+
diff --git a/testsuites/ada/tmtests/tm03/tmtest.adb b/testsuites/ada/tmtests/tm03/tmtest.adb
new file mode 100644
index 0000000000..a6e7606920
--- /dev/null
+++ b/testsuites/ada/tmtests/tm03/tmtest.adb
@@ -0,0 +1,190 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 3 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+with RTEMS.SEMAPHORE;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ TASK_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 3 ***" );
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ),
+ 252,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TEST_INIT" );
+
+ RTEMS.TASKS.START( TASK_ID, TMTEST.TEST_INIT'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TEST_INIT" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_INIT
+--
+
+ procedure TEST_INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ PRIORITY : RTEMS.TASKS.PRIORITY;
+ TASK_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ PRIORITY := 250;
+
+ RTEMS.SEMAPHORE.CREATE(
+ RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ),
+ 0,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ RTEMS.TASKS.NO_PRIORITY,
+ TMTEST.SEMAPHORE_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" );
+
+ for INDEX in 2 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'M', 'I', 'D', ' ' ),
+ PRIORITY,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE MIDDLE" );
+
+ PRIORITY := PRIORITY - 1;
+
+ RTEMS.TASKS.START( TASK_ID, TMTEST.MIDDLE_TASKS'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START MIDDLE" );
+
+ end loop;
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ),
+ PRIORITY,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF HIGH TASK" );
+
+ RTEMS.TASKS.START( TASK_ID, TMTEST.HIGH_TASK'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF HIGH TASK" );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.SEMAPHORE.RELEASE( TMTEST.SEMAPHORE_ID, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" );
+
+ end TEST_INIT;
+
+--
+-- MIDDLE_TASKS
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ RTEMS.SEMAPHORE.OBTAIN(
+ TMTEST.SEMAPHORE_ID,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
+
+ RTEMS.SEMAPHORE.RELEASE( TMTEST.SEMAPHORE_ID, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" );
+
+ end MIDDLE_TASKS;
+
+--
+-- HIGH_TASK
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ RTEMS.SEMAPHORE.OBTAIN(
+ TMTEST.SEMAPHORE_ID,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ STATUS
+ );
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "LAST CALL DID NOT WORK" );
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SEMAPHORE_RELEASE (preemptive)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.SEMAPHORE_RELEASE
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 3 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end HIGH_TASK;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm03/tmtest.ads b/testsuites/ada/tmtests/tm03/tmtest.ads
new file mode 100644
index 0000000000..4acd5f7a77
--- /dev/null
+++ b/testsuites/ada/tmtests/tm03/tmtest.ads
@@ -0,0 +1,96 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 3 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- The following is the ID of the semaphore used for timing operations.
+--
+
+ SEMAPHORE_ID : RTEMS.ID;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_INIT
+--
+-- DESCRIPTION:
+--
+-- This subprogram performs test initialization. After completion
+-- of test initialization, the timer is started and a preemptive
+-- SEMAPHORE_RELEASE is performed.
+--
+
+ procedure TEST_INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TEST_INIT);
+
+--
+-- MIDDLE_TASKS
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task performs a blocking SEMAPHORE_OBTAIN. Once
+-- is obtains the semaphore unit and executes again, it performs
+-- a preemptive SEMAPHORE_RELEASE.
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, MIDDLE_TASKS);
+
+--
+-- HIGH_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task stops the timer and reports the execution
+-- timer for a preemptive SEMAPHORE_RELEASE.
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASK);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm04/Makefile.am b/testsuites/ada/tmtests/tm04/Makefile.am
new file mode 100644
index 0000000000..2aa62a790f
--- /dev/null
+++ b/testsuites/ada/tmtests/tm04/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm04
+ada_tm04_SOURCES = tm04.adb config.h tmtest.adb tmtest.ads
+ada_tm04_SOURCES += ../../support/init.c
+
+ada_tm04$(EXEEXT): tm04.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm04/config.h b/testsuites/ada/tmtests/tm04/config.h
new file mode 100644
index 0000000000..700438ceae
--- /dev/null
+++ b/testsuites/ada/tmtests/tm04/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_SEMAPHORES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm04/tm04.adb b/testsuites/ada/tmtests/tm04/tm04.adb
new file mode 100644
index 0000000000..28e75c7db5
--- /dev/null
+++ b/testsuites/ada/tmtests/tm04/tm04.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM04 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM04 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM04;
+
diff --git a/testsuites/ada/tmtests/tm04/tmtest.adb b/testsuites/ada/tmtests/tm04/tmtest.adb
new file mode 100644
index 0000000000..7278bf2432
--- /dev/null
+++ b/testsuites/ada/tmtests/tm04/tmtest.adb
@@ -0,0 +1,494 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 4 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIMER_DRIVER;
+with RTEMS.SEMAPHORE;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 4 ***" );
+
+ TMTEST.TEST_INIT;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_INIT
+--
+
+ procedure TEST_INIT
+ is
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TMTEST.TASK_COUNT := TIME_TEST_SUPPORT.OPERATION_COUNT;
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ 10,
+ 1024,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( INDEX ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( INDEX ),
+ TMTEST.LOW_TASKS'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ end loop;
+
+ RTEMS.SEMAPHORE.CREATE(
+ RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ),
+ 0,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ RTEMS.TASKS.NO_PRIORITY,
+ TMTEST.SEMAPHORE_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" );
+
+ end TEST_INIT;
+
+--
+-- HIGHEST_TASK
+--
+
+ procedure HIGHEST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ OLD_PRIORITY : RTEMS.TASKS.PRIORITY;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ if ARGUMENT = 1 then
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_RESTART (blocked, preempt)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TASK_RESTART
+ );
+
+ RTEMS.TASKS.SET_PRIORITY( RTEMS.SELF, 254, OLD_PRIORITY, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
+
+ elsif ARGUMENT = 2 then
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_RESTART (ready, preempt)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TASK_RESTART
+ );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" );
+
+ else
+
+ RTEMS.SEMAPHORE.OBTAIN(
+ TMTEST.SEMAPHORE_ID,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ STATUS
+ );
+
+ end if;
+
+ end HIGHEST_TASK;
+
+--
+-- HIGH_TASK
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ OLD_PRIORITY : RTEMS.TASKS.PRIORITY;
+ OVERHEAD : RTEMS.UNSIGNED32;
+ NAME : RTEMS.NAME;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.TASKS.RESTART( TMTEST.HIGHEST_ID, 1, STATUS );
+ -- preempted by Higher_task
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART" );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.TASKS.RESTART( TMTEST.HIGHEST_ID, 2, STATUS );
+ -- preempted by Higher_task
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART" );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ OVERHEAD := TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.SEMAPHORE.RELEASE( TMTEST.SEMAPHORE_ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" );
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SEMAPHORE_RELEASE (readying)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.SEMAPHORE_RELEASE
+ );
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.DELETE( TMTEST.TASK_ID( INDEX ), STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" );
+ end loop;
+
+ NAME := RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.CREATE(
+ NAME,
+ 10,
+ 1024,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( INDEX ),
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_CREATE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_CREATE
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( INDEX ),
+ TMTEST.LOW_TASKS'ACCESS,
+ 0,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_START",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_START
+ );
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.DELETE( TMTEST.TASK_ID( INDEX ), STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE LOOP" );
+ end loop;
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.CREATE(
+ NAME,
+ 250,
+ 1024,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( INDEX ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( INDEX ),
+ TMTEST.RESTART_TASK'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+ RTEMS.TASKS.SUSPEND( TMTEST.TASK_ID( INDEX ), STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND LOOP" );
+ end loop;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.RESTART( TMTEST.TASK_ID( INDEX ), 0, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_RESTART (suspended)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_RESTART
+ );
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.SUSPEND( TMTEST.TASK_ID( INDEX ), STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND LOOP" );
+ end loop;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.DELETE( TMTEST.TASK_ID( INDEX ), STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_DELETE (suspended)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_DELETE
+ );
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.CREATE(
+ NAME,
+ 250,
+ 1024,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( INDEX ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( INDEX ),
+ TMTEST.RESTART_TASK'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+ end loop;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.RESTART( TMTEST.TASK_ID( INDEX ), 1, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_RESTART (ready)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_RESTART
+ );
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.SET_PRIORITY(
+ TMTEST.TASK_ID( INDEX ),
+ 5,
+ OLD_PRIORITY,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY LOOP" );
+ end loop;
+
+ -- yield processor -- tasks block
+ RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.RESTART( TMTEST.TASK_ID( INDEX ), 1, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_RESTART (blocked, no preempt)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_RESTART
+ );
+
+ -- yield processor -- tasks block
+ RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.DELETE( TMTEST.TASK_ID( INDEX ), STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_DELETE (blocked)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_DELETE
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 4 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end HIGH_TASK;
+
+--
+-- LOW_TASKS
+--
+
+ procedure LOW_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TMTEST.TASK_COUNT := TMTEST.TASK_COUNT - 1;
+
+ if TMTEST.TASK_COUNT = 0 then
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'H', 'I', ' ', ' ' ),
+ 5,
+ 2048,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HI" );
+
+ RTEMS.TASKS.START(
+ ID,
+ TMTEST.HIGH_TASK'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HI" );
+
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ),
+ 3,
+ 2048,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.HIGHEST_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HIGH" );
+
+ RTEMS.TASKS.START(
+ TMTEST.HIGHEST_ID,
+ TMTEST.HIGHEST_TASK'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HIGH" );
+
+
+ end if;
+
+ RTEMS.SEMAPHORE.OBTAIN(
+ TMTEST.SEMAPHORE_ID,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
+
+ end LOW_TASKS;
+
+--
+-- RESTART_TASK
+--
+
+ procedure RESTART_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ if ARGUMENT = 1 then
+ RTEMS.SEMAPHORE.OBTAIN(
+ TMTEST.SEMAPHORE_ID,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ STATUS
+ );
+ end if;
+
+ end RESTART_TASK;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm04/tmtest.ads b/testsuites/ada/tmtests/tm04/tmtest.ads
new file mode 100644
index 0000000000..e1f303ee2f
--- /dev/null
+++ b/testsuites/ada/tmtests/tm04/tmtest.ads
@@ -0,0 +1,163 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 4 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with TIME_TEST_SUPPORT;
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- This array contains the IDs of all RTEMS tasks created by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32
+ range 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
+
+--
+-- This variable contains the id of the highest priority task
+-- in the system.
+--
+
+ HIGHEST_ID : RTEMS.ID;
+
+--
+-- The following is the ID of the semaphore used for timing operations.
+--
+
+ SEMAPHORE_ID : RTEMS.ID;
+
+--
+-- The following is used to perform the same operation
+-- on a group of tasks.
+--
+
+ TASK_COUNT : RTEMS.UNSIGNED32;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_INIT
+--
+-- DESCRIPTION:
+--
+-- This subprogram performs test initialization.
+--
+
+ procedure TEST_INIT;
+
+--
+-- HIGHEST_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is created by one of the LOW_TASKS. The
+-- first time it executes, it performs a blocking SEMAPHORE_OBTAIN
+-- which transfers control of the processor to HIGH_TASK.
+-- The first time HIGHEST_TASK is restarted, it stops the
+-- timer and reports the execution time for a TASK_RESTART
+-- for a blocked task which preempts the caller. The second
+-- time HIGHEST_TASK is restarted, it stops the timer and reports
+-- the execution time for a TASK_RESTART for a ready task which
+-- has its original priority restored and preempts the caller.
+--
+
+ procedure HIGHEST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGHEST_TASK);
+
+--
+-- HIGH_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is created by one of the LOW_TASKS. This
+-- task restarts HIGHEST_TASK twice. HIGHEST_TASK is blocked the
+-- first time and preempts this task when restarted. HIGHEST_TASK
+-- is ready the second time but has lowered its priority. When
+-- restarted for the second time, HIGHEST_TASK will have its
+-- original priority restored and preempt this task.
+-- Once control of the processor is returned to this task after
+-- HIGHEST_TASK deletes itself, the following execution times
+-- are measured and reported.
+--
+-- + readying SEMAPHORE_RELEASE
+-- + TASK_CREATE
+-- + TASK_START
+-- + TASK_RESTART of a suspended task
+-- + TASK_DELETE of a suspended task
+-- + TASK_RESTART of a ready task
+-- + TASK_RESTART of a blocked task which does not cause a preempt
+-- + TASK_DELETE of a blocked task
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASK);
+
+--
+-- LOW_TASKS
+--
+-- DESCRIPTION:
+--
+-- The last of these RTEMS tasks to execute creates HIGH_TASK
+-- and HIGHEST_TASK. All of these tasks perform a blocking
+-- SEMAPHORE_OBTAIN.
+--
+
+ procedure LOW_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, LOW_TASKS);
+
+--
+-- RESTART_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task
+--
+
+ procedure RESTART_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, RESTART_TASK);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm05/Makefile.am b/testsuites/ada/tmtests/tm05/Makefile.am
new file mode 100644
index 0000000000..1d723e1f85
--- /dev/null
+++ b/testsuites/ada/tmtests/tm05/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm05
+ada_tm05_SOURCES = tm05.adb config.h tmtest.adb tmtest.ads
+ada_tm05_SOURCES += ../../support/init.c
+
+ada_tm05$(EXEEXT): tm05.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm05/config.h b/testsuites/ada/tmtests/tm05/config.h
new file mode 100644
index 0000000000..b03802dcc5
--- /dev/null
+++ b/testsuites/ada/tmtests/tm05/config.h
@@ -0,0 +1,33 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_TIMERS 110
+#define CONFIGURE_MAXIMUM_SEMAPHORES 101
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm05/tm05.adb b/testsuites/ada/tmtests/tm05/tm05.adb
new file mode 100644
index 0000000000..eaa0741592
--- /dev/null
+++ b/testsuites/ada/tmtests/tm05/tm05.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM05 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM05 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM05;
+
diff --git a/testsuites/ada/tmtests/tm05/tmtest.adb b/testsuites/ada/tmtests/tm05/tmtest.adb
new file mode 100644
index 0000000000..c334acd526
--- /dev/null
+++ b/testsuites/ada/tmtests/tm05/tmtest.adb
@@ -0,0 +1,170 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 5 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIMER_DRIVER;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 5 ***" );
+
+ TMTEST.TEST_INIT;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_INIT
+--
+
+ procedure TEST_INIT
+ is
+ TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT;
+ PRIORITY : RTEMS.TASKS.PRIORITY;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ PRIORITY := 250;
+
+ for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ PRIORITY,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( INDEX ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ PRIORITY := PRIORITY - 1;
+
+ if INDEX = 0 then
+ TASK_ENTRY := TMTEST.LOW_TASK'ACCESS;
+ elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then
+ TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
+ else
+ TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
+ end if;
+
+ RTEMS.TASKS.START( TMTEST.TASK_ID( INDEX ), TASK_ENTRY, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ end loop;
+
+ end TEST_INIT;
+
+--
+-- HIGH_TASK
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPENT" );
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_RESUME causing preempt",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TASK_RESUME
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 5 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end HIGH_TASK;
+
+--
+-- MIDDLE_TASKS
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" );
+
+ TMTEST.TASK_INDEX := TMTEST.TASK_INDEX + 1;
+ RTEMS.TASKS.RESUME( TMTEST.TASK_ID( TMTEST.TASK_INDEX ), STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" );
+
+ end MIDDLE_TASKS;
+
+--
+-- LOW_TASK
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_SUSPEND self",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TASK_SUSPEND
+ );
+
+ TMTEST.TASK_INDEX := 1;
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.TASKS.RESUME( TMTEST.TASK_ID( TMTEST.TASK_INDEX ), STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" );
+
+ end LOW_TASK;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm05/tmtest.ads b/testsuites/ada/tmtests/tm05/tmtest.ads
new file mode 100644
index 0000000000..f705c936df
--- /dev/null
+++ b/testsuites/ada/tmtests/tm05/tmtest.ads
@@ -0,0 +1,114 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 5 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with TIME_TEST_SUPPORT;
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- This array contains the IDs of all RTEMS tasks created by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32
+ range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
+
+ TASK_INDEX : RTEMS.UNSIGNED32;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_INIT
+--
+-- DESCRIPTION:
+--
+-- This subprogram performs test initialization.
+--
+
+ procedure TEST_INIT;
+
+--
+-- HIGH_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is the highest priority task in the system.
+-- It starts the timer and performs a TASK_SUSPEND on SELF.
+-- When this task executes again, it stops the timer and
+-- reports the execution time for a preemptive TASK_RESUME.
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASK);
+
+--
+-- MIDDLE_TASKS
+--
+-- DESCRIPTION:
+--
+-- These RTEMS tasks perform a TASK_SUSPEND on SELF. When each
+-- task executes again, it performs preemptive TASK_RESUME on
+-- a higher priority task.
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, MIDDLE_TASKS);
+
+--
+-- LOW_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is the lowest priority task in the system.
+-- When this task executes, it stops the timer and reports the
+-- execution time for a blocking TASK_SUSPEND. After this,
+-- it starts the timer and performs a TASK_RESUME on a
+-- higher priority task.
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, LOW_TASK);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm06/Makefile.am b/testsuites/ada/tmtests/tm06/Makefile.am
new file mode 100644
index 0000000000..a1e5edfc1c
--- /dev/null
+++ b/testsuites/ada/tmtests/tm06/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm06
+ada_tm06_SOURCES = tm06.adb config.h tmtest.adb tmtest.ads
+ada_tm06_SOURCES += ../../support/init.c
+
+ada_tm06$(EXEEXT): tm06.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm06/config.h b/testsuites/ada/tmtests/tm06/config.h
new file mode 100644
index 0000000000..b03802dcc5
--- /dev/null
+++ b/testsuites/ada/tmtests/tm06/config.h
@@ -0,0 +1,33 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_TIMERS 110
+#define CONFIGURE_MAXIMUM_SEMAPHORES 101
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm06/tm06.adb b/testsuites/ada/tmtests/tm06/tm06.adb
new file mode 100644
index 0000000000..db064adb4d
--- /dev/null
+++ b/testsuites/ada/tmtests/tm06/tm06.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM06 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM06 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM06;
+
diff --git a/testsuites/ada/tmtests/tm06/tmtest.adb b/testsuites/ada/tmtests/tm06/tmtest.adb
new file mode 100644
index 0000000000..2f0f8b1a26
--- /dev/null
+++ b/testsuites/ada/tmtests/tm06/tmtest.adb
@@ -0,0 +1,202 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 6 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIMER_DRIVER;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 6 ***" );
+
+ TMTEST.TEST_INIT;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_INIT
+--
+
+ procedure TEST_INIT
+ is
+ ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TMTEST.TASK_RESTARTED := TIME_TEST_SUPPORT.OPERATION_COUNT;
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ 128,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
+
+ RTEMS.TASKS.START( ID, TMTEST.TASK_1'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
+
+ end TEST_INIT;
+
+--
+-- TASK_1
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ OVERHEAD : RTEMS.UNSIGNED32;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ if TMTEST.TASK_RESTARTED = TIME_TEST_SUPPORT.OPERATION_COUNT then
+ TIMER_DRIVER.INITIALIZE;
+ end if;
+
+ TMTEST.TASK_RESTARTED := TMTEST.TASK_RESTARTED - 1;
+
+ if TMTEST.TASK_RESTARTED /= 0 then
+ RTEMS.TASKS.RESTART( RTEMS.SELF, 0, STATUS );
+ end if;
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ OVERHEAD := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_RESTART self",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TASK_RESTART
+ );
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ 254,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( INDEX ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( INDEX ),
+ TMTEST.NULL_TASK'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ end loop;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.SUSPEND( TMTEST.TASK_ID( INDEX ), STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_SUSPEND no preempt",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_SUSPEND
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.RESUME( TMTEST.TASK_ID( INDEX ), STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_RESUME no preempt",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_RESUME
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.DELETE( TMTEST.TASK_ID( INDEX ), STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_DELETE others",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_DELETE
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 6 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end TASK_1;
+
+--
+-- NULL_TASK
+--
+
+ procedure NULL_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ begin
+
+ NULL;
+
+ end NULL_TASK;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm06/tmtest.ads b/testsuites/ada/tmtests/tm06/tmtest.ads
new file mode 100644
index 0000000000..a6eb2b2df8
--- /dev/null
+++ b/testsuites/ada/tmtests/tm06/tmtest.ads
@@ -0,0 +1,104 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 6 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with TIME_TEST_SUPPORT;
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- This array contains the IDs of all RTEMS tasks created by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32
+ range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
+
+--
+-- This variable is used to determine which restart of TASK_1 will start
+-- timer and which will stop the timer and report the execution time.
+--
+
+ TASK_RESTARTED : RTEMS.UNSIGNED32;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_INIT
+--
+-- DESCRIPTION:
+--
+-- This subprogram performs test initialization.
+--
+
+ procedure TEST_INIT;
+
+--
+-- TASK_1
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is responsible for measuring and reporting the
+-- following directive execution times:
+--
+-- + TASK_RESTART of SELF
+-- + TASK_SUSPEND of another task with no context switch
+-- + TASK_RESUME with no preemption
+-- + TASK_DELETE of another task
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TASK_1);
+
+--
+-- NULL_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task has no operations. It is used to have
+-- tasks to perform directives upon.
+--
+
+ procedure NULL_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, NULL_TASK);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm07/Makefile.am b/testsuites/ada/tmtests/tm07/Makefile.am
new file mode 100644
index 0000000000..446c47dee1
--- /dev/null
+++ b/testsuites/ada/tmtests/tm07/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm07
+ada_tm07_SOURCES = tm07.adb config.h tmtest.adb tmtest.ads
+ada_tm07_SOURCES += ../../support/init.c
+
+ada_tm07$(EXEEXT): tm07.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm07/config.h b/testsuites/ada/tmtests/tm07/config.h
new file mode 100644
index 0000000000..b03802dcc5
--- /dev/null
+++ b/testsuites/ada/tmtests/tm07/config.h
@@ -0,0 +1,33 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_TIMERS 110
+#define CONFIGURE_MAXIMUM_SEMAPHORES 101
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm07/tm07.adb b/testsuites/ada/tmtests/tm07/tm07.adb
new file mode 100644
index 0000000000..342406b38f
--- /dev/null
+++ b/testsuites/ada/tmtests/tm07/tm07.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM07 of the Single Processor Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM07 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM07;
+
diff --git a/testsuites/ada/tmtests/tm07/tmtest.adb b/testsuites/ada/tmtests/tm07/tmtest.adb
new file mode 100644
index 0000000000..c3a2c62b96
--- /dev/null
+++ b/testsuites/ada/tmtests/tm07/tmtest.adb
@@ -0,0 +1,170 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 7 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIMER_DRIVER;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 7 ***" );
+
+ TMTEST.TEST_INIT;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_INIT
+--
+
+ procedure TEST_INIT
+ is
+ TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT;
+ PRIORITY : RTEMS.TASKS.PRIORITY;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ PRIORITY := 250;
+
+ for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ PRIORITY,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( INDEX ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ PRIORITY := PRIORITY - 1;
+
+ if INDEX = 0 then
+ TASK_ENTRY := TMTEST.LOW_TASK'ACCESS;
+ elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then
+ TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
+ else
+ TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
+ end if;
+
+ RTEMS.TASKS.START( TMTEST.TASK_ID( INDEX ), TASK_ENTRY, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ end loop;
+
+ end TEST_INIT;
+
+--
+-- HIGH_TASK
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ if ARGUMENT > 0 then
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_RESTART suspended/preempt",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TASK_RESTART
+ );
+ else
+ RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS );
+ end if;
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 07 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end HIGH_TASK;
+
+--
+-- MIDDLE_TASKS
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TMTEST.TASK_INDEX := TMTEST.TASK_INDEX + 1;
+
+ if ARGUMENT > 0 then
+ RTEMS.TASKS.RESTART(
+ TMTEST.TASK_ID( TMTEST.TASK_INDEX ),
+ 16#7FFFFFFF#,
+ STATUS
+ );
+ else
+ RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS );
+ end if;
+
+
+ end MIDDLE_TASKS;
+
+--
+-- LOW_TASK
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TMTEST.TASK_INDEX := 1;
+ TIMER_DRIVER.INITIALIZE;
+
+ RTEMS.TASKS.RESTART(
+ TMTEST.TASK_ID( TMTEST.TASK_INDEX ),
+ 16#7FFFFFFF#,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART" );
+
+ end LOW_TASK;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm07/tmtest.ads b/testsuites/ada/tmtests/tm07/tmtest.ads
new file mode 100644
index 0000000000..3abc539505
--- /dev/null
+++ b/testsuites/ada/tmtests/tm07/tmtest.ads
@@ -0,0 +1,112 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 7 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with TIME_TEST_SUPPORT;
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- This array contains the IDs of all RTEMS tasks created by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32
+ range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
+
+ TASK_INDEX : RTEMS.UNSIGNED32;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_INIT
+--
+-- DESCRIPTION:
+--
+-- This subprogram performs test initialization.
+--
+
+ procedure TEST_INIT;
+
+--
+-- HIGH_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is the highest priority task in the system.
+-- The first time it executes it suspends itself. When restarted
+-- it stops the timer and reports the time for a TASK_RESTART
+-- of a suspended task which results in a preemption.
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASK);
+
+--
+-- MIDDLE_TASKS
+--
+-- DESCRIPTION:
+--
+-- These RTEMS tasks suspend themselves the first time they execute.
+-- When restarted they perform a TASK_RESTART of a suspended
+-- higher priority task which results in a preemption.
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, MIDDLE_TASKS);
+
+--
+-- LOW_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is the lowest priority task in the system.
+-- When it executes it starts the timer and restarts a higher
+-- priority task which immediately preempts this task.
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, LOW_TASK);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm08/Makefile.am b/testsuites/ada/tmtests/tm08/Makefile.am
new file mode 100644
index 0000000000..1b796066b0
--- /dev/null
+++ b/testsuites/ada/tmtests/tm08/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm08
+ada_tm08_SOURCES = tm08.adb config.h tmtest.adb tmtest.ads
+ada_tm08_SOURCES += ../../support/init.c
+
+ada_tm08$(EXEEXT): tm08.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm08/config.h b/testsuites/ada/tmtests/tm08/config.h
new file mode 100644
index 0000000000..b03802dcc5
--- /dev/null
+++ b/testsuites/ada/tmtests/tm08/config.h
@@ -0,0 +1,33 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_TIMERS 110
+#define CONFIGURE_MAXIMUM_SEMAPHORES 101
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm08/tm08.adb b/testsuites/ada/tmtests/tm08/tm08.adb
new file mode 100644
index 0000000000..d927a18d63
--- /dev/null
+++ b/testsuites/ada/tmtests/tm08/tm08.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM08 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM08 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM08;
+
diff --git a/testsuites/ada/tmtests/tm08/tmtest.adb b/testsuites/ada/tmtests/tm08/tmtest.adb
new file mode 100644
index 0000000000..c1dbcb3e30
--- /dev/null
+++ b/testsuites/ada/tmtests/tm08/tmtest.adb
@@ -0,0 +1,299 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 8 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+with RTEMS.CLOCK;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 8 ***" );
+
+ TMTEST.TEST_INIT;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_INIT
+--
+
+ procedure TEST_INIT
+ is
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ RTEMS.TASKS.CREATE(
+ 1,
+ 128,
+ 1024,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
+
+ RTEMS.TASKS.START( TASK_ID, TMTEST.TEST_TASK'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
+
+ RTEMS.TASKS.CREATE(
+ 1,
+ 254,
+ 1024,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
+
+ RTEMS.TASKS.START( TASK_ID, TMTEST.TEST_TASK1'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
+
+ end TEST_INIT;
+
+--
+-- TEST_TASK
+--
+
+ procedure TEST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ OVERHEAD : RTEMS.UNSIGNED32;
+ OLD_PRIORITY : RTEMS.TASKS.PRIORITY;
+ OLD_MODE : RTEMS.MODE;
+ TIME : RTEMS.TIME_OF_DAY;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ OVERHEAD := TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.SET_PRIORITY(
+ TMTEST.TASK_ID,
+ RTEMS.TASKS.CURRENT_PRIORITY,
+ OLD_PRIORITY,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_SET_PRIORITY current priority",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_SET_PRIORITY
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.SET_PRIORITY(
+ TMTEST.TASK_ID,
+ 253,
+ OLD_PRIORITY,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_SET_PRIORITY no preempt",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_SET_PRIORITY
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.MODE(
+ RTEMS.CURRENT_MODE,
+ RTEMS.CURRENT_MODE,
+ OLD_MODE,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_MODE (current)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_MODE
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.MODE(
+ RTEMS.INTERRUPT_LEVEL( 1 ),
+ RTEMS.INTERRUPT_MASK,
+ OLD_MODE,
+ STATUS
+ );
+ RTEMS.TASKS.MODE(
+ RTEMS.INTERRUPT_LEVEL( 0 ),
+ RTEMS.INTERRUPT_MASK,
+ OLD_MODE,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_MODE (no reschedule)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT * 2,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_MODE
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.TASKS.MODE(
+ RTEMS.NO_ASR,
+ RTEMS.ASR_MASK,
+ OLD_MODE,
+ STATUS
+ );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_MODE (reschedule)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TASK_MODE
+ );
+
+ RTEMS.TASKS.MODE(
+ RTEMS.NO_PREEMPT,
+ RTEMS.PREEMPT_MASK,
+ OLD_MODE,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
+
+ RTEMS.TASKS.SET_PRIORITY(
+ TMTEST.TASK_ID,
+ 1,
+ OLD_PRIORITY,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.TASKS.MODE( -- preempted by TEST_TASK1
+ RTEMS.PREEMPT,
+ RTEMS.PREEMPT_MASK,
+ OLD_MODE,
+ STATUS
+ );
+
+ TIME := (1988, 1, 1, 0, 0, 0, 0 );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.CLOCK.SET(
+ TIME,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "CLOCK_SET",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.CLOCK_SET
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.CLOCK.GET_TOD( TIME, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "CLOCK_GET_TOD",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.CLOCK_GET
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 8 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end TEST_TASK;
+
+--
+-- TEST_TASK1
+--
+
+ procedure TEST_TASK1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_MODE (preemptive) ",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TASK_MODE
+ );
+
+ RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "DOES NOT RETURN" );
+
+ end TEST_TASK1;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm08/tmtest.ads b/testsuites/ada/tmtests/tm08/tmtest.ads
new file mode 100644
index 0000000000..695235f479
--- /dev/null
+++ b/testsuites/ada/tmtests/tm08/tmtest.ads
@@ -0,0 +1,96 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 8 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+ TASK_ID : RTEMS.ID;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_INIT
+--
+-- DESCRIPTION:
+--
+-- This subprogram performs test initialization.
+--
+
+ procedure TEST_INIT;
+
+--
+-- TEST_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is responsible for measuring and reporting the
+-- following directive execution times:
+--
+-- + TASK_SET_PRIORITY to obtain the current priority
+-- + TASK_SET_PRIORITY which does not require a context switch
+-- + TASK_MODE to obtain the current mode
+-- + TASK_MODE which does not require a reschedule
+-- + TASK_MODE which does require a reschedule
+-- + TASK_MODE which causes a preemption *** TEST_TASK1 executes
+-- + CLOCK_SET
+--
+
+ procedure TEST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TEST_TASK);
+
+--
+-- TEST_TASK2
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is responsible for measuring and reporting the
+-- following directive execution times:
+--
+-- + TASK_MODE which results in a preemption
+--
+
+ procedure TEST_TASK1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TEST_TASK1);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm09/Makefile.am b/testsuites/ada/tmtests/tm09/Makefile.am
new file mode 100644
index 0000000000..02a2317d34
--- /dev/null
+++ b/testsuites/ada/tmtests/tm09/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm09
+ada_tm09_SOURCES = tm09.adb config.h tmtest.adb tmtest.ads
+ada_tm09_SOURCES += ../../support/init.c
+
+ada_tm09$(EXEEXT): tm09.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm09/config.h b/testsuites/ada/tmtests/tm09/config.h
new file mode 100644
index 0000000000..56b5b2848e
--- /dev/null
+++ b/testsuites/ada/tmtests/tm09/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-2007.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 2
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm09/tm09.adb b/testsuites/ada/tmtests/tm09/tm09.adb
new file mode 100644
index 0000000000..6fe1971d44
--- /dev/null
+++ b/testsuites/ada/tmtests/tm09/tm09.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM09 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM09 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM09;
+
diff --git a/testsuites/ada/tmtests/tm09/tmtest.adb b/testsuites/ada/tmtests/tm09/tmtest.adb
new file mode 100644
index 0000000000..432a7b50a8
--- /dev/null
+++ b/testsuites/ada/tmtests/tm09/tmtest.adb
@@ -0,0 +1,297 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 9 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+with RTEMS.MESSAGE_QUEUE;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ TASK_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 9 ***" );
+
+ RTEMS.TASKS.CREATE(
+ 1,
+ 128,
+ 4096,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
+
+ RTEMS.TASKS.START( TASK_ID, TMTEST.TEST_TASK'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_TASK
+--
+
+ procedure TEST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.MESSAGE_QUEUE.CREATE(
+ 1,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 16,
+ RTEMS.DEFAULT_OPTIONS,
+ TMTEST.QUEUE_ID,
+ STATUS
+ );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_CREATE",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_CREATE
+ );
+
+ TMTEST.QUEUE_TEST;
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.MESSAGE_QUEUE.DELETE(
+ TMTEST.QUEUE_ID,
+ STATUS
+ );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" );
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_DELETE",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_DELETE
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 9 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end TEST_TASK;
+
+--
+-- QUEUE_TEST
+--
+
+ procedure QUEUE_TEST
+ is
+ SEND_LOOP_TIME : RTEMS.UNSIGNED32;
+ URGENT_LOOP_TIME : RTEMS.UNSIGNED32;
+ RECEIVE_LOOP_TIME : RTEMS.UNSIGNED32;
+ SEND_TIME : RTEMS.UNSIGNED32;
+ URGENT_TIME : RTEMS.UNSIGNED32;
+ RECEIVE_TIME : RTEMS.UNSIGNED32;
+ EMPTY_FLUSH_TIME : RTEMS.UNSIGNED32;
+ FLUSH_TIME : RTEMS.UNSIGNED32;
+ FLUSH_COUNT : RTEMS.UNSIGNED32;
+ EMPTY_FLUSH_COUNT : RTEMS.UNSIGNED32;
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ SEND_LOOP_TIME := 0;
+ URGENT_LOOP_TIME := 0;
+ RECEIVE_LOOP_TIME := 0;
+ SEND_TIME := 0;
+ URGENT_TIME := 0;
+ RECEIVE_TIME := 0;
+ EMPTY_FLUSH_TIME := 0;
+ FLUSH_TIME := 0;
+ FLUSH_COUNT := 0;
+ EMPTY_FLUSH_COUNT := 0;
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ for ITERATIONS in 1 .. TIME_TEST_SUPPORT.ITERATION_COUNT
+ loop
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ SEND_LOOP_TIME := SEND_LOOP_TIME + TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ URGENT_LOOP_TIME := URGENT_LOOP_TIME + TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ RECEIVE_LOOP_TIME := RECEIVE_LOOP_TIME + TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.MESSAGE_QUEUE.SEND(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ 16,
+ STATUS
+ );
+ end loop;
+ SEND_TIME := SEND_TIME + TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.MESSAGE_QUEUE.RECEIVE(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ MESSAGE_SIZE,
+ STATUS
+ );
+ end loop;
+ RECEIVE_TIME := RECEIVE_TIME + TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.MESSAGE_QUEUE.URGENT(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ 16,
+ STATUS
+ );
+ end loop;
+ URGENT_TIME := URGENT_TIME + TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.MESSAGE_QUEUE.RECEIVE(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ MESSAGE_SIZE,
+ STATUS
+ );
+ end loop;
+ RECEIVE_TIME := RECEIVE_TIME + TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.MESSAGE_QUEUE.FLUSH(
+ TMTEST.QUEUE_ID,
+ EMPTY_FLUSH_COUNT,
+ STATUS
+ );
+ EMPTY_FLUSH_TIME := EMPTY_FLUSH_TIME + TIMER_DRIVER.READ_TIMER;
+
+ -- send one message to flush
+ RTEMS.MESSAGE_QUEUE.SEND(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ 16,
+ STATUS
+ );
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.MESSAGE_QUEUE.FLUSH(
+ TMTEST.QUEUE_ID,
+ FLUSH_COUNT,
+ STATUS
+ );
+ FLUSH_TIME := FLUSH_TIME + TIMER_DRIVER.READ_TIMER;
+
+ end loop;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_SEND (no tasks waiting)",
+ SEND_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT *
+ TIME_TEST_SUPPORT.ITERATION_COUNT,
+ SEND_LOOP_TIME,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_SEND
+ );
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_URGENT (no tasks waiting)",
+ URGENT_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT *
+ TIME_TEST_SUPPORT.ITERATION_COUNT,
+ URGENT_LOOP_TIME,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_URGENT
+ );
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_RECEIVE (messages available)",
+ RECEIVE_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT *
+ TIME_TEST_SUPPORT.ITERATION_COUNT * 2,
+ RECEIVE_LOOP_TIME * 2,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_RECEIVE
+ );
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_FLUSH (empty queue)",
+ EMPTY_FLUSH_TIME,
+ TIME_TEST_SUPPORT.ITERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_FLUSH
+ );
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_FLUSH (messages flushed)",
+ FLUSH_TIME,
+ TIME_TEST_SUPPORT.ITERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_FLUSH
+ );
+
+ end QUEUE_TEST;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm09/tmtest.ads b/testsuites/ada/tmtests/tm09/tmtest.ads
new file mode 100644
index 0000000000..ca02e74a51
--- /dev/null
+++ b/testsuites/ada/tmtests/tm09/tmtest.ads
@@ -0,0 +1,99 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 9 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- Buffer Record similar to that used by RTEMS 3.2.1. Using this
+-- avoids changes to the test.
+--
+
+ type BUFFER is
+ record
+ FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
+ FIELD2 : RTEMS.UNSIGNED32;
+ FIELD3 : RTEMS.UNSIGNED32;
+ FIELD4 : RTEMS.UNSIGNED32;
+ end record;
+
+--
+-- The following is the ID of the message queue used for timing operations.
+--
+
+ QUEUE_ID : RTEMS.ID;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is responsible for measuring and reporting the
+-- following directive execution times:
+--
+-- + MESSAGE_QUEUE_CREATE
+-- + MESSAGE_QUEUE_DELETE
+--
+
+ procedure TEST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TEST_TASK);
+
+--
+-- QUEUE_TEST
+--
+-- DESCRIPTION:
+--
+-- This subprogram is responsible for measuring and reporting the
+-- following directive execution times:
+--
+-- + MESSAGE_QUEUE_SEND with no tasks waiting
+-- + MESSAGE_QUEUE_URGENT with no tasks waiting
+-- + MESSAGE_QUEUE_RECEIVE with messages available
+-- + MESSAGE_QUEUE_FLUSH with an empty message queue
+-- + MESSAGE_QUEUE_FLUSH with messages flushed
+--
+
+ procedure QUEUE_TEST;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm10/Makefile.am b/testsuites/ada/tmtests/tm10/Makefile.am
new file mode 100644
index 0000000000..8becdcbfbd
--- /dev/null
+++ b/testsuites/ada/tmtests/tm10/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm10
+ada_tm10_SOURCES = tm10.adb config.h tmtest.adb tmtest.ads
+ada_tm10_SOURCES += ../../support/init.c
+
+ada_tm10$(EXEEXT): tm10.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm10/config.h b/testsuites/ada/tmtests/tm10/config.h
new file mode 100644
index 0000000000..ee201258aa
--- /dev/null
+++ b/testsuites/ada/tmtests/tm10/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 110
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm10/tm10.adb b/testsuites/ada/tmtests/tm10/tm10.adb
new file mode 100644
index 0000000000..4117d7a01a
--- /dev/null
+++ b/testsuites/ada/tmtests/tm10/tm10.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM10 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM10 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM10;
+
diff --git a/testsuites/ada/tmtests/tm10/tmtest.adb b/testsuites/ada/tmtests/tm10/tmtest.adb
new file mode 100644
index 0000000000..9a92266cf5
--- /dev/null
+++ b/testsuites/ada/tmtests/tm10/tmtest.adb
@@ -0,0 +1,220 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 10 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+with RTEMS.MESSAGE_QUEUE;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 10 ***" );
+
+ TMTEST.TEST_INIT;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_INIT
+--
+
+ procedure TEST_INIT
+ is
+ TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT;
+ PRIORITY : RTEMS.TASKS.PRIORITY;
+ OVERHEAD : RTEMS.UNSIGNED32;
+ TASK_ID : RTEMS.ID;
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ PRIORITY := 5;
+
+ for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ PRIORITY,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ PRIORITY := PRIORITY + 1;
+
+ if INDEX = 0 then
+ TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
+ elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then
+ TASK_ENTRY := TMTEST.LOW_TASK'ACCESS;
+ else
+ TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
+ end if;
+
+ RTEMS.TASKS.START( TASK_ID, TASK_ENTRY, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ end loop;
+
+ RTEMS.MESSAGE_QUEUE.CREATE(
+ 1,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 16,
+ RTEMS.DEFAULT_OPTIONS,
+ TMTEST.QUEUE_ID,
+ STATUS
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ OVERHEAD := TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.MESSAGE_QUEUE.RECEIVE(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ RTEMS.NO_WAIT,
+ RTEMS.NO_TIMEOUT,
+ MESSAGE_SIZE,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_RECEIVE (NO_WAIT)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_RECEIVE
+ );
+
+ end TEST_INIT;
+
+--
+-- HIGH_TASK
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ TIMER_DRIVER.INITIALIZE;
+
+ RTEMS.MESSAGE_QUEUE.RECEIVE(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ MESSAGE_SIZE,
+ STATUS
+ );
+
+ end HIGH_TASK;
+
+--
+-- MIDDLE_TASKS
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ RTEMS.MESSAGE_QUEUE.RECEIVE(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ MESSAGE_SIZE,
+ STATUS
+ );
+
+ end MIDDLE_TASKS;
+
+--
+-- LOW_TASK
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ begin
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_RECEIVE (blocking)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_RECEIVE
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 10 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end LOW_TASK;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm10/tmtest.ads b/testsuites/ada/tmtests/tm10/tmtest.ads
new file mode 100644
index 0000000000..224630e1d5
--- /dev/null
+++ b/testsuites/ada/tmtests/tm10/tmtest.ads
@@ -0,0 +1,118 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 10 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- Buffer Record similar to that used by RTEMS 3.2.1. Using this
+-- avoids changes to the test.
+--
+
+ type BUFFER is
+ record
+ FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
+ FIELD2 : RTEMS.UNSIGNED32;
+ FIELD3 : RTEMS.UNSIGNED32;
+ FIELD4 : RTEMS.UNSIGNED32;
+ end record;
+
+--
+-- The following is the ID of the message queue used for timing operations.
+--
+
+ QUEUE_ID : RTEMS.ID;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_INIT
+--
+-- DESCRIPTION:
+--
+-- This subprogram performs test initialization. After initialization
+-- has been completed, the NO_WAIT case for MESSAGE_QUEUE_RECEIVE
+-- is timed and reported.
+--
+
+ procedure TEST_INIT;
+
+--
+-- HIGH_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is the highest priority task in the system.
+-- It starts the timer and performs a blocking MESSAGE_QUEUE_RECEIVE.
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASK);
+
+--
+-- MIDDLE_TASKS
+--
+-- DESCRIPTION:
+--
+-- These RTEMS tasks perform a blocking MESSAGE_QUEUE_RECEIVE.
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, MIDDLE_TASKS);
+
+--
+-- LOW_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task stops the timer and reports the execution time
+-- of a blocking MESSAGE_QUEUE_RECEIVE.
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, LOW_TASK);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm11/Makefile.am b/testsuites/ada/tmtests/tm11/Makefile.am
new file mode 100644
index 0000000000..8779d31500
--- /dev/null
+++ b/testsuites/ada/tmtests/tm11/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm11
+ada_tm11_SOURCES = tm11.adb config.h tmtest.adb tmtest.ads
+ada_tm11_SOURCES += ../../support/init.c
+
+ada_tm11$(EXEEXT): tm11.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm11/config.h b/testsuites/ada/tmtests/tm11/config.h
new file mode 100644
index 0000000000..a5064b6e92
--- /dev/null
+++ b/testsuites/ada/tmtests/tm11/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm11/tm11.adb b/testsuites/ada/tmtests/tm11/tm11.adb
new file mode 100644
index 0000000000..bcc91aa905
--- /dev/null
+++ b/testsuites/ada/tmtests/tm11/tm11.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM11 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM11 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM11;
+
diff --git a/testsuites/ada/tmtests/tm11/tmtest.adb b/testsuites/ada/tmtests/tm11/tmtest.adb
new file mode 100644
index 0000000000..610c248d57
--- /dev/null
+++ b/testsuites/ada/tmtests/tm11/tmtest.adb
@@ -0,0 +1,218 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 11 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+with RTEMS.MESSAGE_QUEUE;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ TASK_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 11 ***" );
+
+ RTEMS.TASKS.CREATE(
+ 1,
+ 251,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
+
+ RTEMS.TASKS.START(
+ TASK_ID,
+ TMTEST.TEST_INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_INIT
+--
+
+ procedure TEST_INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT;
+ PRIORITY : RTEMS.TASKS.PRIORITY;
+ TASK_ID : RTEMS.ID;
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+-- As each task is started, it preempts this task and performs a blocking
+-- MESSAGE_QUEUE_RECEIVE. Upon completion of this loop all created tasks
+-- are blocked.
+
+ RTEMS.MESSAGE_QUEUE.CREATE(
+ RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ),
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 16,
+ RTEMS.DEFAULT_OPTIONS,
+ TMTEST.QUEUE_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" );
+
+ PRIORITY := 250;
+
+ for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ PRIORITY,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ PRIORITY := PRIORITY - 1;
+
+ if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then
+ TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
+ else
+ TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
+ end if;
+
+ RTEMS.TASKS.START( TASK_ID, TASK_ENTRY, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ end loop;
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.MESSAGE_QUEUE.SEND(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ 16,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
+
+ end TEST_INIT;
+
+--
+-- HIGH_TASK
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ RTEMS.MESSAGE_QUEUE.RECEIVE(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ MESSAGE_SIZE,
+ STATUS
+ );
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_SEND (preemptive)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_SEND
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 11 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end HIGH_TASK;
+
+--
+-- MIDDLE_TASKS
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ RTEMS.MESSAGE_QUEUE.RECEIVE(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ MESSAGE_SIZE,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
+
+ RTEMS.MESSAGE_QUEUE.SEND(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ 16,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
+
+ end MIDDLE_TASKS;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm11/tmtest.ads b/testsuites/ada/tmtests/tm11/tmtest.ads
new file mode 100644
index 0000000000..6718933b04
--- /dev/null
+++ b/testsuites/ada/tmtests/tm11/tmtest.ads
@@ -0,0 +1,115 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 11 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- Buffer Record similar to that used by RTEMS 3.2.1. Using this
+-- avoids changes to the test.
+--
+
+ type BUFFER is
+ record
+ FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
+ FIELD2 : RTEMS.UNSIGNED32;
+ FIELD3 : RTEMS.UNSIGNED32;
+ FIELD4 : RTEMS.UNSIGNED32;
+ end record;
+
+--
+-- The following is the ID of the message queue used for timing operations.
+--
+
+ QUEUE_ID : RTEMS.ID;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_INIT
+--
+-- DESCRIPTION:
+--
+-- This subprogram performs test initialization. As each application
+-- task is created and started, it will preempt this task and
+-- perform a blocking MESSAGE_QUEUE_RECEIVE. Once all of the
+-- initialization is completed, the timer is started and the first
+-- preemptive MESSAGE_QUEUE_SEND is executed.
+--
+
+ procedure TEST_INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TEST_INIT);
+
+--
+-- HIGH_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is the highest priority task in the system.
+-- It performs a blocking blocking MESSAGE_QUEUE_RECEIVE. It is
+-- the last test task created and started. Thus it is the last
+-- task to be enqueued waiting for a message and the last task
+-- to receive the message. Once it receives the message, it
+-- stops the timer and reports the execution time for a
+-- preemptive MESSAGE_QUEUE_SEND.
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASK);
+
+--
+-- MIDDLE_TASKS
+--
+-- DESCRIPTION:
+--
+-- As each of these RTEMS tasks is created and started, it preempts
+-- the initialization task and perform a blocking MESSAGE_QUEUE_RECEIVE.
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, MIDDLE_TASKS);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm12/Makefile.am b/testsuites/ada/tmtests/tm12/Makefile.am
new file mode 100644
index 0000000000..477ee54495
--- /dev/null
+++ b/testsuites/ada/tmtests/tm12/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm12
+ada_tm12_SOURCES = tm12.adb config.h tmtest.adb tmtest.ads
+ada_tm12_SOURCES += ../../support/init.c
+
+ada_tm12$(EXEEXT): tm12.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm12/config.h b/testsuites/ada/tmtests/tm12/config.h
new file mode 100644
index 0000000000..a5064b6e92
--- /dev/null
+++ b/testsuites/ada/tmtests/tm12/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm12/tm12.adb b/testsuites/ada/tmtests/tm12/tm12.adb
new file mode 100644
index 0000000000..bea5e83b79
--- /dev/null
+++ b/testsuites/ada/tmtests/tm12/tm12.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM12 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM12 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM12;
+
diff --git a/testsuites/ada/tmtests/tm12/tmtest.adb b/testsuites/ada/tmtests/tm12/tmtest.adb
new file mode 100644
index 0000000000..a97330f7bf
--- /dev/null
+++ b/testsuites/ada/tmtests/tm12/tmtest.adb
@@ -0,0 +1,204 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 12 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+with RTEMS.MESSAGE_QUEUE;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ TASK_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 12 ***" );
+
+ RTEMS.TASKS.CREATE(
+ 1,
+ 251,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
+
+ RTEMS.TASKS.START(
+ TASK_ID,
+ TMTEST.TEST_INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_INIT
+--
+
+ procedure TEST_INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT;
+ PRIORITY : RTEMS.TASKS.PRIORITY;
+ TASK_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ RTEMS.MESSAGE_QUEUE.CREATE(
+ RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ),
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 16,
+ RTEMS.DEFAULT_OPTIONS,
+ TMTEST.QUEUE_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" );
+
+ PRIORITY := 250;
+
+ for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ PRIORITY,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ PRIORITY := PRIORITY - 1;
+
+ if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then
+ TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
+ else
+ TASK_ENTRY := TMTEST.LOW_TASKS'ACCESS;
+ end if;
+
+ RTEMS.TASKS.START( TASK_ID, TASK_ENTRY, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ end loop;
+
+ end TEST_INIT;
+
+--
+-- HIGH_TASK
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ OVERHEAD : RTEMS.UNSIGNED32;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ OVERHEAD := TIMER_DRIVER.READ_TIMER;
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.MESSAGE_QUEUE.SEND(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ 16,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); --XXX
+
+ end loop;
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_SEND (readying)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_SEND
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 12 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end HIGH_TASK;
+
+--
+-- LOW_TASK
+--
+
+ procedure LOW_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ RTEMS.MESSAGE_QUEUE.RECEIVE(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ MESSAGE_SIZE,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); --XXX
+
+ end LOW_TASKS;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm12/tmtest.ads b/testsuites/ada/tmtests/tm12/tmtest.ads
new file mode 100644
index 0000000000..15ff276c7c
--- /dev/null
+++ b/testsuites/ada/tmtests/tm12/tmtest.ads
@@ -0,0 +1,106 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 12 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- Buffer Record similar to that used by RTEMS 3.2.1. Using this
+-- avoids changes to the test.
+--
+
+ type BUFFER is
+ record
+ FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
+ FIELD2 : RTEMS.UNSIGNED32;
+ FIELD3 : RTEMS.UNSIGNED32;
+ FIELD4 : RTEMS.UNSIGNED32;
+ end record;
+
+--
+-- The following is the ID of the message queue used for timing operations.
+--
+
+ QUEUE_ID : RTEMS.ID;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_INIT
+--
+-- DESCRIPTION:
+--
+-- This subprogram performs test initialization.
+--
+
+ procedure TEST_INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TEST_INIT);
+
+--
+-- HIGH_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is the lowest priority task in the system. It
+-- only executes after all of the LOW_TASKS have blocked. It then
+-- times a readying MESSAGE_QUEUE_SEND.
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASK);
+
+--
+-- LOW_TASKS
+--
+-- DESCRIPTION:
+--
+-- These RTEMS tasks perform a blocking MESSAGE_QUEUE_RECEIVE.
+--
+
+ procedure LOW_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, LOW_TASKS);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm13/Makefile.am b/testsuites/ada/tmtests/tm13/Makefile.am
new file mode 100644
index 0000000000..9fc59619a0
--- /dev/null
+++ b/testsuites/ada/tmtests/tm13/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm13
+ada_tm13_SOURCES = tm13.adb config.h tmtest.adb tmtest.ads
+ada_tm13_SOURCES += ../../support/init.c
+
+ada_tm13$(EXEEXT): tm13.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm13/config.h b/testsuites/ada/tmtests/tm13/config.h
new file mode 100644
index 0000000000..a5064b6e92
--- /dev/null
+++ b/testsuites/ada/tmtests/tm13/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm13/tm13.adb b/testsuites/ada/tmtests/tm13/tm13.adb
new file mode 100644
index 0000000000..ba2ab58065
--- /dev/null
+++ b/testsuites/ada/tmtests/tm13/tm13.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM13 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM13 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM13;
+
diff --git a/testsuites/ada/tmtests/tm13/tmtest.adb b/testsuites/ada/tmtests/tm13/tmtest.adb
new file mode 100644
index 0000000000..aa9a760f82
--- /dev/null
+++ b/testsuites/ada/tmtests/tm13/tmtest.adb
@@ -0,0 +1,216 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 13 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+with RTEMS.MESSAGE_QUEUE;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ TASK_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 13 ***" );
+
+ RTEMS.TASKS.CREATE(
+ 1,
+ 251,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
+
+ RTEMS.TASKS.START(
+ TASK_ID,
+ TMTEST.TEST_INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_INIT
+--
+
+ procedure TEST_INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT;
+ PRIORITY : RTEMS.TASKS.PRIORITY;
+ TASK_ID : RTEMS.ID;
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+-- As each task is started, it preempts this task and performs a blocking
+-- MESSAGE_QUEUE_RECEIVE. Upon completion of this loop all created tasks
+-- are blocked.
+
+ RTEMS.MESSAGE_QUEUE.CREATE(
+ RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ),
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 16,
+ RTEMS.DEFAULT_OPTIONS,
+ TMTEST.QUEUE_ID,
+ STATUS
+ );
+
+ PRIORITY := 250;
+
+ for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ PRIORITY,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ PRIORITY := PRIORITY - 1;
+
+ if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then
+ TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
+ else
+ TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
+ end if;
+
+ RTEMS.TASKS.START( TASK_ID, TASK_ENTRY, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ end loop;
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.MESSAGE_QUEUE.URGENT(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ 16,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" );
+
+ end TEST_INIT;
+
+--
+-- HIGH_TASK
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ RTEMS.MESSAGE_QUEUE.RECEIVE(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ MESSAGE_SIZE,
+ STATUS
+ );
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_URGENT (preemptive)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_URGENT
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 13 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end HIGH_TASK;
+
+--
+-- MIDDLE_TASKS
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ RTEMS.MESSAGE_QUEUE.RECEIVE(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ MESSAGE_SIZE,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
+
+ RTEMS.MESSAGE_QUEUE.URGENT(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ 16,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" );
+
+ end MIDDLE_TASKS;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm13/tmtest.ads b/testsuites/ada/tmtests/tm13/tmtest.ads
new file mode 100644
index 0000000000..270bcda7e2
--- /dev/null
+++ b/testsuites/ada/tmtests/tm13/tmtest.ads
@@ -0,0 +1,115 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 13 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- Buffer Record similar to that used by RTEMS 3.2.1. Using this
+-- avoids changes to the test.
+--
+
+ type BUFFER is
+ record
+ FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
+ FIELD2 : RTEMS.UNSIGNED32;
+ FIELD3 : RTEMS.UNSIGNED32;
+ FIELD4 : RTEMS.UNSIGNED32;
+ end record;
+
+--
+-- The following is the ID of the message queue used for timing operations.
+--
+
+ QUEUE_ID : RTEMS.ID;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_INIT
+--
+-- DESCRIPTION:
+--
+-- This subprogram performs test initialization. As each application
+-- task is created and started, it will preempt this task and
+-- perform a blocking MESSAGE_QUEUE_RECEIVE. Once all of the
+-- initialization is completed, the timer is started and the first
+-- preemptive MESSAGE_QUEUE_URGENT is executed.
+--
+
+ procedure TEST_INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TEST_INIT);
+
+--
+-- HIGH_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is the highest priority task in the system.
+-- It performs a blocking blocking MESSAGE_QUEUE_RECEIVE. It is
+-- the last test task created and started. Thus it is the last
+-- task to be enqueued waiting for a message and the last task
+-- to receive the message. Once it receives the message, it
+-- stops the timer and reports the execution time for a
+-- preemptive MESSAGE_QUEUE_URGENT.
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASK);
+
+--
+-- MIDDLE_TASKS
+--
+-- DESCRIPTION:
+--
+-- As each of these RTEMS tasks is created and started, it preempts
+-- the initialization task and perform a blocking MESSAGE_QUEUE_RECEIVE.
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, MIDDLE_TASKS);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm14/Makefile.am b/testsuites/ada/tmtests/tm14/Makefile.am
new file mode 100644
index 0000000000..bc5e7d0377
--- /dev/null
+++ b/testsuites/ada/tmtests/tm14/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm14
+ada_tm14_SOURCES = tm14.adb config.h tmtest.adb tmtest.ads
+ada_tm14_SOURCES += ../../support/init.c
+
+ada_tm14$(EXEEXT): tm14.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm14/config.h b/testsuites/ada/tmtests/tm14/config.h
new file mode 100644
index 0000000000..a5064b6e92
--- /dev/null
+++ b/testsuites/ada/tmtests/tm14/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm14/tm14.adb b/testsuites/ada/tmtests/tm14/tm14.adb
new file mode 100644
index 0000000000..3835813b60
--- /dev/null
+++ b/testsuites/ada/tmtests/tm14/tm14.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM14 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM14 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM14;
+
diff --git a/testsuites/ada/tmtests/tm14/tmtest.adb b/testsuites/ada/tmtests/tm14/tmtest.adb
new file mode 100644
index 0000000000..adde5deb77
--- /dev/null
+++ b/testsuites/ada/tmtests/tm14/tmtest.adb
@@ -0,0 +1,214 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 14 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+with RTEMS.MESSAGE_QUEUE;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ TASK_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 14 ***" );
+
+ RTEMS.TASKS.CREATE(
+ 1,
+ 251,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
+
+ RTEMS.TASKS.START(
+ TASK_ID,
+ TMTEST.TEST_INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_INIT
+--
+
+ procedure TEST_INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT;
+ PRIORITY : RTEMS.TASKS.PRIORITY;
+ TASK_ID : RTEMS.ID;
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ RTEMS.MESSAGE_QUEUE.CREATE(
+ RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ),
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 16,
+ RTEMS.DEFAULT_OPTIONS,
+ TMTEST.QUEUE_ID,
+ STATUS
+ );
+
+ PRIORITY := 250;
+
+ for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ PRIORITY,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ PRIORITY := PRIORITY - 1;
+
+ if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then
+ TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
+ else
+ TASK_ENTRY := TMTEST.LOW_TASKS'ACCESS;
+ end if;
+
+ RTEMS.TASKS.START( TASK_ID, TASK_ENTRY, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ end loop;
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.MESSAGE_QUEUE.URGENT(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ 16,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSSAGE_QUEUE_URGENT" );
+
+ end TEST_INIT;
+
+--
+-- HIGH_TASK
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ OVERHEAD : RTEMS.UNSIGNED32;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ OVERHEAD := TIMER_DRIVER.READ_TIMER;
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.MESSAGE_QUEUE.URGENT(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ 16,
+ STATUS
+ );
+
+ end loop;
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_URGENT (readying)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_URGENT
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 14 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end HIGH_TASK;
+
+--
+-- LOW_TASKS
+--
+
+ procedure LOW_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ RTEMS.MESSAGE_QUEUE.RECEIVE(
+ TMTEST.QUEUE_ID,
+ BUFFER_POINTER,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ MESSAGE_SIZE,
+ STATUS
+ );
+
+ end LOW_TASKS;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm14/tmtest.ads b/testsuites/ada/tmtests/tm14/tmtest.ads
new file mode 100644
index 0000000000..c90b1cadc3
--- /dev/null
+++ b/testsuites/ada/tmtests/tm14/tmtest.ads
@@ -0,0 +1,106 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 14 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- Buffer Record similar to that used by RTEMS 3.2.1. Using this
+-- avoids changes to the test.
+--
+
+ type BUFFER is
+ record
+ FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
+ FIELD2 : RTEMS.UNSIGNED32;
+ FIELD3 : RTEMS.UNSIGNED32;
+ FIELD4 : RTEMS.UNSIGNED32;
+ end record;
+
+--
+-- The following is the ID of the message queue used for timing operations.
+--
+
+ QUEUE_ID : RTEMS.ID;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_INIT
+--
+-- DESCRIPTION:
+--
+-- This subprogram performs test initialization.
+--
+
+ procedure TEST_INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TEST_INIT);
+
+--
+-- HIGH_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is the lowest priority task in the system. It
+-- only executes after all of the LOW_TASKS have blocked. It then
+-- times a readying MESSAGE_QUEUE_SEND.
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASK);
+
+--
+-- LOW_TASKS
+--
+-- DESCRIPTION:
+--
+-- These RTEMS tasks perform a blocking MESSAGE_QUEUE_RECEIVE.
+--
+
+ procedure LOW_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, LOW_TASKS);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm15/Makefile.am b/testsuites/ada/tmtests/tm15/Makefile.am
new file mode 100644
index 0000000000..e792c9be21
--- /dev/null
+++ b/testsuites/ada/tmtests/tm15/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm15
+ada_tm15_SOURCES = tm15.adb config.h tmtest.adb tmtest.ads
+ada_tm15_SOURCES += ../../support/init.c
+
+ada_tm15$(EXEEXT): tm15.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm15/config.h b/testsuites/ada/tmtests/tm15/config.h
new file mode 100644
index 0000000000..a5064b6e92
--- /dev/null
+++ b/testsuites/ada/tmtests/tm15/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm15/tm15.adb b/testsuites/ada/tmtests/tm15/tm15.adb
new file mode 100644
index 0000000000..31e40968da
--- /dev/null
+++ b/testsuites/ada/tmtests/tm15/tm15.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM15 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM15 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM15;
+
diff --git a/testsuites/ada/tmtests/tm15/tmtest.adb b/testsuites/ada/tmtests/tm15/tmtest.adb
new file mode 100644
index 0000000000..2a7efedcf9
--- /dev/null
+++ b/testsuites/ada/tmtests/tm15/tmtest.adb
@@ -0,0 +1,267 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 15 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIMER_DRIVER;
+with RTEMS.EVENT;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 15 ***" );
+
+ TMTEST.TEST_INIT;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_INIT
+--
+
+ procedure TEST_INIT
+ is
+ ID : RTEMS.ID;
+ OVERHEAD : RTEMS.UNSIGNED32;
+ EVENT_OUT : RTEMS.EVENT_SET;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TMTEST.TIME_SET := FALSE;
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ),
+ 10,
+ 1024,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOW" );
+
+ RTEMS.TASKS.START( ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOW" );
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ),
+ 5,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( INDEX ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( INDEX ),
+ TMTEST.HIGH_TASKS'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ end loop;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ OVERHEAD := TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.EVENT.RECEIVE(
+ RTEMS.PENDING_EVENTS,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ EVENT_OUT,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "EVENT_RECEIVE (current)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.EVENT.RECEIVE(
+ RTEMS.ALL_EVENTS,
+ RTEMS.NO_WAIT,
+ RTEMS.NO_TIMEOUT,
+ EVENT_OUT,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "EVENT_RECEIVE (NO_WAIT)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE
+ );
+
+ end TEST_INIT;
+
+--
+-- LOW_TASK
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ EVENT_OUT : RTEMS.EVENT_SET;
+ OVERHEAD : RTEMS.UNSIGNED32;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "EVENT_RECEIVE (blocking)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ OVERHEAD := TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.EVENT.SEND( RTEMS.SELF, RTEMS.EVENT_16, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "EVENT_SEND (returns to caller)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.EVENT_SEND
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.EVENT.RECEIVE(
+ RTEMS.EVENT_16,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ EVENT_OUT,
+ STATUS
+ );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "EVENT_RECEIVE (available)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.EVENT.SEND(
+ TMTEST.TASK_ID( INDEX ),
+ RTEMS.EVENT_16,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "EVENT_SEND (readying)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.EVENT_SEND
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 15 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end LOW_TASK;
+
+--
+-- HIGH_TASKS
+--
+
+ procedure HIGH_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ EVENT_OUT : RTEMS.EVENT_SET;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ if TMTEST.TIME_SET = FALSE then
+ TMTEST.TIME_SET := TRUE;
+ TIMER_DRIVER.INITIALIZE;
+ end if;
+
+ RTEMS.EVENT.RECEIVE(
+ 16#7FFFFFFF#,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ EVENT_OUT,
+ STATUS
+ );
+
+ end HIGH_TASKS;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm15/tmtest.ads b/testsuites/ada/tmtests/tm15/tmtest.ads
new file mode 100644
index 0000000000..b8ab38d6cd
--- /dev/null
+++ b/testsuites/ada/tmtests/tm15/tmtest.ads
@@ -0,0 +1,109 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 15 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with TIME_TEST_SUPPORT;
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- This array contains the IDs of all RTEMS tasks created by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32 range 1 ..
+ TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
+
+--
+-- This variable is set to TRUE if the timer has been initialized
+-- and is currently timing an operation.
+--
+
+ TIME_SET : Standard.BOOLEAN;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_INIT
+--
+-- DESCRIPTION:
+--
+-- This subprogram performs test initialization. Once initialization
+-- has been completed, the following operations are timed and reported:
+--
+-- + event_receive of currently PENDING_EVENTS
+-- + event_receive NO_WAIT case
+--
+
+ procedure TEST_INIT;
+
+--
+-- LOW_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task stops the timer and reports the execution time
+-- of a blocking EVENT_RECEIVE. After this the following
+-- operations are timed and the execution time is reported:
+--
+-- + EVENT_SEND which does not ready a task
+-- + EVENT_RECEIVE with the event condition available
+-- + EVENT_SEND which readies a task
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, LOW_TASK);
+
+--
+-- HIGH_TASKS
+--
+-- DESCRIPTION:
+--
+-- These RTEMS tasks executive a blocking EVENT_RECEIVE after
+-- initialization is complete. The first of these tasks to
+-- execute starts the timer.
+--
+
+ procedure HIGH_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASKS);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm16/Makefile.am b/testsuites/ada/tmtests/tm16/Makefile.am
new file mode 100644
index 0000000000..95257974f5
--- /dev/null
+++ b/testsuites/ada/tmtests/tm16/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm16
+ada_tm16_SOURCES = tm16.adb config.h tmtest.adb tmtest.ads
+ada_tm16_SOURCES += ../../support/init.c
+
+ada_tm16$(EXEEXT): tm16.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm16/config.h b/testsuites/ada/tmtests/tm16/config.h
new file mode 100644
index 0000000000..a5064b6e92
--- /dev/null
+++ b/testsuites/ada/tmtests/tm16/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm16/tm16.adb b/testsuites/ada/tmtests/tm16/tm16.adb
new file mode 100644
index 0000000000..a6d67d93ce
--- /dev/null
+++ b/testsuites/ada/tmtests/tm16/tm16.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM16 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM16 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM16;
+
diff --git a/testsuites/ada/tmtests/tm16/tmtest.adb b/testsuites/ada/tmtests/tm16/tmtest.adb
new file mode 100644
index 0000000000..4be7a6bbd6
--- /dev/null
+++ b/testsuites/ada/tmtests/tm16/tmtest.adb
@@ -0,0 +1,196 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 16 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIMER_DRIVER;
+with RTEMS.EVENT;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 16 ***" );
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'E', 'S', 'T' ),
+ 251,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TEST INIT" );
+
+ RTEMS.TASKS.START(
+ ID,
+ TMTEST.TEST_INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TEST INIT" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_INIT
+--
+
+ procedure TEST_INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ PRIORITY : RTEMS.TASKS.PRIORITY;
+ TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ PRIORITY := 250;
+
+ for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'M', 'I', 'D', ' ' ),
+ PRIORITY,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( INDEX ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then
+ TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
+ else
+ TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
+ end if;
+
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( INDEX ),
+ TASK_ENTRY,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ PRIORITY := PRIORITY - 1;
+
+ end loop;
+
+ TMTEST.TASK_COUNT := 0;
+
+ TIMER_DRIVER.INITIALIZE; -- starts the timer
+
+ RTEMS.EVENT.SEND( -- preempts task
+ TMTEST.TASK_ID( TMTEST.TASK_COUNT ),
+ RTEMS.EVENT_16,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" );
+
+ end TEST_INIT;
+
+--
+-- MIDDLE_TASKS
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ EVENT_OUT : RTEMS.EVENT_SET;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ RTEMS.EVENT.RECEIVE( -- task blocks
+ RTEMS.EVENT_16,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ EVENT_OUT,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" );
+
+ TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1;
+
+ RTEMS.EVENT.SEND( -- preempts task
+ TMTEST.TASK_ID( TMTEST.TASK_COUNT ),
+ RTEMS.EVENT_16,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" );
+
+ end MIDDLE_TASKS;
+
+--
+-- HIGH_TASK
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ EVENT_OUT : RTEMS.EVENT_SET;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ RTEMS.EVENT.RECEIVE( -- task blocks
+ RTEMS.EVENT_16,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ EVENT_OUT,
+ STATUS
+ );
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "EVENT_SEND (preemptive)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.EVENT_SEND
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 16 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end HIGH_TASK;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm16/tmtest.ads b/testsuites/ada/tmtests/tm16/tmtest.ads
new file mode 100644
index 0000000000..ab42eb259c
--- /dev/null
+++ b/testsuites/ada/tmtests/tm16/tmtest.ads
@@ -0,0 +1,112 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 16 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TIME_TEST_SUPPORT;
+
+package TMTEST is
+
+--
+-- This array contains the IDs of all RTEMS tasks created by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32
+ range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
+
+--
+-- This variable is used to index through the TASK_ID array
+-- so that events can be send to the next task.
+--
+
+ TASK_COUNT : RTEMS.UNSIGNED32;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_INIT
+--
+-- DESCRIPTION:
+--
+-- This subprogram performs test initialization. Once initialization
+-- has been completed, this task sets the TASK_COUNT to 0 and
+-- starts the timer before performing a preemptive EVENT_SEND.
+--
+
+ procedure TEST_INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TEST_INIT);
+
+--
+-- HIGH_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is highest priority task in the system.
+-- Its first action is to perform a blocking EVENT_RECEIVE.
+-- It is the last task to have its event set sent to it. Thus it
+-- is the last task to be awakened by a preemptive EVENT_SEND.
+-- After it preempts the last MIDDLE_TASKS, it stops the timer
+-- and reports the execution time of preemptive EVENT_SEND.
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASK);
+
+--
+-- MIDDLE_TASKS
+--
+-- DESCRIPTION:
+--
+-- These RTEMS tasks perform a blocking EVENT_RECEIVE. When
+-- readied, each task will increment the TASK_COUNT and
+-- perform a preemptive EVENT_SEND. TASK_COUNT is used to
+-- index the TASK_ID array in such a way that incrementing
+-- TASK_COUNT makes it index the ID of the next task to
+-- send events to.
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, MIDDLE_TASKS);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm17/Makefile.am b/testsuites/ada/tmtests/tm17/Makefile.am
new file mode 100644
index 0000000000..d8715ded65
--- /dev/null
+++ b/testsuites/ada/tmtests/tm17/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm17
+ada_tm17_SOURCES = tm17.adb config.h tmtest.adb tmtest.ads
+ada_tm17_SOURCES += ../../support/init.c
+
+ada_tm17$(EXEEXT): tm17.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm17/config.h b/testsuites/ada/tmtests/tm17/config.h
new file mode 100644
index 0000000000..a5064b6e92
--- /dev/null
+++ b/testsuites/ada/tmtests/tm17/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm17/tm17.adb b/testsuites/ada/tmtests/tm17/tm17.adb
new file mode 100644
index 0000000000..efc2766479
--- /dev/null
+++ b/testsuites/ada/tmtests/tm17/tm17.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM17 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM17 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM17;
+
diff --git a/testsuites/ada/tmtests/tm17/tmtest.adb b/testsuites/ada/tmtests/tm17/tmtest.adb
new file mode 100644
index 0000000000..5e645581d4
--- /dev/null
+++ b/testsuites/ada/tmtests/tm17/tmtest.adb
@@ -0,0 +1,155 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 17 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIMER_DRIVER;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 17 ***" );
+
+ TMTEST.TASK_PRIORITY := 254;
+
+ for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ TMTEST.TASK_PRIORITY,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( INDEX ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then
+ TASK_ENTRY := TMTEST.LAST_TASK'ACCESS;
+ elsif INDEX = 0 then
+ TASK_ENTRY := TMTEST.FIRST_TASK'ACCESS;
+ else
+ TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
+ end if;
+
+ RTEMS.TASKS.START( TMTEST.TASK_ID( INDEX ), TASK_ENTRY, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ end loop;
+
+ TMTEST.TASK_COUNT := 1;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- FIRST_TASK
+--
+
+ procedure FIRST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TIMER_DRIVER.INITIALIZE;
+
+ TMTEST.TASK_PRIORITY := TMTEST.TASK_PRIORITY - 1;
+ TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1;
+
+ RTEMS.TASKS.SET_PRIORITY(
+ TMTEST.TASK_ID( TMTEST.TASK_COUNT ),
+ TMTEST.TASK_PRIORITY,
+ PREVIOUS_PRIORITY,
+ STATUS
+ );
+
+ end FIRST_TASK;
+
+--
+-- MIDDLE_TASKS
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TMTEST.TASK_PRIORITY := TMTEST.TASK_PRIORITY - 1;
+ TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1;
+
+ RTEMS.TASKS.SET_PRIORITY(
+ TMTEST.TASK_ID( TMTEST.TASK_COUNT ),
+ TMTEST.TASK_PRIORITY,
+ PREVIOUS_PRIORITY,
+ STATUS
+ );
+
+ end MIDDLE_TASKS;
+
+--
+-- LAST_TASK
+--
+
+ procedure LAST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ begin
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_SET_PRIORITY (preemptive)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TASK_SET_PRIORITY
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 17 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end LAST_TASK;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm17/tmtest.ads b/testsuites/ada/tmtests/tm17/tmtest.ads
new file mode 100644
index 0000000000..b2c9369e26
--- /dev/null
+++ b/testsuites/ada/tmtests/tm17/tmtest.ads
@@ -0,0 +1,110 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 17 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TIME_TEST_SUPPORT;
+
+package TMTEST is
+
+--
+-- These arrays contain the IDs and NAMEs of all RTEMS tasks created
+-- by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32
+ range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
+ TASK_NAME : array ( RTEMS.UNSIGNED32
+ range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.NAME;
+
+--
+-- These variables are used to index the TASK_ID array and change
+-- the priority of each successive task such that the TASK_SET_PRIORITY
+-- results in a preemption.
+--
+
+ TASK_COUNT : RTEMS.UNSIGNED32;
+ TASK_PRIORITY : RTEMS.TASKS.PRIORITY;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- FIRST_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is the first task to execute in the system. It
+-- starts the timer and updates the TASK_COUNT and TASK_PRIORITY
+-- variables so that a preemptive TASK_SET_PRIORITY can be performed.
+--
+
+ procedure FIRST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, FIRST_TASK);
+
+--
+-- MIDDLE_TASK
+--
+-- DESCRIPTION:
+--
+-- These RTEMS tasks update the TASK_COUNT and TASK_PRIORITY variables
+-- so that a preemptive TASK_SET_PRIORITY can be performed.
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, MIDDLE_TASKS);
+
+--
+-- LAST_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is the last task to execute in the system. It
+-- stops the timer and reports the execution time of a preemptive
+-- TASK_SET_PRIORITY.
+--
+
+ procedure LAST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, LAST_TASK);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm18/Makefile.am b/testsuites/ada/tmtests/tm18/Makefile.am
new file mode 100644
index 0000000000..62820c5a4d
--- /dev/null
+++ b/testsuites/ada/tmtests/tm18/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm18
+ada_tm18_SOURCES = tm18.adb config.h tmtest.adb tmtest.ads
+ada_tm18_SOURCES += ../../support/init.c
+
+ada_tm18$(EXEEXT): tm18.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm18/config.h b/testsuites/ada/tmtests/tm18/config.h
new file mode 100644
index 0000000000..a5064b6e92
--- /dev/null
+++ b/testsuites/ada/tmtests/tm18/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm18/tm18.adb b/testsuites/ada/tmtests/tm18/tm18.adb
new file mode 100644
index 0000000000..856b6f1127
--- /dev/null
+++ b/testsuites/ada/tmtests/tm18/tm18.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM18 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM18 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM18;
+
diff --git a/testsuites/ada/tmtests/tm18/tmtest.adb b/testsuites/ada/tmtests/tm18/tmtest.adb
new file mode 100644
index 0000000000..e86b24cd4a
--- /dev/null
+++ b/testsuites/ada/tmtests/tm18/tmtest.adb
@@ -0,0 +1,151 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 18 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 18 ***" );
+
+ TMTEST.TEST_INIT;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_INIT
+--
+
+ procedure TEST_INIT
+ is
+ ID : RTEMS.ID;
+ TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ 128,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+
+ if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then
+ TASK_ENTRY := TMTEST.LAST_TASK'ACCESS;
+ elsif INDEX = 0 then
+ TASK_ENTRY := TMTEST.FIRST_TASK'ACCESS;
+ else
+ TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
+ end if;
+
+ RTEMS.TASKS.START( ID, TASK_ENTRY, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ end loop;
+
+ end TEST_INIT;
+
+--
+-- FIRST_TASK
+--
+
+ procedure FIRST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TIMER_DRIVER.INITIALIZE;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" );
+
+ end FIRST_TASK;
+
+--
+-- MIDDLE_TASKS
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" );
+
+ end MIDDLE_TASKS;
+
+--
+-- LAST_TASK
+--
+
+ procedure LAST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ begin
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_DELETE (self)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TASK_DELETE
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 18 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end LAST_TASK;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm18/tmtest.ads b/testsuites/ada/tmtests/tm18/tmtest.ads
new file mode 100644
index 0000000000..0b919d44a4
--- /dev/null
+++ b/testsuites/ada/tmtests/tm18/tmtest.ads
@@ -0,0 +1,97 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 18 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_INIT
+--
+-- DESCRIPTION:
+--
+-- This subprogram performs test initialization.
+--
+
+ procedure TEST_INIT;
+
+--
+-- FIRST_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is the first task to execute. It starts the
+-- timer and performs a TASK_DELETE on itself.
+--
+
+ procedure FIRST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, FIRST_TASK);
+
+--
+-- MIDDLE_TASKS
+--
+-- DESCRIPTION:
+--
+-- These RTEMS tasks perform a TASK_DELETE on themselves.
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+
+ pragma Convention (C, MIDDLE_TASKS);
+--
+-- LAST_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is the last task to execute. It stops the
+-- timer and reports the execution time of a TASK_DELETE SELF.
+--
+
+ procedure LAST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, LAST_TASK);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm19/Makefile.am b/testsuites/ada/tmtests/tm19/Makefile.am
new file mode 100644
index 0000000000..c21692b9f5
--- /dev/null
+++ b/testsuites/ada/tmtests/tm19/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm19
+ada_tm19_SOURCES = tm19.adb config.h tmtest.adb tmtest.ads
+ada_tm19_SOURCES += ../../support/init.c
+
+ada_tm19$(EXEEXT): tm19.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm19/config.h b/testsuites/ada/tmtests/tm19/config.h
new file mode 100644
index 0000000000..a5064b6e92
--- /dev/null
+++ b/testsuites/ada/tmtests/tm19/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm19/tm19.adb b/testsuites/ada/tmtests/tm19/tm19.adb
new file mode 100644
index 0000000000..0b232d833a
--- /dev/null
+++ b/testsuites/ada/tmtests/tm19/tm19.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM19 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM19 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM19;
+
diff --git a/testsuites/ada/tmtests/tm19/tmtest.adb b/testsuites/ada/tmtests/tm19/tmtest.adb
new file mode 100644
index 0000000000..288a6a799d
--- /dev/null
+++ b/testsuites/ada/tmtests/tm19/tmtest.adb
@@ -0,0 +1,287 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 19 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+with RTEMS.SIGNAL;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 19 ***" );
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ 128,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( 1 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK1" );
+
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( 1 ),
+ TMTEST.TASK_1'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK1" );
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ 127,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( 2 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK2" );
+
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( 2 ),
+ TMTEST.TASK_2'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK2" );
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ 126,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( 3 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK3" );
+
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( 3 ),
+ TMTEST.TASK_3'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK3" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- PROCESS_ASR_FOR_PASS_1
+--
+
+ procedure PROCESS_ASR_FOR_PASS_1 (
+ SIGNALS : in RTEMS.SIGNAL_SET
+ ) is
+ pragma Unreferenced(SIGNALS);
+ begin
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SIGNAL_SEND (self)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.SIGNAL_SEND
+ );
+
+ TEXT_IO.PUT_LINE( "SIGNAL_ENTER (preemptive) na" );
+
+ TIMER_DRIVER.INITIALIZE;
+
+ end PROCESS_ASR_FOR_PASS_1;
+
+--
+-- PROCESS_ASR_FOR_PASS_2
+--
+
+ procedure PROCESS_ASR_FOR_PASS_2 (
+ SIGNALS : in RTEMS.SIGNAL_SET
+ ) is
+ pragma Unreferenced(SIGNALS);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.PUT_LINE( "SIGNAL_ENTER (preemptive) na" );
+
+ RTEMS.TASKS.RESUME( TMTEST.TASK_ID( 3 ), STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" );
+
+ TIMER_DRIVER.INITIALIZE;
+
+ end PROCESS_ASR_FOR_PASS_2;
+
+--
+-- TASK_1
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.SIGNAL.CATCH(
+ TMTEST.PROCESS_ASR_FOR_PASS_1'ACCESS,
+ RTEMS.DEFAULT_MODES,
+ STATUS
+ );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" );
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SIGNAL_CATCH",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.SIGNAL_CATCH
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.SIGNAL.SEND( TMTEST.TASK_ID( 2 ), RTEMS.SIGNAL_1, STATUS );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" );
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SIGNAL_SEND (non-preemptive)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.SIGNAL_SEND
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.SIGNAL.SEND( RTEMS.SELF, RTEMS.SIGNAL_1, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" );
+
+ -- end time is done in ASR
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SIGNAL_RETURN (non-preemptive)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ 0
+ );
+
+ RTEMS.SIGNAL.CATCH(
+ TMTEST.PROCESS_ASR_FOR_PASS_2'ACCESS,
+ RTEMS.NO_PREEMPT,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.SIGNAL.SEND( RTEMS.SELF, RTEMS.SIGNAL_1, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" );
+
+ end TASK_1;
+
+--
+-- PROCESS_ASR_FOR_TASK_2
+--
+
+ procedure PROCESS_ASR_FOR_TASK_2 (
+ SIGNALS : in RTEMS.SIGNAL_SET
+ ) is
+ begin
+
+ NULL;
+
+ end PROCESS_ASR_FOR_TASK_2;
+
+--
+-- TASK_2
+--
+
+ procedure TASK_2 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ RTEMS.SIGNAL.CATCH(
+ TMTEST.PROCESS_ASR_FOR_TASK_2'ACCESS,
+ RTEMS.DEFAULT_MODES,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" );
+
+ RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" );
+
+ end TASK_2;
+
+--
+-- TASK_3
+--
+
+ procedure TASK_3 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" );
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SIGNAL_RETURN (preemptive)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ 0
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 19 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end TASK_3;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm19/tmtest.ads b/testsuites/ada/tmtests/tm19/tmtest.ads
new file mode 100644
index 0000000000..7776b41b35
--- /dev/null
+++ b/testsuites/ada/tmtests/tm19/tmtest.ads
@@ -0,0 +1,147 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 19 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- This array contains the IDs of all RTEMS tasks created by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- PROCESS_ASR_FOR_PASS_1
+--
+-- DESCRIPTION:
+--
+-- This subprogram is the ASR used to measure and report the
+-- execution time of a SIGNAL_SEND to SELF. Before it exits
+-- it starts the timer so that the execution time required to
+-- exit from an ASR back to the same task can be measured.
+--
+
+ procedure PROCESS_ASR_FOR_PASS_1 (
+ SIGNALS : in RTEMS.SIGNAL_SET
+ );
+ pragma Convention (C, PROCESS_ASR_FOR_PASS_1);
+
+--
+-- PROCESS_ASR_FOR_PASS_2
+--
+-- DESCRIPTION:
+--
+-- This subprogram is the ASR which sets up for a preemptive
+-- return from an ASR. Before it exits it starts the timer
+-- so that the execution time required to exit from an ASR
+-- and transfer control to the another task can be measured.
+--
+
+ procedure PROCESS_ASR_FOR_PASS_2 (
+ SIGNALS : in RTEMS.SIGNAL_SET
+ );
+ pragma Convention (C, PROCESS_ASR_FOR_PASS_2);
+
+--
+-- TASK_1
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is responsible for measuring and reporting
+-- the following execution times:
+--
+-- + SIGNAL_CATCH
+-- + non-preemptive SIGNAL_SEND
+-- + non-preemptive return from an ASR
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TASK_1);
+
+--
+-- PROCESS_ASR_FOR_TASK_2
+--
+-- DESCRIPTION:
+--
+-- This subprogram is the ASR for TASK_2. It performs no actions.
+--
+
+ procedure PROCESS_ASR_FOR_TASK_2 (
+ SIGNALS : in RTEMS.SIGNAL_SET
+ );
+ pragma Convention (C, PROCESS_ASR_FOR_TASK_2);
+
+--
+-- TASK_2
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is used as the recipient of a SIGNAL_SEND.
+-- After establishing an ASR, it suspends itself to insure
+-- that it does not execute again.
+--
+
+ procedure TASK_2 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TASK_2);
+
+--
+-- TASK_3
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is used as the recipient of a preemptive
+-- SIGNAL_SEND. This task suspends itself and is resumed by
+-- an ASR for TASK_1. Once the task executes, it stops the
+-- timer and reports the execution time for a preemptive
+-- return from an ASR.
+--
+
+ procedure TASK_3 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TASK_3);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm20/Makefile.am b/testsuites/ada/tmtests/tm20/Makefile.am
new file mode 100644
index 0000000000..d4ca51dca4
--- /dev/null
+++ b/testsuites/ada/tmtests/tm20/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm20
+ada_tm20_SOURCES = tm20.adb config.h tmtest.adb tmtest.ads
+ada_tm20_SOURCES += ../../support/init.c
+
+ada_tm20$(EXEEXT): tm20.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm20/config.h b/testsuites/ada/tmtests/tm20/config.h
new file mode 100644
index 0000000000..30b26944d9
--- /dev/null
+++ b/testsuites/ada/tmtests/tm20/config.h
@@ -0,0 +1,33 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_PARTITIONS 1
+#define CONFIGURE_MAXIMUM_REGIONS 1
+#define CONFIGURE_MAXIMUM_TASKS 3
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm20/tm20.adb b/testsuites/ada/tmtests/tm20/tm20.adb
new file mode 100644
index 0000000000..47ef899495
--- /dev/null
+++ b/testsuites/ada/tmtests/tm20/tm20.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM20 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM20 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM20;
+
diff --git a/testsuites/ada/tmtests/tm20/tmtest.adb b/testsuites/ada/tmtests/tm20/tmtest.adb
new file mode 100644
index 0000000000..4a997f3ff4
--- /dev/null
+++ b/testsuites/ada/tmtests/tm20/tmtest.adb
@@ -0,0 +1,455 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 20 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIMER_DRIVER;
+with RTEMS.PARTITION;
+with RTEMS.REGION;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 20 ***" );
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', '1' ),
+ 128,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( 1 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK1" );
+
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( 1 ),
+ TMTEST.TASK_1'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK1" );
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', '2' ),
+ 129,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( 2 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK2" );
+
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( 2 ),
+ TMTEST.TASK_2'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK2" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TASK_1
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ BUFFER_COUNT : RTEMS.UNSIGNED32;
+ PREVIOUS_MODE : RTEMS.MODE;
+ PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TMTEST.PARTITION_NAME := RTEMS.BUILD_NAME( 'P', 'A', 'R', 'T' );
+
+ TIMER_DRIVER.INITIALIZE;
+
+ RTEMS.PARTITION.CREATE(
+ TMTEST.PARTITION_NAME,
+ TMTEST.PARTITION_AREA'ADDRESS,
+ 2048,
+ 128,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.PARTITION_ID,
+ STATUS
+ );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PARTITION_CREATE",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.PARTITION_CREATE
+ );
+
+ TMTEST.REGION_NAME := RTEMS.BUILD_NAME( 'R', 'E', 'G', 'N' );
+
+ TIMER_DRIVER.INITIALIZE;
+
+ RTEMS.REGION.CREATE(
+ TMTEST.REGION_NAME,
+ TMTEST.REGION_AREA'ADDRESS,
+ 2048,
+ 16,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.REGION_ID,
+ STATUS
+ );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "REGION_CREATE",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.REGION_CREATE
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.PARTITION.GET_BUFFER(
+ TMTEST.PARTITION_ID,
+ TMTEST.BUFFER_ADDRESS_1,
+ STATUS
+ );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PARTITION_GET_BUFFER (available)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.PARTITION_GET_BUFFER
+ );
+
+ BUFFER_COUNT := 0;
+ loop
+
+ RTEMS.PARTITION.GET_BUFFER(
+ TMTEST.PARTITION_ID,
+ TMTEST.BUFFER_ADDRESSES( BUFFER_COUNT ),
+ STATUS
+ );
+
+ exit when RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.UNSATISFIED );
+
+ BUFFER_COUNT := BUFFER_COUNT + 1;
+
+ end loop;
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.PARTITION.GET_BUFFER(
+ TMTEST.PARTITION_ID,
+ TMTEST.BUFFER_ADDRESS_2,
+ STATUS
+ );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PARTITION_GET_BUFFER (not available)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.PARTITION_GET_BUFFER
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.PARTITION.RETURN_BUFFER(
+ TMTEST.PARTITION_ID,
+ TMTEST.BUFFER_ADDRESS_1,
+ STATUS
+ );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PARTITION_RETURN_BUFFER",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.PARTITION_RETURN_BUFFER
+ );
+
+ for INDEX in 0 .. BUFFER_COUNT - 1
+ loop
+
+ RTEMS.PARTITION.RETURN_BUFFER(
+ TMTEST.PARTITION_ID,
+ TMTEST.BUFFER_ADDRESSES( INDEX ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" );
+
+ end loop;
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.PARTITION.DELETE( TMTEST.PARTITION_ID, STATUS );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PARTITION_DELETE",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.PARTITION_DELETE
+ );
+
+ RTEMS.REGION.GET_SEGMENT(
+ TMTEST.REGION_ID,
+ 400,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ TMTEST.BUFFER_ADDRESS_2,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.REGION.GET_SEGMENT(
+ TMTEST.REGION_ID,
+ 400,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ TMTEST.BUFFER_ADDRESS_3,
+ STATUS
+ );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "REGION_GET_SEGMENT (available)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.REGION_GET_SEGMENT
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.REGION.GET_SEGMENT(
+ TMTEST.REGION_ID,
+ 1998,
+ RTEMS.NO_WAIT,
+ RTEMS.NO_TIMEOUT,
+ TMTEST.BUFFER_ADDRESS_4,
+ STATUS
+ );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "REGION_GET_SEGMENT (NO_WAIT)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.REGION_GET_SEGMENT
+ );
+
+ RTEMS.REGION.RETURN_SEGMENT(
+ TMTEST.REGION_ID,
+ TMTEST.BUFFER_ADDRESS_3,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.REGION.RETURN_SEGMENT(
+ TMTEST.REGION_ID,
+ TMTEST.BUFFER_ADDRESS_2,
+ STATUS
+ );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "REGION_RETURN_SEGMENT (no tasks waiting)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.REGION_RETURN_SEGMENT
+ );
+
+ RTEMS.REGION.GET_SEGMENT(
+ TMTEST.REGION_ID,
+ 400,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ TMTEST.BUFFER_ADDRESS_1,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.REGION.GET_SEGMENT(
+ TMTEST.REGION_ID,
+ 1998,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ TMTEST.BUFFER_ADDRESS_2,
+ STATUS
+ );
+
+ -- execute TASK_2
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "REGION_RETURN_SEGMENT (preempt)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.REGION_RETURN_SEGMENT
+ );
+
+ RTEMS.REGION.RETURN_SEGMENT(
+ TMTEST.REGION_ID,
+ TMTEST.BUFFER_ADDRESS_2,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
+
+ RTEMS.TASKS.MODE(
+ RTEMS.NO_PREEMPT,
+ RTEMS.PREEMPT_MASK,
+ PREVIOUS_MODE,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
+
+ RTEMS.TASKS.SET_PRIORITY( RTEMS.SELF, 254, PREVIOUS_PRIORITY, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
+
+ RTEMS.REGION.GET_SEGMENT(
+ TMTEST.REGION_ID,
+ 400,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ TMTEST.BUFFER_ADDRESS_1,
+ STATUS
+ );
+
+ RTEMS.REGION.GET_SEGMENT(
+ TMTEST.REGION_ID,
+ 1998,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.NO_TIMEOUT,
+ TMTEST.BUFFER_ADDRESS_2,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
+
+ -- execute TASK_2
+
+ RTEMS.REGION.RETURN_SEGMENT(
+ TMTEST.REGION_ID,
+ TMTEST.BUFFER_ADDRESS_2,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.REGION.DELETE( TMTEST.REGION_ID, STATUS );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_DELETE" );
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "REGION_DELETE",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.REGION_DELETE
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 20 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end TASK_1;
+
+--
+-- TASK_2
+--
+
+ procedure TASK_2 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "REGION_GET_SEGMENT (blocking)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.REGION_GET_SEGMENT
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.REGION.RETURN_SEGMENT(
+ TMTEST.REGION_ID,
+ TMTEST.BUFFER_ADDRESS_1,
+ STATUS
+ );
+
+ -- preempt back to TASK_1
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.REGION.RETURN_SEGMENT(
+ TMTEST.REGION_ID,
+ TMTEST.BUFFER_ADDRESS_1,
+ STATUS
+ );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "REGION_RETURN_SEGMENT (ready -- return)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.REGION_RETURN_SEGMENT
+ );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end TASK_2;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm20/tmtest.ads b/testsuites/ada/tmtests/tm20/tmtest.ads
new file mode 100644
index 0000000000..8afc25ac2c
--- /dev/null
+++ b/testsuites/ada/tmtests/tm20/tmtest.ads
@@ -0,0 +1,151 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 20 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with TIME_TEST_SUPPORT;
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- These arrays contain the IDs and NAMEs of all RTEMS tasks created
+-- by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
+ TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
+
+--
+-- These following are the ID and NAME of the RTEMS partition created
+-- by this test.
+--
+
+ PARTITION_ID : RTEMS.ID;
+ PARTITION_NAME : RTEMS.NAME;
+
+--
+-- These following are the ID and NAME of the RTEMS region created
+-- by this test.
+--
+
+ REGION_ID : RTEMS.ID;
+ REGION_NAME : RTEMS.NAME;
+
+--
+-- The following area defines a memory area to be used as the
+-- memory space for a partition.
+--
+
+ PARTITION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 )
+ of RTEMS.UNSIGNED8;
+ for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
+
+--
+-- The following area defines a memory area to be used as the
+-- memory space for a region.
+--
+
+ REGION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 )
+ of RTEMS.UNSIGNED8;
+
+ for REGION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
+
+--
+-- The following are the buffers allocated from the region.
+--
+
+ BUFFER_ADDRESS_1 : RTEMS.ADDRESS;
+ BUFFER_ADDRESS_2 : RTEMS.ADDRESS;
+ BUFFER_ADDRESS_3 : RTEMS.ADDRESS;
+ BUFFER_ADDRESS_4 : RTEMS.ADDRESS;
+
+ BUFFER_ADDRESSES : array ( RTEMS.UNSIGNED32
+ range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ADDRESS;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TASK_1
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is responsible for measuring and reporting
+-- the following execution times:
+--
+-- + PARTITION_CREATE
+-- + REGION_CREATE
+-- + PARTITION_GET_BUFFER with a buffer available
+-- + PARTITION_GET_BUFFER with no buffers available
+-- + PARTITION_RETURN_BUFFER
+-- + PARTITION_DELETE
+-- + REGION_GET_SEGMENT with a segment available
+-- + REGION_GET_SEGMENT with the NO_WAIT option
+-- + REGION_RETURN_SEGMENT with no tasks waiting for memory
+-- + REGION_RETURN_SEGMENT preemptive
+-- + REGION_DELETE
+-- + IO_INITIALIZE
+-- + IO_OPEN
+-- + IO_CLOSE
+-- + IO_READ
+-- + IO_WRITE
+-- + IO_CONTROL
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TASK_1);
+
+--
+-- TASK_2
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is responsible for measuring and reporting
+-- the following execution times:
+--
+-- + blocking REGION_GET_SEGMENT
+-- + REGION_RETURN_SEGMENT which readies a task
+--
+
+ procedure TASK_2 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TASK_2);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm21/Makefile.am b/testsuites/ada/tmtests/tm21/Makefile.am
new file mode 100644
index 0000000000..37f4c6b9b5
--- /dev/null
+++ b/testsuites/ada/tmtests/tm21/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm21
+ada_tm21_SOURCES = tm21.adb config.h tmtest.adb tmtest.ads
+ada_tm21_SOURCES += ../../support/init.c
+
+ada_tm21$(EXEEXT): tm21.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm21/config.h b/testsuites/ada/tmtests/tm21/config.h
new file mode 100644
index 0000000000..d4b8bc5054
--- /dev/null
+++ b/testsuites/ada/tmtests/tm21/config.h
@@ -0,0 +1,38 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 102
+#define CONFIGURE_MAXIMUM_TIMERS 100
+#define CONFIGURE_MAXIMUM_SEMAPHORES 100
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 100
+#define CONFIGURE_MAXIMUM_PARTITIONS 100
+#define CONFIGURE_MAXIMUM_REGIONS 100
+#define CONFIGURE_MAXIMUM_PORTS 100
+#define CONFIGURE_MAXIMUM_PERIODS 100
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm21/tm21.adb b/testsuites/ada/tmtests/tm21/tm21.adb
new file mode 100644
index 0000000000..45381ece6c
--- /dev/null
+++ b/testsuites/ada/tmtests/tm21/tm21.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM21 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM21 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM21;
+
diff --git a/testsuites/ada/tmtests/tm21/tmtest.adb b/testsuites/ada/tmtests/tm21/tmtest.adb
new file mode 100644
index 0000000000..245376953d
--- /dev/null
+++ b/testsuites/ada/tmtests/tm21/tmtest.adb
@@ -0,0 +1,304 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 21 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+with RTEMS.MESSAGE_QUEUE;
+with RTEMS.PARTITION;
+with RTEMS.PORT;
+with RTEMS.RATE_MONOTONIC;
+with RTEMS.REGION;
+with RTEMS.SEMAPHORE;
+with RTEMS.TIMER;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 21 ***" );
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ 250,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE TASK_1" );
+
+ RTEMS.TASKS.START( ID, TMTEST.TASK_1'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START TASK1" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TASK_1
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ ID : RTEMS.ID;
+ OVERHEAD : RTEMS.UNSIGNED32;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ INDEX,
+ 254,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
+
+ RTEMS.MESSAGE_QUEUE.CREATE(
+ INDEX,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 16,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" );
+
+ RTEMS.SEMAPHORE.CREATE(
+ INDEX,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ RTEMS.TASKS.NO_PRIORITY,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" );
+
+ RTEMS.REGION.CREATE(
+ INDEX,
+ TMTEST.REGION_AREA'ADDRESS,
+ 2048,
+ 16,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE" );
+
+ RTEMS.PARTITION.CREATE(
+ INDEX,
+ TMTEST.PARTITION_AREA'ADDRESS,
+ 2048,
+ 128,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE" );
+
+ RTEMS.PORT.CREATE(
+ INDEX,
+ TMTEST.INTERNAL_PORT_AREA'ADDRESS,
+ TMTEST.EXTERNAL_PORT_AREA'ADDRESS,
+ 16#FF#,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_CREATE" );
+
+ RTEMS.TIMER.CREATE( INDEX, ID, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" );
+
+ RTEMS.RATE_MONOTONIC.CREATE( INDEX, ID, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CREATE" );
+
+ end loop;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ OVERHEAD := TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.IDENT( INDEX, RTEMS.SEARCH_ALL_NODES, ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_IDENT
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.MESSAGE_QUEUE.IDENT(
+ INDEX,
+ RTEMS.SEARCH_ALL_NODES,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_IDENT
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.SEMAPHORE.IDENT(
+ INDEX,
+ RTEMS.SEARCH_ALL_NODES,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SEMAPHORE_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.SEMAPHORE_IDENT
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.PARTITION.IDENT(
+ INDEX,
+ RTEMS.SEARCH_ALL_NODES,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PARTITION_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.PARTITION_IDENT
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.REGION.IDENT( INDEX, ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "REGION_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.REGION_IDENT
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.PORT.IDENT( INDEX, ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PORT_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.PORT_IDENT
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TIMER.IDENT( INDEX, ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TIMER_IDENT
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.RATE_MONOTONIC.IDENT( INDEX, ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "RATE_MONOTONIC_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_IDENT
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 21 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end TASK_1;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm21/tmtest.ads b/testsuites/ada/tmtests/tm21/tmtest.ads
new file mode 100644
index 0000000000..538ffad4d0
--- /dev/null
+++ b/testsuites/ada/tmtests/tm21/tmtest.ads
@@ -0,0 +1,121 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 21 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with SYSTEM;
+with System.Storage_Elements;
+
+package TMTEST is
+
+--
+-- These arrays contain the IDs and NAMEs of all RTEMS tasks created
+-- by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
+ TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- The following area defines a memory area to be used as the
+-- internal address space of the port.
+--
+
+ INTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
+ System.Storage_Elements.To_Address(16#00001000#);
+
+ INTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
+ of RTEMS.UNSIGNED8;
+ for INTERNAL_PORT_AREA'Address use INTERNAL_PORT_AREA_ADDRESS;
+
+--
+-- The following area defines a memory area to be used as the
+-- external address space of the port.
+--
+
+ EXTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
+ System.Storage_Elements.To_Address(16#00002000#);
+
+ EXTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
+ of RTEMS.UNSIGNED8;
+ for EXTERNAL_PORT_AREA'Address use EXTERNAL_PORT_AREA_ADDRESS;
+
+--
+-- The following area defines a memory area to be used as the
+-- memory space for a partition.
+--
+
+ PARTITION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 )
+ of RTEMS.UNSIGNED8;
+ for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
+
+--
+-- These following are the ID and NAME of the RTEMS region created
+-- by this test.
+--
+
+ REGION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 )
+ of RTEMS.UNSIGNED8;
+ for REGION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TASK_1
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is responsible for measuring and reporting the
+-- following directive execution times:
+--
+-- + TASK_IDENT
+-- + MESSAGE_QUEUE_IDENT
+-- + SEMAPHORE_IDENT
+-- + PARTITION_IDENT
+-- + REGION_IDENT
+-- + PORT_IDENT
+-- + TIMER_IDENT
+-- + RATE_MONOTONIC_IDENT
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TASK_1);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm22/Makefile.am b/testsuites/ada/tmtests/tm22/Makefile.am
new file mode 100644
index 0000000000..a477b99cd7
--- /dev/null
+++ b/testsuites/ada/tmtests/tm22/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm22
+ada_tm22_SOURCES = tm22.adb config.h tmtest.adb tmtest.ads
+ada_tm22_SOURCES += ../../support/init.c
+
+ada_tm22$(EXEEXT): tm22.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm22/config.h b/testsuites/ada/tmtests/tm22/config.h
new file mode 100644
index 0000000000..c1585c7ef4
--- /dev/null
+++ b/testsuites/ada/tmtests/tm22/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 103
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm22/tm22.adb b/testsuites/ada/tmtests/tm22/tm22.adb
new file mode 100644
index 0000000000..ce755dd517
--- /dev/null
+++ b/testsuites/ada/tmtests/tm22/tm22.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM22 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM22 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM22;
+
diff --git a/testsuites/ada/tmtests/tm22/tmtest.adb b/testsuites/ada/tmtests/tm22/tmtest.adb
new file mode 100644
index 0000000000..ea1afc84c9
--- /dev/null
+++ b/testsuites/ada/tmtests/tm22/tmtest.adb
@@ -0,0 +1,252 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 22 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+with RTEMS.MESSAGE_QUEUE;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 22 ***" );
+
+ RTEMS.MESSAGE_QUEUE.CREATE(
+ RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ),
+ 100,
+ 16,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.MESSAGE_QUEUE_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" );
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ),
+ 10,
+ 2048,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOW" );
+
+ RTEMS.TASKS.START( ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOW" );
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'P', 'R', 'M', 'T' ),
+ 11,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE PREEMPT" );
+
+ RTEMS.TASKS.START( ID, TMTEST.PREEMPT_TASK'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START PREEMPT" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- HIGH_TASK
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ COUNT : RTEMS.UNSIGNED32;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.MESSAGE_QUEUE.BROADCAST(
+ TMTEST.MESSAGE_QUEUE_ID,
+ BUFFER_POINTER,
+ 16,
+ COUNT,
+ STATUS
+ );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_BROADCAST (readying)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_BROADCAST
+ );
+
+ RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" );
+
+ end HIGH_TASK;
+
+--
+-- LOW_TASK
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ ID : RTEMS.ID;
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ OVERHEAD : RTEMS.UNSIGNED32;
+ COUNT : RTEMS.UNSIGNED32;
+ MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ),
+ 5,
+ 2048,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HIGH" );
+
+ RTEMS.TASKS.START( ID, TMTEST.HIGH_TASK'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HIGH" );
+
+ RTEMS.MESSAGE_QUEUE.RECEIVE(
+ TMTEST.MESSAGE_QUEUE_ID,
+ BUFFER_POINTER,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.NO_TIMEOUT,
+ MESSAGE_SIZE,
+ STATUS
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ OVERHEAD := TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.MESSAGE_QUEUE.BROADCAST(
+ TMTEST.MESSAGE_QUEUE_ID,
+ BUFFER_POINTER,
+ 16,
+ COUNT,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_BROADCAST (no waiting tasks)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_BROADCAST
+ );
+
+ RTEMS.MESSAGE_QUEUE.RECEIVE(
+ TMTEST.MESSAGE_QUEUE_ID,
+ BUFFER_POINTER,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.NO_TIMEOUT,
+ MESSAGE_SIZE,
+ STATUS
+ );
+
+ -- should go to PREEMPT_TASK here
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_BROADCAST (preempt)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_BROADCAST
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 22 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end LOW_TASK;
+
+--
+-- LOW_TASK
+--
+
+ procedure PREEMPT_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ COUNT : RTEMS.UNSIGNED32;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.MESSAGE_QUEUE.BROADCAST(
+ TMTEST.MESSAGE_QUEUE_ID,
+ BUFFER_POINTER,
+ 16,
+ COUNT,
+ STATUS
+ );
+
+ -- should be preempted by LOW_TASK
+
+ end PREEMPT_TASK;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm22/tmtest.ads b/testsuites/ada/tmtests/tm22/tmtest.ads
new file mode 100644
index 0000000000..f5dce6c3a0
--- /dev/null
+++ b/testsuites/ada/tmtests/tm22/tmtest.ads
@@ -0,0 +1,120 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 22 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- Buffer Record similar to that used by RTEMS 3.2.1. Using this
+-- avoids changes to the test.
+--
+
+ type BUFFER is
+ record
+ FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
+ FIELD2 : RTEMS.UNSIGNED32;
+ FIELD3 : RTEMS.UNSIGNED32;
+ FIELD4 : RTEMS.UNSIGNED32;
+ end record;
+
+--
+-- The following is the ID of the message queue used for timing operations.
+--
+
+ MESSAGE_QUEUE_ID : RTEMS.ID;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- HIGH_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is created by LOW_TASK and executes after
+-- LOW_TASK has performed a blocking MESSAGE_QUEUE_RECEIVE.
+-- This task then executes and performs a readying
+-- MESSAGE_QUEUE_BROADCAST and reports its execution time.
+-- Finally, the task suspends itself so LOW_TASK can continue
+-- execution.
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASK);
+
+--
+-- LOW_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task performs a blocking MESSAGE_QUEUE_RECEIVE
+-- so that when HIGH_TASK performs a MESSAGE_QUEUE_BROADCAST,
+-- there will be a task to be readied. Following this, the
+-- execution time for a MESSAGE_QUEUE_BROADCAST to a message
+-- queue with no waiting tasks is measured and reported.
+-- Then this task performs another blocking MESSAGE_QUEUE_RECEIVE
+-- so that when PREEMPT_TASK performs a MESSAGE_QUEUE_BROADCAST,
+-- PREEMPT_TASK will be preempted by this task. After control
+-- of the processor is transferred back to this task by the
+-- preemption, the timer is stopped and the execution time of
+-- a preemptive MESSAGE_QUEUE_BROADCAST is reported.
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, LOW_TASK);
+
+--
+-- PREEMPT_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task starts the timer and performs a preemptive
+-- MESSAGE_QUEUE_BROADCAST.
+--
+
+ procedure PREEMPT_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, PREEMPT_TASK);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm23/Makefile.am b/testsuites/ada/tmtests/tm23/Makefile.am
new file mode 100644
index 0000000000..6ee7aa44b9
--- /dev/null
+++ b/testsuites/ada/tmtests/tm23/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm23
+ada_tm23_SOURCES = tm23.adb config.h tmtest.adb tmtest.ads
+ada_tm23_SOURCES += ../../support/init.c
+
+ada_tm23$(EXEEXT): tm23.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm23/config.h b/testsuites/ada/tmtests/tm23/config.h
new file mode 100644
index 0000000000..15e3e1ccf6
--- /dev/null
+++ b/testsuites/ada/tmtests/tm23/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_TIMERS 110
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm23/tm23.adb b/testsuites/ada/tmtests/tm23/tm23.adb
new file mode 100644
index 0000000000..5e345c958a
--- /dev/null
+++ b/testsuites/ada/tmtests/tm23/tm23.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM23 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM23 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM23;
+
diff --git a/testsuites/ada/tmtests/tm23/tmtest.adb b/testsuites/ada/tmtests/tm23/tmtest.adb
new file mode 100644
index 0000000000..4b5a26f777
--- /dev/null
+++ b/testsuites/ada/tmtests/tm23/tmtest.adb
@@ -0,0 +1,388 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 23 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIMER_DRIVER;
+with RTEMS.CLOCK;
+with RTEMS.TIMER;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ TASK_PRIORITY : RTEMS.TASKS.PRIORITY;
+ ID : RTEMS.ID;
+ TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 23 ***" );
+
+ TASK_PRIORITY := 5;
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ TASK_PRIORITY,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ if INDEX = 1 then
+ TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
+ elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then
+ TASK_ENTRY := TMTEST.LOW_TASK'ACCESS;
+ else
+ TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
+ end if;
+
+ RTEMS.TASKS.START( ID, TASK_ENTRY, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ TASK_PRIORITY := TASK_PRIORITY + 1;
+
+ end loop;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- NULL_DELAY
+--
+
+ procedure NULL_DELAY (
+ IGNORED_ID : in RTEMS.ID;
+ IGNORED_ADDRESS : in RTEMS.ADDRESS
+ ) is
+ begin
+
+ NULL;
+
+ end NULL_DELAY;
+
+--
+-- HIGH_TASK
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ OVERHEAD : RTEMS.UNSIGNED32;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ OVERHEAD := TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TIMER.CREATE(
+ INDEX,
+ TMTEST.TIMER_ID( INDEX ),
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_CREATE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TIMER_CREATE
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TIMER.FIRE_AFTER(
+ TMTEST.TIMER_ID( INDEX ),
+ 500,
+ TMTEST.NULL_DELAY'ACCESS,
+ RTEMS.NULL_ADDRESS,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_FIRE_AFTER (inactive)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TIMER_FIRE_AFTER
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TIMER.FIRE_AFTER(
+ TMTEST.TIMER_ID( INDEX ),
+ 500,
+ TMTEST.NULL_DELAY'ACCESS,
+ RTEMS.NULL_ADDRESS,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_FIRE_AFTER (active)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TIMER_FIRE_AFTER
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TIMER.CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_CANCEL (active)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TIMER_CANCEL
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TIMER.CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_CANCEL (inactive)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TIMER_CANCEL
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TIMER.RESET( TMTEST.TIMER_ID( INDEX ), STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_RESET (inactive)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TIMER_RESET
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TIMER.RESET( TMTEST.TIMER_ID( INDEX ), STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_RESET (active)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TIMER_RESET
+ );
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TIMER.CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS );
+ end loop;
+
+ TMTEST.TIME_OF_DAY := ( 1988, 12, 31, 9, 0, 0, 0 );
+
+ RTEMS.CLOCK.SET( TMTEST.TIME_OF_DAY, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" );
+
+ TMTEST.TIME_OF_DAY.YEAR := 1989;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TIMER.FIRE_WHEN(
+ TMTEST.TIMER_ID( INDEX ),
+ TMTEST.TIME_OF_DAY,
+ TMTEST.NULL_DELAY'ACCESS,
+ RTEMS.NULL_ADDRESS,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_FIRE_WHEN (inactive)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TIMER_FIRE_WHEN
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TIMER.FIRE_WHEN(
+ TMTEST.TIMER_ID( INDEX ),
+ TMTEST.TIME_OF_DAY,
+ TMTEST.NULL_DELAY'ACCESS,
+ RTEMS.NULL_ADDRESS,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_FIRE_WHEN (active)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TIMER_FIRE_WHEN
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TIMER.DELETE( TMTEST.TIMER_ID( INDEX ), STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_DELETE (active)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TIMER_DELETE
+ );
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TIMER.CREATE( INDEX, TMTEST.TIMER_ID( INDEX ), STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" );
+
+ RTEMS.TIMER.FIRE_AFTER(
+ TMTEST.TIMER_ID( INDEX ),
+ 500,
+ TMTEST.NULL_DELAY'ACCESS,
+ RTEMS.NULL_ADDRESS,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" );
+
+ RTEMS.TIMER.CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" );
+
+ end loop;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TIMER.DELETE( TMTEST.TIMER_ID( INDEX ), STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_DELETE (inactive)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TIMER_DELETE
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.TASKS.WAKE_WHEN( TMTEST.TIME_OF_DAY, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_WHEN" );
+
+ end HIGH_TASK;
+
+--
+-- MIDDLE_TASKS
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ RTEMS.TASKS.WAKE_WHEN( TMTEST.TIME_OF_DAY, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_WHEN" );
+
+ end MIDDLE_TASKS;
+
+--
+-- LOW_TASK
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ begin
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_WAKE_WHEN",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.TASK_WAKE_WHEN
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 23 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end LOW_TASK;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm23/tmtest.ads b/testsuites/ada/tmtests/tm23/tmtest.ads
new file mode 100644
index 0000000000..6e567007ca
--- /dev/null
+++ b/testsuites/ada/tmtests/tm23/tmtest.ads
@@ -0,0 +1,132 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 23 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with TIME_TEST_SUPPORT;
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- This array contains the IDs of all RTEMS timers created by this test.
+--
+
+ TIMER_ID : array ( RTEMS.UNSIGNED32
+ range 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
+
+--
+-- This data item contains a time of day used by all of the
+-- "WHEN" directives timed in this test.
+--
+
+ TIME_OF_DAY : RTEMS.TIME_OF_DAY;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- NULL_DELAY
+--
+-- DESCRIPTION:
+--
+-- This subprogram is a timer service routine. It performs
+-- no actions.
+--
+
+ procedure NULL_DELAY (
+ IGNORED_ID : in RTEMS.ID;
+ IGNORED_ADDRESS : in RTEMS.ADDRESS
+ );
+ pragma Convention (C, NULL_DELAY);
+
+--
+-- HIGH_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is responsible for measuring and reporting
+-- the following directive execution times:
+--
+-- + TIMER_CREATE
+-- + TIMER_FIRE_AFTER with an inactive timer
+-- + TIMER_FIRE_AFTER with an active timer
+-- + TIMER_CANCEL of an active timer
+-- + TIMER_CANCEL of an inactive timer
+-- + TIMER_RESET of an active timer
+-- + TIMER_RESET of an inactive timer
+-- + TIMER_FIRE_WHEN of an inactive timer
+-- + TIMER_FIRE_WHEN of an active timer
+-- + TIMER_DELETE of an active timer
+-- + TIMER_DELETE of an inactive timer
+--
+-- After measuring and reporting the above times, this task starts
+-- the timer and executes the TASK_WAKE_WHEN directive.
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASK);
+
+--
+-- MIDDLE_TASKS
+--
+-- DESCRIPTION:
+--
+-- These RTEMS tasks executes the TASK_WAKE_WHEN directive.
+--
+
+ procedure MIDDLE_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, MIDDLE_TASKS);
+
+--
+-- LOW_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task stops the timer and reports the execution time for
+-- the TASK_WAKE_WHEN directive.
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, LOW_TASK);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm24/Makefile.am b/testsuites/ada/tmtests/tm24/Makefile.am
new file mode 100644
index 0000000000..9c7ec2e996
--- /dev/null
+++ b/testsuites/ada/tmtests/tm24/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm24
+ada_tm24_SOURCES = tm24.adb config.h tmtest.adb tmtest.ads
+ada_tm24_SOURCES += ../../support/init.c
+
+ada_tm24$(EXEEXT): tm24.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm24/config.h b/testsuites/ada/tmtests/tm24/config.h
new file mode 100644
index 0000000000..85640d92a9
--- /dev/null
+++ b/testsuites/ada/tmtests/tm24/config.h
@@ -0,0 +1,31 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm24/tm24.adb b/testsuites/ada/tmtests/tm24/tm24.adb
new file mode 100644
index 0000000000..a5ca5d4f7f
--- /dev/null
+++ b/testsuites/ada/tmtests/tm24/tm24.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM24 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM24 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM24;
+
diff --git a/testsuites/ada/tmtests/tm24/tmtest.adb b/testsuites/ada/tmtests/tm24/tmtest.adb
new file mode 100644
index 0000000000..2bcd220516
--- /dev/null
+++ b/testsuites/ada/tmtests/tm24/tmtest.adb
@@ -0,0 +1,161 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 24 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 24 ***" );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ TMTEST.OVERHEAD := TIMER_DRIVER.READ_TIMER;
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ),
+ 10,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HIGH" );
+
+ RTEMS.TASKS.START( ID, TMTEST.HIGH_TASK'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HIGH" );
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'R', 'E', 'S', 'T' ),
+ 128,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ RTEMS.TASKS.START( ID, TMTEST.TASKS'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ end loop;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- HIGH_TASK
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_WAKE_AFTER (no context switch)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ TMTEST.OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_WAKE_AFTER
+ );
+
+ TMTEST.TASK_COUNT := 0;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end HIGH_TASK;
+
+--
+-- TASKS
+--
+
+ procedure TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1;
+
+ if TMTEST.TASK_COUNT = 1 then
+
+ TIMER_DRIVER.INITIALIZE;
+
+ elsif TMTEST.TASK_COUNT = TIME_TEST_SUPPORT.OPERATION_COUNT then
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_WAKE_AFTER (context switch)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ TMTEST.OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.TASK_WAKE_AFTER
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 24 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end if;
+
+ RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
+
+ end TASKS;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm24/tmtest.ads b/testsuites/ada/tmtests/tm24/tmtest.ads
new file mode 100644
index 0000000000..fb6203d5c1
--- /dev/null
+++ b/testsuites/ada/tmtests/tm24/tmtest.ads
@@ -0,0 +1,99 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 24 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- These arrays contain the IDs and NAMEs of all RTEMS tasks created
+-- by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
+ TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
+
+--
+-- This variable is used to determine which task should
+-- start the timer and which task should stop the timer
+-- and report the execution time.
+--
+
+ TASK_COUNT : RTEMS.UNSIGNED32;
+
+--
+-- This variable contains the execution time required of the
+-- loop used to execute the directive.
+--
+
+ OVERHEAD : RTEMS.UNSIGNED32;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- HIGH_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is responsible for measuring and reporting the
+-- execution time for an invocation of TASK_WAKE_AFTER which
+-- attempts to yield but does not result in a context switch.
+--
+
+ procedure HIGH_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASK);
+
+--
+-- TASKS
+--
+-- DESCRIPTION:
+--
+-- These RTEMS tasks are responsible for measuring and reporting the
+-- execution time for an invocation of TASK_WAKE_AFTER which
+-- attempts to yield but does result in a context switch.
+--
+
+ procedure TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TASKS);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm25/Makefile.am b/testsuites/ada/tmtests/tm25/Makefile.am
new file mode 100644
index 0000000000..db67df9aff
--- /dev/null
+++ b/testsuites/ada/tmtests/tm25/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm25
+ada_tm25_SOURCES = tm25.adb config.h tmtest.adb tmtest.ads
+ada_tm25_SOURCES += ../../support/init.c
+
+ada_tm25$(EXEEXT): tm25.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm25/config.h b/testsuites/ada/tmtests/tm25/config.h
new file mode 100644
index 0000000000..700438ceae
--- /dev/null
+++ b/testsuites/ada/tmtests/tm25/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_SEMAPHORES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm25/tm25.adb b/testsuites/ada/tmtests/tm25/tm25.adb
new file mode 100644
index 0000000000..44bda5893f
--- /dev/null
+++ b/testsuites/ada/tmtests/tm25/tm25.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM25 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM25 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM25;
+
diff --git a/testsuites/ada/tmtests/tm25/tmtest.adb b/testsuites/ada/tmtests/tm25/tmtest.adb
new file mode 100644
index 0000000000..8710052bfb
--- /dev/null
+++ b/testsuites/ada/tmtests/tm25/tmtest.adb
@@ -0,0 +1,155 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 25 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+with RTEMS.CLOCK;
+with RTEMS.SEMAPHORE;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ TASK_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 25 ***" );
+
+ RTEMS.SEMAPHORE.CREATE(
+ RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ),
+ 0,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ RTEMS.TASKS.NO_PRIORITY,
+ TMTEST.SEMAPHORE_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" );
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ),
+ 254,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOW" );
+
+ RTEMS.TASKS.START(
+ TASK_ID,
+ TMTEST.LOW_TASK'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOW" );
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
+ 128,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TASK_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ RTEMS.TASKS.START(
+ TASK_ID,
+ TMTEST.HIGH_TASKS'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ end loop;
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- HIGH_TASKS
+--
+
+ procedure HIGH_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ RTEMS.SEMAPHORE.OBTAIN(
+ TMTEST.SEMAPHORE_ID,
+ RTEMS.DEFAULT_OPTIONS,
+ RTEMS.INTERVAL'LAST,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
+
+ end HIGH_TASKS;
+
+--
+-- LOW_TASK
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.CLOCK.TICK( STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "CLOCK_TICK",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ 0,
+ RTEMS_CALLING_OVERHEAD.CLOCK_TICK
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 25 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end LOW_TASK;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm25/tmtest.ads b/testsuites/ada/tmtests/tm25/tmtest.ads
new file mode 100644
index 0000000000..45a671af81
--- /dev/null
+++ b/testsuites/ada/tmtests/tm25/tmtest.ads
@@ -0,0 +1,80 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 25 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- The following is the ID of the semaphore used for timing operations.
+--
+
+ SEMAPHORE_ID : RTEMS.ID;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- HIGH_TASKS
+--
+-- DESCRIPTION:
+--
+-- These RTEMS tasks perform a blocking SEMAPHORE_OBTAIN which
+-- has an optional timeout.
+--
+
+ procedure HIGH_TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, HIGH_TASKS);
+
+--
+-- LOW_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is responsible for measuring and reporting
+-- the execution time for the CLOCK_TICK directive.
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, LOW_TASK);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm28/Makefile.am b/testsuites/ada/tmtests/tm28/Makefile.am
new file mode 100644
index 0000000000..eca1e00d55
--- /dev/null
+++ b/testsuites/ada/tmtests/tm28/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm28
+ada_tm28_SOURCES = tm28.adb config.h tmtest.adb tmtest.ads
+ada_tm28_SOURCES += ../../support/init.c
+
+ada_tm28$(EXEEXT): tm28.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm28/config.h b/testsuites/ada/tmtests/tm28/config.h
new file mode 100644
index 0000000000..2f73cd5acb
--- /dev/null
+++ b/testsuites/ada/tmtests/tm28/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 2
+#define CONFIGURE_MAXIMUM_PORTS 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm28/tm28.adb b/testsuites/ada/tmtests/tm28/tm28.adb
new file mode 100644
index 0000000000..93d0f3cf02
--- /dev/null
+++ b/testsuites/ada/tmtests/tm28/tm28.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM28 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM28 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM28;
+
diff --git a/testsuites/ada/tmtests/tm28/tmtest.adb b/testsuites/ada/tmtests/tm28/tmtest.adb
new file mode 100644
index 0000000000..189090e39f
--- /dev/null
+++ b/testsuites/ada/tmtests/tm28/tmtest.adb
@@ -0,0 +1,171 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 28 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIMER_DRIVER;
+with RTEMS.PORT;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 28 ***" );
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'E', 'S', 'T' ),
+ 128,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( 1 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
+
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( 1 ),
+ TMTEST.TEST_TASK'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TEST_TASK
+--
+
+ procedure TEST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ NAME : RTEMS.NAME;
+ OVERHEAD : RTEMS.UNSIGNED32;
+ CONVERTED : RTEMS.ADDRESS;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ OVERHEAD := TIMER_DRIVER.READ_TIMER;
+
+ NAME := RTEMS.BUILD_NAME( 'P', 'O', 'R', 'T' );
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.PORT.CREATE(
+ NAME,
+ TMTEST.INTERNAL_PORT_AREA'ADDRESS,
+ TMTEST.EXTERNAL_PORT_AREA'ADDRESS,
+ 16#FF#,
+ TMTEST.PORT_ID( INDEX ),
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PORT_CREATE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.PORT_CREATE
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.PORT.EXTERNAL_TO_INTERNAL(
+ TMTEST.PORT_ID( 1 ),
+ TMTEST.EXTERNAL_PORT_AREA( 16#F# )'ADDRESS,
+ CONVERTED,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PORT_EXTERNAL_TO_INTERNAL",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.PORT_EXTERNAL_TO_INTERNAL
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.PORT.INTERNAL_TO_EXTERNAL(
+ TMTEST.PORT_ID( 1 ),
+ TMTEST.INTERNAL_PORT_AREA( 16#F# )'ADDRESS,
+ CONVERTED,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PORT_INTERNAL_TO_EXTERNAL",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.PORT_INTERNAL_TO_EXTERNAL
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ RTEMS.PORT.DELETE( TMTEST.PORT_ID( INDEX ), STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PORT_DELETE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.PORT_DELETE
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 28 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end TEST_TASK;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm28/tmtest.ads b/testsuites/ada/tmtests/tm28/tmtest.ads
new file mode 100644
index 0000000000..39ceeb0ad2
--- /dev/null
+++ b/testsuites/ada/tmtests/tm28/tmtest.ads
@@ -0,0 +1,105 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 28 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with SYSTEM;
+with TIME_TEST_SUPPORT;
+with RTEMS;
+with RTEMS.TASKS;
+with System.Storage_Elements;
+
+package TMTEST is
+
+--
+-- This array contains the IDs of all RTEMS tasks created by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
+
+--
+-- This array contains the IDs of all RTEMS ports created by this test.
+--
+
+ PORT_ID : array ( RTEMS.UNSIGNED32
+ range 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
+
+--
+-- The following area defines a memory area to be used as the
+-- internal address space of the port.
+--
+
+ INTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
+ System.Storage_Elements.To_Address(16#00001000#);
+
+ INTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
+ of RTEMS.UNSIGNED8;
+ for INTERNAL_PORT_AREA'Address use INTERNAL_PORT_AREA_ADDRESS;
+
+--
+-- The following area defines a memory area to be used as the
+-- external address space of the port.
+--
+
+ EXTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
+ System.Storage_Elements.To_Address(16#00002000#);
+
+ EXTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
+ of RTEMS.UNSIGNED8;
+ for EXTERNAL_PORT_AREA'Address use EXTERNAL_PORT_AREA_ADDRESS;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TEST_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is responsible for measuring and reporting the
+-- following directive execution times:
+--
+-- + PORT_CREATE
+-- + PORT_EXTERNAL_TO_INTERNAL
+-- + PORT_INTERNAL_TO_EXTERNAL
+-- + PORT_DELETE
+--
+
+ procedure TEST_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TEST_TASK);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm29/Makefile.am b/testsuites/ada/tmtests/tm29/Makefile.am
new file mode 100644
index 0000000000..d34b097da4
--- /dev/null
+++ b/testsuites/ada/tmtests/tm29/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tm29
+ada_tm29_SOURCES = tm29.adb config.h tmtest.adb tmtest.ads
+ada_tm29_SOURCES += ../../support/init.c
+
+ada_tm29$(EXEEXT): tm29.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tm29/config.h b/testsuites/ada/tmtests/tm29/config.h
new file mode 100644
index 0000000000..e9165e59c8
--- /dev/null
+++ b/testsuites/ada/tmtests/tm29/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 111
+#define CONFIGURE_MAXIMUM_PERIODS 111
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tm29/tm29.adb b/testsuites/ada/tmtests/tm29/tm29.adb
new file mode 100644
index 0000000000..4853fbf2c7
--- /dev/null
+++ b/testsuites/ada/tmtests/tm29/tm29.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TM29 of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TM29 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TM29;
+
diff --git a/testsuites/ada/tmtests/tm29/tmtest.adb b/testsuites/ada/tmtests/tm29/tmtest.adb
new file mode 100644
index 0000000000..0a6a31b713
--- /dev/null
+++ b/testsuites/ada/tmtests/tm29/tmtest.adb
@@ -0,0 +1,236 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 29 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS_CALLING_OVERHEAD;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+with RTEMS.RATE_MONOTONIC;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST 29 ***" );
+
+ TMTEST.PERIOD_NAME := RTEMS.BUILD_NAME( 'P', 'R', 'D', ' ' );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.RATE_MONOTONIC.CREATE( TMTEST.PERIOD_NAME, ID, STATUS );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "RATE_MONOTONIC_CREATE",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_CREATE
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.RATE_MONOTONIC.PERIOD( ID, 10, STATUS );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" );
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "RATE_MONOTONIC_PERIOD (initial)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_PERIOD
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.RATE_MONOTONIC.PERIOD( ID, RTEMS.RATE_MONOTONIC_PERIOD_STATUS, STATUS );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" );
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "RATE_MONOTONIC_PERIOD (STATUS)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_PERIOD
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.RATE_MONOTONIC.CANCEL( ID, STATUS );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CANCEL" );
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "RATE_MONOTONIC_CANCEL",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_CANCEL
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.RATE_MONOTONIC.DELETE( ID, STATUS );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "RATE_MONOTONIC_DELETE (cancelled)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_DELETE
+ );
+
+ RTEMS.RATE_MONOTONIC.CREATE( TMTEST.PERIOD_NAME, ID, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CREATE" );
+
+ RTEMS.RATE_MONOTONIC.PERIOD( ID, 10, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" );
+
+ TIMER_DRIVER.INITIALIZE;
+ RTEMS.RATE_MONOTONIC.DELETE( ID, STATUS );
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "RATE_MONOTONIC_DELETE (active)",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_DELETE
+ );
+
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'T', 'E', 'S', 'T' ),
+ 128,
+ 1024,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ RTEMS.TASKS.START( ID, TMTEST.TASKS'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ end loop;
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ),
+ 200,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
+
+ RTEMS.TASKS.START( ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
+
+ TMTEST.TASK_COUNT := 0;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TASKS
+--
+
+ procedure TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ ID : RTEMS.NAME;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ RTEMS.RATE_MONOTONIC.CREATE( TMTEST.PERIOD_NAME, ID, STATUS );
+ RTEMS.RATE_MONOTONIC.PERIOD( ID, 10, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" );
+
+ -- Give up the processor to allow all tasks to actually
+ -- create and start their period timer before the benchmark
+ -- timer driver is initialized.
+
+ RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
+
+ TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1;
+
+ if TMTEST.TASK_COUNT = 1 then
+ TIMER_DRIVER.INITIALIZE;
+ end if;
+
+ RTEMS.RATE_MONOTONIC.PERIOD( ID, 100, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" );
+
+ end TASKS;
+
+--
+-- LOW_TASK
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ OVERHEAD : RTEMS.UNSIGNED32;
+ begin
+
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ OVERHEAD := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "RATE_MONOTONIC_PERIOD (blocking)",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_PERIOD
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST 29 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end LOW_TASK;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tm29/tmtest.ads b/testsuites/ada/tmtests/tm29/tmtest.ads
new file mode 100644
index 0000000000..8661fc28b6
--- /dev/null
+++ b/testsuites/ada/tmtests/tm29/tmtest.ads
@@ -0,0 +1,96 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 29 of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- The following is the name used for all periods created by this test.
+--
+
+ PERIOD_NAME : RTEMS.NAME;
+
+--
+-- The following is used to allow all tasks to create and start
+-- their period timers before the timer is started for timing
+-- the blocking case of RATE_MONOTONIC_PERIOD.
+--
+
+ TASK_COUNT : RTEMS.UNSIGNED32;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application. It also measures and
+-- reports the following directive execution times:
+--
+-- + RATE_MONOTONIC_CREATE
+-- + RATE_MONOTONIC_PERIOD the initial time
+-- + RATE_MONOTONIC_PERIOD for a period's status
+-- + RATE_MONOTONIC_CANCEL
+-- + RATE_MONOTONIC_DELETE of a cancelled period
+-- + RATE_MONOTONIC_DELETE of an active period
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TASKS
+--
+-- DESCRIPTION:
+--
+-- The first of these RTEMS tasks starts the timer. All of these
+-- tasks execute a blocking RATE_MONOTONIC_PERIOD.
+--
+
+ procedure TASKS (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TASKS);
+
+--
+-- LOW_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task stops the timer and reports the execution
+-- time for a blocking RATE_MONOTONIC_PERIOD.
+--
+
+ procedure LOW_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, LOW_TASK);
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tmck/Makefile.am b/testsuites/ada/tmtests/tmck/Makefile.am
new file mode 100644
index 0000000000..a2fa2956e0
--- /dev/null
+++ b/testsuites/ada/tmtests/tmck/Makefile.am
@@ -0,0 +1,13 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tmck
+ada_tmck_SOURCES = tmck.adb config.h tmtest.adb tmtest.ads
+ada_tmck_SOURCES += ../../support/init.c
+
+ada_tmck$(EXEEXT): tmck.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tmck/config.h b/testsuites/ada/tmtests/tmck/config.h
new file mode 100644
index 0000000000..7730385b3c
--- /dev/null
+++ b/testsuites/ada/tmtests/tmck/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 2
+#define CONFIGURE_MAXIMUM_SEMAPHORES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tmck/tmck.adb b/testsuites/ada/tmtests/tmck/tmck.adb
new file mode 100644
index 0000000000..c35d786517
--- /dev/null
+++ b/testsuites/ada/tmtests/tmck/tmck.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TMCK of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TMCK is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TMCK;
+
diff --git a/testsuites/ada/tmtests/tmck/tmtest.adb b/testsuites/ada/tmtests/tmck/tmtest.adb
new file mode 100644
index 0000000000..8da1ff220a
--- /dev/null
+++ b/testsuites/ada/tmtests/tmck/tmtest.adb
@@ -0,0 +1,214 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Timer Check Test of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with TIMER_DRIVER;
+with INTERFACES; use INTERFACES;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with UNSIGNED32_IO;
+
+package body TMTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST CHECK ***" );
+
+ TIMER_DRIVER.SET_FIND_AVERAGE_OVERHEAD( TRUE );
+
+ TMTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
+
+ RTEMS.TASKS.CREATE(
+ TMTEST.TASK_NAME( 1 ),
+ 1,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( 1 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
+
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( 1 ),
+ TMTEST.TASK_1'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- TASK_1
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ begin
+
+ TMTEST.CHECK_READ_TIMER;
+
+TEST_SUPPORT.PAUSE;
+
+ TIMER_DRIVER.INITIALIZE;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "NULL timer stopped at",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ 0
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 0 .. 1000
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "LOOP (1000) timer stopped at",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ 0
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 0 .. 10000
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "LOOP (10000) timer stopped at",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ 0
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 0 .. 50000
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "LOOP (50000) timer stopped at",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ 0
+ );
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 0 .. 100000
+ loop
+ TIMER_DRIVER.EMPTY_FUNCTION;
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "LOOP (100000) timer stopped at",
+ TMTEST.END_TIME,
+ 1,
+ 0,
+ 0
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST CHECK ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end TASK_1;
+
+--
+-- CHECK_READ_TIMER
+--
+
+ procedure CHECK_READ_TIMER
+ is
+ TIME : RTEMS.UNSIGNED32;
+ begin
+
+ for INDEX in TMTEST.DISTRIBUTION'FIRST .. TMTEST.DISTRIBUTION'LAST
+ loop
+ TMTEST.DISTRIBUTION( INDEX ) := 0;
+ end loop;
+
+ for INDEX in 1 .. TMTEST.OPERATION_COUNT
+ loop
+
+ loop
+ TIMER_DRIVER.INITIALIZE;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ exit when
+ TMTEST.END_TIME <= RTEMS.UNSIGNED32( TMTEST.DISTRIBUTION'LAST );
+
+ TEXT_IO.PUT( "TOO LONG (" );
+ UNSIGNED32_IO.PUT( TMTEST.END_TIME );
+ TEXT_IO.PUT_LINE( ")!!!" );
+ end loop;
+
+ TMTEST.DISTRIBUTION( TMTEST.END_TIME ) :=
+ TMTEST.DISTRIBUTION( TMTEST.END_TIME ) + 1;
+
+ end loop;
+
+ TEXT_IO.PUT_LINE(
+ "Units may not be in microseconds for this test!!!"
+ );
+
+ TIME := 0;
+
+ for INDEX in TMTEST.DISTRIBUTION'FIRST .. TMTEST.DISTRIBUTION'LAST
+ loop
+ if TMTEST.DISTRIBUTION( INDEX ) /= 0 then
+ TIME := TIME + (TMTEST.DISTRIBUTION( INDEX ) * INDEX);
+ UNSIGNED32_IO.PUT( INDEX );
+ TEXT_IO.PUT( " " );
+ UNSIGNED32_IO.PUT( TMTEST.DISTRIBUTION( INDEX ) );
+ TEXT_IO.NEW_LINE;
+ end if;
+ end loop;
+
+ TEXT_IO.PUT( "Total time = " );
+ UNSIGNED32_IO.PUT( TIME );
+ TEXT_IO.NEW_LINE;
+
+ end CHECK_READ_TIMER;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tmck/tmtest.ads b/testsuites/ada/tmtests/tmck/tmtest.ads
new file mode 100644
index 0000000000..6eef577910
--- /dev/null
+++ b/testsuites/ada/tmtests/tmck/tmtest.ads
@@ -0,0 +1,96 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Timer Check Test of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package TMTEST is
+
+--
+-- These arrays contain the IDs and NAMEs of all RTEMS tasks created
+-- by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
+ TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- The following defines the number of iterations of each timed
+-- operation to perform.
+--
+
+ OPERATION_COUNT : constant RTEMS.UNSIGNED32 := 100000;
+
+--
+-- The following array is used to determine how many times
+-- each time between 0 and 1000 microseconds was returned
+-- when simply starting and stopping the timer.
+
+ DISTRIBUTION : array ( RTEMS.UNSIGNED32 range 0 .. 10000 ) of RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TASK_1
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task invokes CHECK_READ_TIMER before demonstrating
+-- that increasing the order of magnitude of the number of loop
+-- iterations performed has a corresponding impact on the time
+-- reported by the timer driver.
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TASK_1);
+
+--
+-- CHECK_READ_TIMER
+--
+-- DESCRIPTION:
+--
+-- This subprogram is used to determine the overhead associated
+-- with starting and stopping the timer. It is also useful
+-- for determining if unexpected times will be reported.
+--
+
+ procedure CHECK_READ_TIMER;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tmoverhd/Makefile.am b/testsuites/ada/tmtests/tmoverhd/Makefile.am
new file mode 100644
index 0000000000..8bc56dd537
--- /dev/null
+++ b/testsuites/ada/tmtests/tmoverhd/Makefile.am
@@ -0,0 +1,14 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+noinst_PROGRAMS = ada_tmoverhd
+ada_tmoverhd_SOURCES = tmoverhd.adb config.h tmtest.adb tmtest.ads \
+ dummy_rtems.adb dummy_rtems.ads
+ada_tmoverhd_SOURCES += ../../support/init.c
+
+ada_tmoverhd$(EXEEXT): tmoverhd.adb init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/tmtests/tmoverhd/README b/testsuites/ada/tmtests/tmoverhd/README
new file mode 100644
index 0000000000..4e66647830
--- /dev/null
+++ b/testsuites/ada/tmtests/tmoverhd/README
@@ -0,0 +1,5 @@
+This test is of marginal usefulness in testing the bindings. It
+shows how much overhead is required to call the Ada binding
+routine but does not give any indication of how much overhead the
+binding itself adds. This information can be inferred by subtracting
+the C times from Ada times on the same target processor.
diff --git a/testsuites/ada/tmtests/tmoverhd/config.h b/testsuites/ada/tmtests/tmoverhd/config.h
new file mode 100644
index 0000000000..7730385b3c
--- /dev/null
+++ b/testsuites/ada/tmtests/tmoverhd/config.h
@@ -0,0 +1,32 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_TMTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 2
+#define CONFIGURE_MAXIMUM_SEMAPHORES 1
+#define CONFIGURE_TICKS_PER_TIMESLICE 0
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/tmtests/tmoverhd/dummy_rtems.adb b/testsuites/ada/tmtests/tmoverhd/dummy_rtems.adb
new file mode 100644
index 0000000000..62986dc465
--- /dev/null
+++ b/testsuites/ada/tmtests/tmoverhd/dummy_rtems.adb
@@ -0,0 +1,891 @@
+--
+-- DUMMY_RTEMS / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package contains implementation of stub routines
+-- which are used to time the invocation overhead incurred
+-- with an Ada application program invokes each RTEMS directive.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2009.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+package body DUMMY_RTEMS is
+
+-- Task Manager
+
+ procedure TASK_CREATE (
+ NAME : in RTEMS.NAME;
+ INITIAL_PRIORITY : in RTEMS.TASKS.PRIORITY;
+ STACK_SIZE : in RTEMS.UNSIGNED32;
+ INITIAL_MODES : in RTEMS.MODE;
+ ATTRIBUTE_SET : in RTEMS.ATTRIBUTE;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(NAME);
+ pragma Unreferenced(INITIAL_PRIORITY);
+ pragma Unreferenced(STACK_SIZE);
+ pragma Unreferenced(INITIAL_MODES);
+ pragma Unreferenced(ATTRIBUTE_SET);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TASK_CREATE;
+
+ procedure TASK_IDENT (
+ NAME : in RTEMS.NAME;
+ NODE : in RTEMS.UNSIGNED32;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(NAME);
+ pragma Unreferenced(NODE);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TASK_IDENT;
+
+ procedure TASK_START (
+ ID : in RTEMS.ID;
+ ENTRY_POINT : in RTEMS.TASKS.ENTRY_POINT;
+ ARGUMENT : in RTEMS.UNSIGNED32;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(ENTRY_POINT);
+ pragma Unreferenced(ARGUMENT);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TASK_START;
+
+ procedure TASK_RESTART (
+ ID : in RTEMS.ID;
+ ARGUMENT : in RTEMS.UNSIGNED32;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(ARGUMENT);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TASK_RESTART;
+
+ procedure TASK_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TASK_DELETE;
+
+ procedure TASK_SUSPEND (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TASK_SUSPEND;
+
+ procedure TASK_RESUME (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TASK_RESUME;
+
+ procedure TASK_SET_PRIORITY (
+ ID : in RTEMS.ID;
+ NEW_PRIORITY : in RTEMS.TASKS.PRIORITY;
+ OLD_PRIORITY : out RTEMS.TASKS.PRIORITY;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(NEW_PRIORITY);
+ begin
+
+ OLD_PRIORITY := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TASK_SET_PRIORITY;
+
+ procedure TASK_MODE (
+ MODE_SET : in RTEMS.MODE;
+ MASK : in RTEMS.MODE;
+ PREVIOUS_MODE_SET : out RTEMS.MODE;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(MODE_SET);
+ pragma Unreferenced(MASK);
+ begin
+
+ PREVIOUS_MODE_SET := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TASK_MODE;
+
+ procedure TASK_WAKE_WHEN (
+ TIME_BUFFER : in RTEMS.TIME_OF_DAY;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(TIME_BUFFER);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TASK_WAKE_WHEN;
+
+ procedure TASK_WAKE_AFTER (
+ TICKS : in RTEMS.INTERVAL;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(TICKS);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TASK_WAKE_AFTER;
+
+-- Interrupt Manager
+
+-- procedure INTERRUPT_CATCH (
+-- NEW_ISR_HANDLER : in RTEMS.ADDRESS;
+-- VECTOR : in RTEMS.VECTOR_NUMBER;
+-- OLD_ISR_HANDLER : out RTEMS.ADDRESS;
+-- RESULT : out RTEMS.STATUS_CODES
+-- ) is
+-- begin
+--
+-- OLD_ISR_HANDLER := RTEMS.Null_Address;
+-- RESULT := RTEMS.SUCCESSFUL;
+--
+-- end INTERRUPT_CATCH;
+
+-- Clock Manager
+
+ procedure CLOCK_GET_TOD (
+ TIME_BUFFER : out RTEMS.TIME_OF_DAY;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(TIME_BUFFER);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end CLOCK_GET_TOD;
+
+ procedure CLOCK_SET (
+ TIME_BUFFER : in RTEMS.TIME_OF_DAY;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(TIME_BUFFER);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end CLOCK_SET;
+
+ procedure CLOCK_TICK (
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end CLOCK_TICK;
+
+-- Timer Manager
+
+ procedure TIMER_CREATE (
+ NAME : in RTEMS.NAME;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(NAME);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TIMER_CREATE;
+
+ procedure TIMER_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TIMER_DELETE;
+
+ procedure TIMER_IDENT (
+ NAME : in RTEMS.NAME;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(NAME);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TIMER_IDENT;
+
+ procedure TIMER_FIRE_AFTER (
+ ID : in RTEMS.ID;
+ TICKS : in RTEMS.INTERVAL;
+ ROUTINE : in RTEMS.TIMER.SERVICE_ROUTINE;
+ USER_DATA : in RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(TICKS);
+ pragma Unreferenced(ROUTINE);
+ pragma Unreferenced(USER_DATA);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TIMER_FIRE_AFTER;
+
+ procedure TIMER_FIRE_WHEN (
+ ID : in RTEMS.ID;
+ WALL_TIME : in RTEMS.TIME_OF_DAY;
+ ROUTINE : in RTEMS.TIMER.SERVICE_ROUTINE;
+ USER_DATA : in RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(WALL_TIME);
+ pragma Unreferenced(ROUTINE);
+ pragma Unreferenced(USER_DATA);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TIMER_FIRE_WHEN;
+
+ procedure TIMER_RESET (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TIMER_RESET;
+
+ procedure TIMER_CANCEL (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end TIMER_CANCEL;
+
+-- Semaphore Manager
+
+ procedure SEMAPHORE_CREATE (
+ NAME : in RTEMS.NAME;
+ COUNT : in RTEMS.UNSIGNED32;
+ ATTRIBUTE_SET : in RTEMS.ATTRIBUTE;
+ PRIORITY_CEILING : in RTEMS.TASKS.PRIORITY;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(NAME);
+ pragma Unreferenced(COUNT);
+ pragma Unreferenced(ATTRIBUTE_SET);
+ pragma Unreferenced(PRIORITY_CEILING);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end SEMAPHORE_CREATE;
+
+ procedure SEMAPHORE_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end SEMAPHORE_DELETE;
+
+ procedure SEMAPHORE_IDENT (
+ NAME : in RTEMS.NAME;
+ NODE : in RTEMS.UNSIGNED32;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(NAME);
+ pragma Unreferenced(NODE);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end SEMAPHORE_IDENT;
+
+ procedure SEMAPHORE_OBTAIN (
+ ID : in RTEMS.ID;
+ OPTION_SET : in RTEMS.OPTION;
+ TIMEOUT : in RTEMS.INTERVAL;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(OPTION_SET);
+ pragma Unreferenced(TIMEOUT);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end SEMAPHORE_OBTAIN;
+
+ procedure SEMAPHORE_RELEASE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end SEMAPHORE_RELEASE;
+
+-- Message Queue Manager
+
+ procedure MESSAGE_QUEUE_CREATE (
+ Name : in RTEMS.Name;
+ Count : in RTEMS.Unsigned32;
+ Max_Message_Size : in RTEMS.Unsigned32;
+ Attribute_Set : in RTEMS.Attribute;
+ ID : out RTEMS.ID;
+ Result : out RTEMS.Status_Codes
+ ) is
+ pragma Unreferenced(Name);
+ pragma Unreferenced(Count);
+ pragma Unreferenced(Max_Message_Size);
+ pragma Unreferenced(Attribute_Set);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end MESSAGE_QUEUE_CREATE;
+
+ procedure MESSAGE_QUEUE_IDENT (
+ NAME : in RTEMS.NAME;
+ NODE : in RTEMS.UNSIGNED32;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(NAME);
+ pragma Unreferenced(NODE);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end MESSAGE_QUEUE_IDENT;
+
+ procedure MESSAGE_QUEUE_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end MESSAGE_QUEUE_DELETE;
+
+ procedure MESSAGE_QUEUE_SEND (
+ ID : in RTEMS.ID;
+ BUFFER : in RTEMS.ADDRESS;
+ Size : in RTEMS.Unsigned32;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(BUFFER);
+ pragma Unreferenced(Size);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end MESSAGE_QUEUE_SEND;
+
+ procedure MESSAGE_QUEUE_URGENT (
+ ID : in RTEMS.ID;
+ BUFFER : in RTEMS.ADDRESS;
+ Size : in RTEMS.Unsigned32;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(BUFFER);
+ pragma Unreferenced(Size);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end MESSAGE_QUEUE_URGENT;
+
+ procedure MESSAGE_QUEUE_BROADCAST (
+ ID : in RTEMS.ID;
+ BUFFER : in RTEMS.ADDRESS;
+ Size : in RTEMS.Unsigned32;
+ COUNT : out RTEMS.UNSIGNED32;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(BUFFER);
+ pragma Unreferenced(Size);
+ begin
+
+ COUNT := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end MESSAGE_QUEUE_BROADCAST;
+
+ procedure MESSAGE_QUEUE_RECEIVE (
+ ID : in RTEMS.ID;
+ BUFFER : in RTEMS.ADDRESS;
+ OPTION_SET : in RTEMS.OPTION;
+ TIMEOUT : in RTEMS.INTERVAL;
+ Size : out RTEMS.Unsigned32;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(BUFFER);
+ pragma Unreferenced(OPTION_SET);
+ pragma Unreferenced(TIMEOUT);
+ begin
+
+ Size := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end MESSAGE_QUEUE_RECEIVE;
+
+ procedure MESSAGE_QUEUE_FLUSH (
+ ID : in RTEMS.ID;
+ COUNT : out RTEMS.UNSIGNED32;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ COUNT := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end MESSAGE_QUEUE_FLUSH;
+
+-- Event Manager
+
+ procedure EVENT_SEND (
+ ID : in RTEMS.ID;
+ EVENT_IN : in RTEMS.EVENT_SET;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(EVENT_IN);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end EVENT_SEND;
+
+ procedure EVENT_RECEIVE (
+ EVENT_IN : in RTEMS.EVENT_SET;
+ OPTION_SET : in RTEMS.OPTION;
+ TICKS : in RTEMS.INTERVAL;
+ EVENT_OUT : out RTEMS.EVENT_SET;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(EVENT_IN);
+ pragma Unreferenced(OPTION_SET);
+ pragma Unreferenced(TICKS);
+ begin
+
+ EVENT_OUT := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end EVENT_RECEIVE;
+
+-- Signal Manager
+
+ procedure SIGNAL_CATCH (
+ ASR_HANDLER : in RTEMS.ASR_HANDLER;
+ MODE_SET : in RTEMS.MODE;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ASR_HANDLER);
+ pragma Unreferenced(MODE_SET);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end SIGNAL_CATCH;
+
+ procedure SIGNAL_SEND (
+ ID : in RTEMS.ID;
+ SIGNAL_SET : in RTEMS.SIGNAL_SET;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(SIGNAL_SET);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end SIGNAL_SEND;
+
+-- Partition Manager
+
+ procedure PARTITION_CREATE (
+ NAME : in RTEMS.NAME;
+ STARTING_ADDRESS : in RTEMS.ADDRESS;
+ LENGTH : in RTEMS.UNSIGNED32;
+ BUFFER_SIZE : in RTEMS.UNSIGNED32;
+ ATTRIBUTE_SET : in RTEMS.ATTRIBUTE;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(NAME);
+ pragma Unreferenced(STARTING_ADDRESS);
+ pragma Unreferenced(LENGTH);
+ pragma Unreferenced(BUFFER_SIZE);
+ pragma Unreferenced(ATTRIBUTE_SET);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end PARTITION_CREATE;
+
+ procedure PARTITION_IDENT (
+ NAME : in RTEMS.NAME;
+ NODE : in RTEMS.UNSIGNED32;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(NAME);
+ pragma Unreferenced(NODE);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end PARTITION_IDENT;
+
+ procedure PARTITION_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end PARTITION_DELETE;
+
+ procedure PARTITION_GET_BUFFER (
+ ID : in RTEMS.ID;
+ BUFFER : out RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ BUFFER := RTEMS.Null_Address;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end PARTITION_GET_BUFFER;
+
+ procedure PARTITION_RETURN_BUFFER (
+ ID : in RTEMS.ID;
+ BUFFER : in RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(BUFFER);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end PARTITION_RETURN_BUFFER;
+
+-- Region Manager
+
+ procedure REGION_CREATE (
+ NAME : in RTEMS.NAME;
+ STARTING_ADDRESS : in RTEMS.ADDRESS;
+ LENGTH : in RTEMS.UNSIGNED32;
+ PAGE_SIZE : in RTEMS.UNSIGNED32;
+ ATTRIBUTE_SET : in RTEMS.ATTRIBUTE;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(NAME);
+ pragma Unreferenced(STARTING_ADDRESS);
+ pragma Unreferenced(LENGTH);
+ pragma Unreferenced(PAGE_SIZE);
+ pragma Unreferenced(ATTRIBUTE_SET);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end REGION_CREATE;
+
+ procedure REGION_IDENT (
+ NAME : in RTEMS.NAME;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(NAME);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end REGION_IDENT;
+
+ procedure REGION_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end REGION_DELETE;
+
+ procedure REGION_GET_SEGMENT (
+ ID : in RTEMS.ID;
+ SIZE : in RTEMS.UNSIGNED32;
+ OPTION_SET : in RTEMS.OPTION;
+ TIMEOUT : in RTEMS.INTERVAL;
+ SEGMENT : out RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(SIZE);
+ pragma Unreferenced(OPTION_SET);
+ pragma Unreferenced(TIMEOUT);
+ begin
+
+ SEGMENT := RTEMS.Null_Address;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end REGION_GET_SEGMENT;
+
+ procedure REGION_RETURN_SEGMENT (
+ ID : in RTEMS.ID;
+ SEGMENT : in RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(SEGMENT);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end REGION_RETURN_SEGMENT;
+
+-- Dual Ported Memory Manager
+
+ procedure PORT_CREATE (
+ NAME : in RTEMS.NAME;
+ INTERNAL_START : in RTEMS.ADDRESS;
+ EXTERNAL_START : in RTEMS.ADDRESS;
+ LENGTH : in RTEMS.UNSIGNED32;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(NAME);
+ pragma Unreferenced(INTERNAL_START);
+ pragma Unreferenced(EXTERNAL_START);
+ pragma Unreferenced(LENGTH);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end PORT_CREATE;
+
+ procedure PORT_IDENT (
+ NAME : in RTEMS.NAME;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(NAME);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end PORT_IDENT;
+
+ procedure PORT_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end PORT_DELETE;
+
+ procedure PORT_EXTERNAL_TO_INTERNAL (
+ ID : in RTEMS.ID;
+ EXTERNAL : in RTEMS.ADDRESS;
+ INTERNAL : out RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(EXTERNAL);
+ begin
+
+ INTERNAL := RTEMS.Null_Address;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end PORT_EXTERNAL_TO_INTERNAL;
+
+ procedure PORT_INTERNAL_TO_EXTERNAL (
+ ID : in RTEMS.ID;
+ INTERNAL : in RTEMS.ADDRESS;
+ EXTERNAL : out RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(INTERNAL);
+ begin
+
+ EXTERNAL := RTEMS.Null_Address;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end PORT_INTERNAL_TO_EXTERNAL;
+
+-- Fatal Error Manager
+
+ procedure FATAL_ERROR_OCCURRED (
+ THE_ERROR : in RTEMS.UNSIGNED32
+ ) is
+ pragma Unreferenced(THE_ERROR);
+ begin
+
+ NULL;
+
+ end FATAL_ERROR_OCCURRED;
+
+-- Rate Monotonic Manager
+
+ procedure RATE_MONOTONIC_CREATE (
+ NAME : in RTEMS.NAME;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(NAME);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end RATE_MONOTONIC_CREATE;
+
+ procedure RATE_MONOTONIC_IDENT (
+ NAME : in RTEMS.NAME;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(NAME);
+ begin
+
+ ID := 0;
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end RATE_MONOTONIC_IDENT;
+
+ procedure RATE_MONOTONIC_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end RATE_MONOTONIC_DELETE;
+
+ procedure RATE_MONOTONIC_CANCEL (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end RATE_MONOTONIC_CANCEL;
+
+ procedure RATE_MONOTONIC_PERIOD (
+ ID : in RTEMS.ID;
+ LENGTH : in RTEMS.INTERVAL;
+ RESULT : out RTEMS.STATUS_CODES
+ ) is
+ pragma Unreferenced(ID);
+ pragma Unreferenced(LENGTH);
+ begin
+
+ RESULT := RTEMS.SUCCESSFUL;
+
+ end RATE_MONOTONIC_PERIOD;
+
+-- Multiprocessing Manager
+
+ procedure MULTIPROCESSING_ANNOUNCE
+ is
+ begin
+
+ NULL;
+
+ end MULTIPROCESSING_ANNOUNCE;
+
+end DUMMY_RTEMS;
diff --git a/testsuites/ada/tmtests/tmoverhd/dummy_rtems.ads b/testsuites/ada/tmtests/tmoverhd/dummy_rtems.ads
new file mode 100644
index 0000000000..ea4f129893
--- /dev/null
+++ b/testsuites/ada/tmtests/tmoverhd/dummy_rtems.ads
@@ -0,0 +1,445 @@
+--
+-- DUMMY_RTEMS / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package contains specifications for stub routines
+-- which are used to time the invocation overhead incurred
+-- with an Ada application program invokes each RTEMS directive.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2007.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.CLOCK;
+with RTEMS.TASKS;
+with RTEMS.TIMER;
+
+package DUMMY_RTEMS is
+
+-- Task Manager
+
+ procedure TASK_CREATE (
+ NAME : in RTEMS.NAME;
+ INITIAL_PRIORITY : in RTEMS.TASKS.PRIORITY;
+ STACK_SIZE : in RTEMS.UNSIGNED32;
+ INITIAL_MODES : in RTEMS.MODE;
+ ATTRIBUTE_SET : in RTEMS.ATTRIBUTE;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TASK_IDENT (
+ NAME : in RTEMS.NAME;
+ NODE : in RTEMS.UNSIGNED32;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TASK_START (
+ ID : in RTEMS.ID;
+ ENTRY_POINT : in RTEMS.TASKS.ENTRY_POINT;
+ ARGUMENT : in RTEMS.UNSIGNED32;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TASK_RESTART (
+ ID : in RTEMS.ID;
+ ARGUMENT : in RTEMS.UNSIGNED32;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TASK_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TASK_SUSPEND (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TASK_RESUME (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TASK_SET_PRIORITY (
+ ID : in RTEMS.ID;
+ NEW_PRIORITY : in RTEMS.TASKS.PRIORITY;
+ OLD_PRIORITY : out RTEMS.TASKS.PRIORITY;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TASK_MODE (
+ MODE_SET : in RTEMS.MODE;
+ MASK : in RTEMS.MODE;
+ PREVIOUS_MODE_SET : out RTEMS.MODE;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TASK_WAKE_WHEN (
+ TIME_BUFFER : in RTEMS.TIME_OF_DAY;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TASK_WAKE_AFTER (
+ TICKS : in RTEMS.INTERVAL;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+-- Interrupt Manager
+
+-- procedure INTERRUPT_CATCH (
+-- NEW_ISR_HANDLER : in RTEMS.ADDRESS;
+-- VECTOR : in RTEMS.VECTOR_NUMBER;
+-- OLD_ISR_HANDLER : out RTEMS.ADDRESS;
+-- RESULT : out RTEMS.STATUS_CODES
+-- );
+
+-- Clock Manager
+
+ procedure CLOCK_GET_TOD (
+ TIME_BUFFER : out RTEMS.TIME_OF_DAY;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure CLOCK_SET (
+ TIME_BUFFER : in RTEMS.TIME_OF_DAY;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure CLOCK_TICK (
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+-- Timer Manager
+
+ procedure TIMER_CREATE (
+ NAME : in RTEMS.NAME;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TIMER_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TIMER_IDENT (
+ NAME : in RTEMS.NAME;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TIMER_FIRE_AFTER (
+ ID : in RTEMS.ID;
+ TICKS : in RTEMS.INTERVAL;
+ ROUTINE : in RTEMS.TIMER.SERVICE_ROUTINE;
+ USER_DATA : in RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TIMER_FIRE_WHEN (
+ ID : in RTEMS.ID;
+ WALL_TIME : in RTEMS.TIME_OF_DAY;
+ ROUTINE : in RTEMS.TIMER.SERVICE_ROUTINE;
+ USER_DATA : in RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TIMER_RESET (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure TIMER_CANCEL (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+-- Semaphore Manager
+
+ procedure SEMAPHORE_CREATE (
+ NAME : in RTEMS.NAME;
+ COUNT : in RTEMS.UNSIGNED32;
+ ATTRIBUTE_SET : in RTEMS.ATTRIBUTE;
+ PRIORITY_CEILING : in RTEMS.TASKS.PRIORITY;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure SEMAPHORE_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure SEMAPHORE_IDENT (
+ NAME : in RTEMS.NAME;
+ NODE : in RTEMS.UNSIGNED32;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure SEMAPHORE_OBTAIN (
+ ID : in RTEMS.ID;
+ OPTION_SET : in RTEMS.OPTION;
+ TIMEOUT : in RTEMS.INTERVAL;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure SEMAPHORE_RELEASE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+-- Message Queue Manager
+
+ procedure MESSAGE_QUEUE_CREATE (
+ Name : in RTEMS.Name;
+ Count : in RTEMS.Unsigned32;
+ Max_Message_Size : in RTEMS.Unsigned32;
+ Attribute_Set : in RTEMS.Attribute;
+ ID : out RTEMS.ID;
+ Result : out RTEMS.Status_Codes
+ );
+
+ procedure MESSAGE_QUEUE_IDENT (
+ NAME : in RTEMS.NAME;
+ NODE : in RTEMS.UNSIGNED32;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure MESSAGE_QUEUE_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure MESSAGE_QUEUE_SEND (
+ ID : in RTEMS.ID;
+ BUFFER : in RTEMS.ADDRESS;
+ SIZE : in RTEMS.UNSIGNED32;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure MESSAGE_QUEUE_URGENT (
+ ID : in RTEMS.ID;
+ BUFFER : in RTEMS.ADDRESS;
+ SIZE : in RTEMS.UNSIGNED32;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure MESSAGE_QUEUE_BROADCAST (
+ ID : in RTEMS.ID;
+ BUFFER : in RTEMS.ADDRESS;
+ SIZE : in RTEMS.UNSIGNED32;
+ COUNT : out RTEMS.UNSIGNED32;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure MESSAGE_QUEUE_RECEIVE (
+ ID : in RTEMS.ID;
+ BUFFER : in RTEMS.ADDRESS;
+ OPTION_SET : in RTEMS.OPTION;
+ TIMEOUT : in RTEMS.INTERVAL;
+ SIZE : out RTEMS.UNSIGNED32;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure MESSAGE_QUEUE_FLUSH (
+ ID : in RTEMS.ID;
+ COUNT : out RTEMS.UNSIGNED32;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+-- Event Manager
+
+ procedure EVENT_SEND (
+ ID : in RTEMS.ID;
+ EVENT_IN : in RTEMS.EVENT_SET;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure EVENT_RECEIVE (
+ EVENT_IN : in RTEMS.EVENT_SET;
+ OPTION_SET : in RTEMS.OPTION;
+ TICKS : in RTEMS.INTERVAL;
+ EVENT_OUT : out RTEMS.EVENT_SET;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+-- Signal Manager
+
+ procedure SIGNAL_CATCH (
+ ASR_HANDLER : in RTEMS.ASR_HANDLER;
+ MODE_SET : in RTEMS.MODE;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure SIGNAL_SEND (
+ ID : in RTEMS.ID;
+ SIGNAL_SET : in RTEMS.SIGNAL_SET;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+-- Partition Manager
+
+ procedure PARTITION_CREATE (
+ NAME : in RTEMS.NAME;
+ STARTING_ADDRESS : in RTEMS.ADDRESS;
+ LENGTH : in RTEMS.UNSIGNED32;
+ BUFFER_SIZE : in RTEMS.UNSIGNED32;
+ ATTRIBUTE_SET : in RTEMS.ATTRIBUTE;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure PARTITION_IDENT (
+ NAME : in RTEMS.NAME;
+ NODE : in RTEMS.UNSIGNED32;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure PARTITION_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure PARTITION_GET_BUFFER (
+ ID : in RTEMS.ID;
+ BUFFER : out RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure PARTITION_RETURN_BUFFER (
+ ID : in RTEMS.ID;
+ BUFFER : in RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+-- Region Manager
+
+ procedure REGION_CREATE (
+ NAME : in RTEMS.NAME;
+ STARTING_ADDRESS : in RTEMS.ADDRESS;
+ LENGTH : in RTEMS.UNSIGNED32;
+ PAGE_SIZE : in RTEMS.UNSIGNED32;
+ ATTRIBUTE_SET : in RTEMS.ATTRIBUTE;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure REGION_IDENT (
+ NAME : in RTEMS.NAME;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure REGION_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure REGION_GET_SEGMENT (
+ ID : in RTEMS.ID;
+ SIZE : in RTEMS.UNSIGNED32;
+ OPTION_SET : in RTEMS.OPTION;
+ TIMEOUT : in RTEMS.INTERVAL;
+ SEGMENT : out RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure REGION_RETURN_SEGMENT (
+ ID : in RTEMS.ID;
+ SEGMENT : in RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+-- Dual Ported Memory Manager
+
+ procedure PORT_CREATE (
+ NAME : in RTEMS.NAME;
+ INTERNAL_START : in RTEMS.ADDRESS;
+ EXTERNAL_START : in RTEMS.ADDRESS;
+ LENGTH : in RTEMS.UNSIGNED32;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure PORT_IDENT (
+ NAME : in RTEMS.NAME;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure PORT_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure PORT_EXTERNAL_TO_INTERNAL (
+ ID : in RTEMS.ID;
+ EXTERNAL : in RTEMS.ADDRESS;
+ INTERNAL : out RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure PORT_INTERNAL_TO_EXTERNAL (
+ ID : in RTEMS.ID;
+ INTERNAL : in RTEMS.ADDRESS;
+ EXTERNAL : out RTEMS.ADDRESS;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+-- Fatal Error Manager
+
+ procedure FATAL_ERROR_OCCURRED (
+ THE_ERROR : in RTEMS.UNSIGNED32
+ );
+
+-- Rate Monotonic Manager
+
+ procedure RATE_MONOTONIC_CREATE (
+ NAME : in RTEMS.NAME;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure RATE_MONOTONIC_IDENT (
+ NAME : in RTEMS.NAME;
+ ID : out RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure RATE_MONOTONIC_DELETE (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure RATE_MONOTONIC_CANCEL (
+ ID : in RTEMS.ID;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+ procedure RATE_MONOTONIC_PERIOD (
+ ID : in RTEMS.ID;
+ LENGTH : in RTEMS.INTERVAL;
+ RESULT : out RTEMS.STATUS_CODES
+ );
+
+-- Multiprocessing Manager
+
+ procedure MULTIPROCESSING_ANNOUNCE;
+
+end DUMMY_RTEMS;
diff --git a/testsuites/ada/tmtests/tmoverhd/tmoverhd.adb b/testsuites/ada/tmtests/tmoverhd/tmoverhd.adb
new file mode 100644
index 0000000000..bfe6de4f88
--- /dev/null
+++ b/testsuites/ada/tmtests/tmoverhd/tmoverhd.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test TMOVERHD of the Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-1997.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with TMTEST;
+with TEST_SUPPORT;
+
+procedure TMOVERHD is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ TMTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end TMOVERHD;
+
diff --git a/testsuites/ada/tmtests/tmoverhd/tmtest.adb b/testsuites/ada/tmtests/tmoverhd/tmtest.adb
new file mode 100644
index 0000000000..58c5ad09c6
--- /dev/null
+++ b/testsuites/ada/tmtests/tmoverhd/tmtest.adb
@@ -0,0 +1,1363 @@
+--
+-- TMTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Calling Overhead Test of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2009.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with DUMMY_RTEMS;
+with TEST_SUPPORT;
+with TEXT_IO;
+with TIME_TEST_SUPPORT;
+with TIMER_DRIVER;
+
+package body TMTEST is
+
+--PAGE
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TIME TEST OVERHEAD ***" );
+
+ TIMER_DRIVER.SET_FIND_AVERAGE_OVERHEAD( TRUE );
+
+ TMTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
+
+ RTEMS.TASKS.CREATE(
+ TMTEST.TASK_NAME( 1 ),
+ 254,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ TMTEST.TASK_ID( 1 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
+
+ RTEMS.TASKS.START(
+ TMTEST.TASK_ID( 1 ),
+ TMTEST.TASK_1'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--PAGE
+--
+-- TIMER_HANDLER
+--
+
+ procedure TIMER_HANDLER (
+ IGNORED_ID : in RTEMS.ID;
+ IGNORED_ADDRESS : in RTEMS.ADDRESS
+ ) is
+ begin
+
+ NULL;
+
+ end TIMER_HANDLER;
+
+--PAGE
+--
+-- ISR_HANDLER
+--
+
+-- procedure ISR_HANDLER (
+-- VECTOR : in RTEMS.VECTOR_NUMBER
+-- ) is
+-- begin
+--
+-- NULL;
+--
+-- end ISR_HANDLER;
+
+--PAGE
+--
+-- ASR_HANDLER
+--
+
+ procedure ASR_HANDLER (
+ SIGNALS : in RTEMS.SIGNAL_SET
+ ) is
+ begin
+
+ NULL;
+
+ end ASR_HANDLER;
+
+--PAGE
+--
+-- TASK_1
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ NAME : RTEMS.NAME;
+ OVERHEAD : RTEMS.UNSIGNED32;
+ ID : RTEMS.ID;
+ IN_PRIORITY : RTEMS.TASKS.PRIORITY;
+ OUT_PRIORITY : RTEMS.TASKS.PRIORITY;
+ IN_MODE : RTEMS.MODE;
+ MASK : RTEMS.MODE;
+ OUT_MODE : RTEMS.MODE;
+ TIME : RTEMS.TIME_OF_DAY;
+ TIMEOUT : RTEMS.INTERVAL;
+ SIGNALS : RTEMS.SIGNAL_SET;
+ ADDRESS_1 : RTEMS.ADDRESS;
+ EVENTS : RTEMS.SIGNAL_SET;
+ BUFFER : TMTEST.BUFFER;
+ BUFFER_POINTER : RTEMS.ADDRESS;
+ MESSAGE_SIZE : RTEMS.UNSIGNED32;
+ COUNT : RTEMS.UNSIGNED32;
+ ERROR : RTEMS.UNSIGNED32;
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ NAME := RTEMS.BUILD_NAME( 'N', 'A', 'M', 'E' );
+
+ BUFFER_POINTER := BUFFER'ADDRESS;
+ OVERHEAD := 0;
+ IN_PRIORITY := 0;
+ IN_MODE := 0;
+ MASK := 0;
+ SIGNALS := 0;
+ EVENTS := 0;
+ ERROR := 0;
+
+-- TASK_CREATE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TASK_CREATE(
+ NAME,
+ IN_PRIORITY,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_CREATE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TASK_IDENT
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TASK_IDENT(
+ NAME,
+ RTEMS.SEARCH_ALL_NODES,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TASK_START
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TASK_START( ID, TMTEST.TASK_1'ACCESS, 0, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_START",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TASK_RESTART
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TASK_RESTART( ID, 0, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_RESTART",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TASK_DELETE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TASK_DELETE( ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_DELETE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TASK_SUSPEND
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TASK_SUSPEND( ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_SUSPEND",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TASK_RESUME
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TASK_RESUME( ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_RESUME",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TASK_SET_PRIORITY
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TASK_SET_PRIORITY(
+ ID,
+ IN_PRIORITY,
+ OUT_PRIORITY,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_SET_PRIORITY",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TASK_MODE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TASK_MODE(
+ IN_MODE,
+ MASK,
+ OUT_MODE,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_MODE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TASK_WAKE_WHEN
+
+ TIME.YEAR := 2000;
+ TIME.MONTH := 12;
+ TIME.DAY := 25;
+ TIME.HOUR := 6;
+ TIME.MINUTE := 1;
+ TIME.SECOND := 2;
+ TIME.TICKS := 0;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TASK_WAKE_WHEN( TIME, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_WAKE_WHEN",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TASK_WAKE_AFTER
+
+ TIMEOUT := 1;
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TASK_WAKE_AFTER( TIMEOUT, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TASK_WAKE_AFTER",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- INTERRUPT_CATCH
+
+-- TIMER_DRIVER.INITIALIZE;
+-- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+-- loop
+-- DUMMY_RTEMS.INTERRUPT_CATCH(
+-- TMTEST.ISR_HANDLER'ADDRESS,
+-- RTEMS.VECTOR_NUMBER'FIRST,
+-- ADDRESS_1,
+-- STATUS
+-- );
+-- end loop;
+-- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+--
+-- TIME_TEST_SUPPORT.PUT_TIME(
+-- "INTERRUPT_CATCH",
+-- TMTEST.END_TIME,
+-- TIME_TEST_SUPPORT.OPERATION_COUNT,
+-- OVERHEAD,
+-- 0
+-- );
+
+-- CLOCK_GET_TOD
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.CLOCK_GET_TOD( TIME, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "CLOCK_GET",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- CLOCK_SET
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.CLOCK_SET( TIME, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "CLOCK_SET",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- CLOCK_TICK
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.CLOCK_TICK( STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "CLOCK_TICK",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+TEST_SUPPORT.PAUSE;
+
+-- TIMER_CREATE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TIMER_CREATE( NAME, ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_CREATE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TIMER_DELETE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TIMER_DELETE( ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_DELETE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TIMER_IDENT
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TIMER_IDENT(
+ NAME,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TIMER_FIRE_AFTER
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TIMER_FIRE_AFTER(
+ ID,
+ TIMEOUT,
+ TMTEST.TIMER_HANDLER'ACCESS,
+ RTEMS.NULL_ADDRESS,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_FIRE_AFTER",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TIMER_FIRE_WHEN
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TIMER_FIRE_WHEN(
+ ID,
+ TIME,
+ TMTEST.TIMER_HANDLER'ACCESS,
+ RTEMS.NULL_ADDRESS,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_FIRE_WHEN",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TIMER_RESET
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TIMER_RESET( ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_RESET",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- TIMER_CANCEL
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.TIMER_CANCEL( ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "TIMER_CANCEL",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- SEMAPHORE_CREATE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.SEMAPHORE_CREATE(
+ NAME,
+ 128,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ RTEMS.TASKS.NO_PRIORITY,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SEMAPHORE_CREATE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- SEMAPHORE_DELETE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.SEMAPHORE_DELETE( ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SEMAPHORE_DELETE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- SEMAPHORE_IDENT
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.SEMAPHORE_IDENT(
+ NAME,
+ RTEMS.SEARCH_ALL_NODES,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SEMAPHORE_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- SEMAPHORE_OBTAIN
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.SEMAPHORE_OBTAIN(
+ ID,
+ RTEMS.DEFAULT_OPTIONS,
+ TIMEOUT,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SEMAPHORE_OBTAIN",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- SEMAPHORE_RELEASE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.SEMAPHORE_RELEASE( ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SEMAPHORE_RELEASE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- MESSAGE_QUEUE_CREATE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.MESSAGE_QUEUE_CREATE(
+ NAME,
+ 128,
+ 16,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_CREATE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- MESSAGE_QUEUE_IDENT
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.MESSAGE_QUEUE_IDENT(
+ NAME,
+ RTEMS.SEARCH_ALL_NODES,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- MESSAGE_QUEUE_DELETE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.MESSAGE_QUEUE_DELETE( ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_DELETE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- MESSAGE_QUEUE_SEND
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.MESSAGE_QUEUE_SEND( ID, BUFFER_POINTER, 16, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_SEND",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- MESSAGE_QUEUE_URGENT
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.MESSAGE_QUEUE_URGENT( ID, BUFFER_POINTER, 16, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_URGENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- MESSAGE_QUEUE_BROADCAST
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.MESSAGE_QUEUE_BROADCAST(
+ ID,
+ BUFFER_POINTER,
+ 16,
+ COUNT,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_BROADCAST",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- MESSAGE_QUEUE_RECEIVE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.MESSAGE_QUEUE_RECEIVE(
+ ID,
+ BUFFER_POINTER,
+ RTEMS.DEFAULT_OPTIONS,
+ TIMEOUT,
+ MESSAGE_SIZE,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_RECEIVE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- MESSAGE_QUEUE_FLUSH
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.MESSAGE_QUEUE_FLUSH( ID, COUNT, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MESSAGE_QUEUE_FLUSH",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+TEST_SUPPORT.PAUSE;
+
+-- EVENT_SEND
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.EVENT_SEND( ID, EVENTS, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "EVENT_SEND",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- EVENT_RECEIVE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.EVENT_RECEIVE(
+ RTEMS.EVENT_16,
+ EVENTS,
+ RTEMS.DEFAULT_OPTIONS,
+ TIMEOUT,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "EVENT_RECEIVE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- SIGNAL_CATCH
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.SIGNAL_CATCH(
+ TMTEST.ASR_HANDLER'ACCESS,
+ RTEMS.DEFAULT_MODES,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SIGNAL_CATCH",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- SIGNAL_SEND
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.SIGNAL_SEND( ID, SIGNALS, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "SIGNAL_SEND",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- PARTITION_CREATE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.PARTITION_CREATE(
+ NAME,
+ TMTEST.MEMORY_AREA'ADDRESS,
+ 2048,
+ 128,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PARTITION_CREATE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- PARTITION_IDENT
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.PARTITION_IDENT(
+ NAME,
+ RTEMS.SEARCH_ALL_NODES,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PARTITION_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- PARTITION_DELETE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.PARTITION_DELETE( ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PARTITION_DELETE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- PARTITION_GET_BUFFER
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.PARTITION_GET_BUFFER( ID, ADDRESS_1, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PARTITION_GET_BUFFER",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- PARTITION_RETURN_BUFFER
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.PARTITION_RETURN_BUFFER( ID, ADDRESS_1, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PARTITION_RETURN_BUFFER",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- REGION_CREATE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.REGION_CREATE(
+ NAME,
+ TMTEST.MEMORY_AREA'ADDRESS,
+ 2048,
+ 128,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "REGION_CREATE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- REGION_IDENT
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.REGION_IDENT(
+ NAME,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "REGION_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- REGION_DELETE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.REGION_DELETE( ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "REGION_DELETE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- REGION_GET_SEGMENT
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.REGION_GET_SEGMENT(
+ ID,
+ 243,
+ RTEMS.DEFAULT_OPTIONS,
+ TIMEOUT,
+ ADDRESS_1,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "REGION_GET_SEGMENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- REGION_RETURN_SEGMENT
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.REGION_RETURN_SEGMENT( ID, ADDRESS_1, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "REGION_RETURN_SEGMENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- PORT_CREATE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.PORT_CREATE(
+ NAME,
+ TMTEST.INTERNAL_PORT_AREA'ADDRESS,
+ TMTEST.EXTERNAL_PORT_AREA'ADDRESS,
+ TMTEST.INTERNAL_PORT_AREA'LENGTH,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PORT_CREATE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- PORT_IDENT
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.PORT_IDENT( NAME, ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PORT_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- PORT_DELETE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.PORT_DELETE( ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PORT_DELETE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- PORT_EXTERNAL_TO_INTERNAL
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.PORT_EXTERNAL_TO_INTERNAL(
+ ID,
+ TMTEST.EXTERNAL_PORT_AREA( 7 )'ADDRESS,
+ ADDRESS_1,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PORT_EXTERNAL_TO_INTERNAL",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- PORT_INTERNAL_TO_EXTERNAL
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.PORT_INTERNAL_TO_EXTERNAL(
+ ID,
+ TMTEST.INTERNAL_PORT_AREA( 7 )'ADDRESS,
+ ADDRESS_1,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "PORT_INTERNAL_TO_EXTERNAL",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+TEST_SUPPORT.PAUSE;
+
+-- FATAL_ERROR_OCCURRED
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.FATAL_ERROR_OCCURRED( ERROR );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "FATAL_ERROR_OCCURRED",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- RATE_MONOTONIC_CREATE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.RATE_MONOTONIC_CREATE( NAME, ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "RATE_MONOTONIC_CREATE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- RATE_MONOTONIC_IDENT
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.RATE_MONOTONIC_IDENT(
+ NAME,
+ ID,
+ STATUS
+ );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "RATE_MONOTONIC_IDENT",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- RATE_MONOTONIC_DELETE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.RATE_MONOTONIC_DELETE( ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "RATE_MONOTONIC_DELETE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- RATE_MONOTONIC_CANCEL
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.RATE_MONOTONIC_CANCEL( ID, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "RATE_MONOTONIC_CANCEL",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- RATE_MONOTONIC_PERIOD
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.RATE_MONOTONIC_PERIOD( ID, TIMEOUT, STATUS );
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "RATE_MONOTONIC_PERIOD",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+-- MULTIPROCESSING_ANNOUNCE
+
+ TIMER_DRIVER.INITIALIZE;
+ for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
+ loop
+ DUMMY_RTEMS.MULTIPROCESSING_ANNOUNCE;
+ end loop;
+ TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
+
+ TIME_TEST_SUPPORT.PUT_TIME(
+ "MULTIPROCESSING_ANNOUNCE",
+ TMTEST.END_TIME,
+ TIME_TEST_SUPPORT.OPERATION_COUNT,
+ OVERHEAD,
+ 0
+ );
+
+ TEXT_IO.PUT_LINE( "*** END OF TIME TEST OVERHEAD ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+
+ end TASK_1;
+
+end TMTEST;
diff --git a/testsuites/ada/tmtests/tmoverhd/tmtest.ads b/testsuites/ada/tmtests/tmoverhd/tmtest.ads
new file mode 100644
index 0000000000..48944077de
--- /dev/null
+++ b/testsuites/ada/tmtests/tmoverhd/tmtest.ads
@@ -0,0 +1,156 @@
+--
+-- TMTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Calling Overhead Test of the RTEMS
+-- Timing Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2009.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with SYSTEM;
+with System.Storage_Elements;
+
+package TMTEST is
+
+--
+-- Buffer Record similar to that used by RTEMS 3.2.1. Using this
+-- avoids changes to the test.
+--
+
+ type BUFFER is
+ record
+ FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
+ FIELD2 : RTEMS.UNSIGNED32;
+ FIELD3 : RTEMS.UNSIGNED32;
+ FIELD4 : RTEMS.UNSIGNED32;
+ end record;
+
+--
+-- These arrays contain the IDs and NAMEs of all RTEMS tasks created
+-- by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
+ TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
+
+--
+-- The following variable is set to the execution time returned
+-- by the timer.
+--
+
+ END_TIME : RTEMS.UNSIGNED32;
+
+--
+-- The following area defines a memory area to be used as the
+-- internal address space of the port.
+--
+
+ INTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
+ System.Storage_Elements.To_Address(16#00001000#);
+
+ INTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
+ of RTEMS.UNSIGNED8;
+ for INTERNAL_PORT_AREA'Address use INTERNAL_PORT_AREA_ADDRESS;
+
+--
+-- The following area defines a memory area to be used as the
+-- external address space of the port.
+--
+
+ EXTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
+ System.Storage_Elements.To_Address(16#00002000#);
+
+ EXTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
+ of RTEMS.UNSIGNED8;
+ for EXTERNAL_PORT_AREA'Address use EXTERNAL_PORT_AREA_ADDRESS;
+
+
+--
+-- The following area defines a memory area to be used as the
+-- memory space for a partition and later for a region.
+--
+
+ MEMORY_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 ) of RTEMS.UNSIGNED8;
+ for MEMORY_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- TIMER_HANDLER
+--
+-- DESCRIPTION:
+--
+-- This subprogram is a timer service routine.
+--
+
+ procedure TIMER_HANDLER (
+ IGNORED_ID : in RTEMS.ID;
+ IGNORED_ADDRESS : in RTEMS.ADDRESS
+ );
+ pragma Convention (C, TIMER_HANDLER);
+
+--
+-- ISR_HANDLER
+--
+-- DESCRIPTION:
+--
+-- This subprogram is an interrupt service routine.
+--
+
+-- procedure ISR_HANDLER (
+-- VECTOR : in RTEMS.VECTOR_NUMBER
+-- );
+
+--
+-- ASR_HANDLER
+--
+-- DESCRIPTION:
+--
+-- This subprogram is an asynchronous signal routine.
+--
+
+ procedure ASR_HANDLER (
+ SIGNALS : in RTEMS.SIGNAL_SET
+ );
+ pragma Convention (C, ASR_HANDLER);
+
+--
+-- TASK_1
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task is responsible for measuring and
+-- reporting the calling overhead for all RTEMS
+-- directives.
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TASK_1);
+
+end TMTEST;