summaryrefslogtreecommitdiffstats
path: root/testsuites/ada/tmtests/tm28
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/ada/tmtests/tm28')
-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
5 files changed, 376 insertions, 0 deletions
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;