summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1997-06-03 22:49:47 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1997-06-03 22:49:47 +0000
commit5d0f4a56d1018a86a062a31782ca677f47803214 (patch)
tree800425b853abb02dce499458c5cc492fc075d652 /c
parentnew file. (diff)
downloadrtems-5d0f4a56d1018a86a062a31782ca677f47803214.tar.bz2
new files
Diffstat (limited to 'c')
-rw-r--r--c/src/ada-tests/support/rtems_calling_overhead.ads105
-rw-r--r--c/src/ada-tests/support/time_test_support.adb77
-rw-r--r--c/src/ada-tests/support/time_test_support.ads54
-rw-r--r--c/src/ada-tests/support/timer_driver.adb45
-rw-r--r--c/src/ada-tests/support/timer_driver.ads81
5 files changed, 362 insertions, 0 deletions
diff --git a/c/src/ada-tests/support/rtems_calling_overhead.ads b/c/src/ada-tests/support/rtems_calling_overhead.ads
new file mode 100644
index 0000000000..31bea79ef0
--- /dev/null
+++ b/c/src/ada-tests/support/rtems_calling_overhead.ads
@@ -0,0 +1,105 @@
+--
+-- RTEMS_CALLING_OVERHEAD / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package contains the invocation overhead for each
+-- of the RTEMS directives on the MC68020 Timing Platform.
+-- This time is then subtracted from the execution time
+-- of each directive as measured by the Timing Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-1997.
+-- On-Line Applications Research Corporation (OAR).
+-- Copyright assigned to U.S. Government, 1994.
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.OARcorp.com/rtems/license.html.
+--
+-- $Id$
+--
+
+with RTEMS;
+
+package RTEMS_CALLING_OVERHEAD is
+
+ INITIALIZE_EXECUTIVE : constant RTEMS.UNSIGNED32 := 0;
+ SHUTDOWN_EXECUTIVE : constant RTEMS.UNSIGNED32 := 0;
+ TASK_CREATE : constant RTEMS.UNSIGNED32 := 0;
+ TASK_IDENT : constant RTEMS.UNSIGNED32 := 0;
+ TASK_START : constant RTEMS.UNSIGNED32 := 0;
+ TASK_RESTART : constant RTEMS.UNSIGNED32 := 0;
+ TASK_DELETE : constant RTEMS.UNSIGNED32 := 0;
+ TASK_SUSPEND : constant RTEMS.UNSIGNED32 := 0;
+ TASK_RESUME : constant RTEMS.UNSIGNED32 := 0;
+ TASK_SET_PRIORITY : constant RTEMS.UNSIGNED32 := 0;
+ TASK_MODE : constant RTEMS.UNSIGNED32 := 0;
+ TASK_GET_NOTE : constant RTEMS.UNSIGNED32 := 0;
+ TASK_SET_NOTE : constant RTEMS.UNSIGNED32 := 0;
+ TASK_WAKE_WHEN : constant RTEMS.UNSIGNED32 := 0;
+ TASK_WAKE_AFTER : constant RTEMS.UNSIGNED32 := 0;
+ INTERRUPT_CATCH : constant RTEMS.UNSIGNED32 := 0;
+ CLOCK_GET : constant RTEMS.UNSIGNED32 := 0;
+ CLOCK_SET : constant RTEMS.UNSIGNED32 := 0;
+ CLOCK_TICK : constant RTEMS.UNSIGNED32 := 0;
+
+ TIMER_CREATE : constant RTEMS.UNSIGNED32 := 0;
+ TIMER_DELETE : constant RTEMS.UNSIGNED32 := 0;
+ TIMER_IDENT : constant RTEMS.UNSIGNED32 := 0;
+ TIMER_FIRE_AFTER : constant RTEMS.UNSIGNED32 := 0;
+ TIMER_FIRE_WHEN : constant RTEMS.UNSIGNED32 := 0;
+ TIMER_RESET : constant RTEMS.UNSIGNED32 := 0;
+ TIMER_CANCEL : constant RTEMS.UNSIGNED32 := 0;
+ SEMAPHORE_CREATE : constant RTEMS.UNSIGNED32 := 0;
+ SEMAPHORE_DELETE : constant RTEMS.UNSIGNED32 := 0;
+ SEMAPHORE_IDENT : constant RTEMS.UNSIGNED32 := 0;
+ SEMAPHORE_OBTAIN : constant RTEMS.UNSIGNED32 := 0;
+ SEMAPHORE_RELEASE : constant RTEMS.UNSIGNED32 := 0;
+ MESSAGE_QUEUE_CREATE : constant RTEMS.UNSIGNED32 := 0;
+ MESSAGE_QUEUE_IDENT : constant RTEMS.UNSIGNED32 := 0;
+ MESSAGE_QUEUE_DELETE : constant RTEMS.UNSIGNED32 := 0;
+ MESSAGE_QUEUE_SEND : constant RTEMS.UNSIGNED32 := 0;
+ MESSAGE_QUEUE_URGENT : constant RTEMS.UNSIGNED32 := 0;
+ MESSAGE_QUEUE_BROADCAST : constant RTEMS.UNSIGNED32 := 0;
+ MESSAGE_QUEUE_RECEIVE : constant RTEMS.UNSIGNED32 := 0;
+ MESSAGE_QUEUE_FLUSH : constant RTEMS.UNSIGNED32 := 0;
+
+ EVENT_SEND : constant RTEMS.UNSIGNED32 := 0;
+ EVENT_RECEIVE : constant RTEMS.UNSIGNED32 := 0;
+ SIGNAL_CATCH : constant RTEMS.UNSIGNED32 := 0;
+ SIGNAL_SEND : constant RTEMS.UNSIGNED32 := 0;
+ PARTITION_CREATE : constant RTEMS.UNSIGNED32 := 0;
+ PARTITION_IDENT : constant RTEMS.UNSIGNED32 := 0;
+ PARTITION_DELETE : constant RTEMS.UNSIGNED32 := 0;
+ PARTITION_GET_BUFFER : constant RTEMS.UNSIGNED32 := 0;
+ PARTITION_RETURN_BUFFER : constant RTEMS.UNSIGNED32 := 0;
+ REGION_CREATE : constant RTEMS.UNSIGNED32 := 0;
+ REGION_IDENT : constant RTEMS.UNSIGNED32 := 0;
+ REGION_DELETE : constant RTEMS.UNSIGNED32 := 0;
+ REGION_GET_SEGMENT : constant RTEMS.UNSIGNED32 := 0;
+ REGION_RETURN_SEGMENT : constant RTEMS.UNSIGNED32 := 0;
+ PORT_CREATE : constant RTEMS.UNSIGNED32 := 0;
+ PORT_IDENT : constant RTEMS.UNSIGNED32 := 0;
+ PORT_DELETE : constant RTEMS.UNSIGNED32 := 0;
+ PORT_EXTERNAL_TO_INTERNAL : constant RTEMS.UNSIGNED32 := 0;
+ PORT_INTERNAL_TO_EXTERNAL : constant RTEMS.UNSIGNED32 := 0;
+
+ IO_INITIALIZE : constant RTEMS.UNSIGNED32 := 0;
+ IO_OPEN : constant RTEMS.UNSIGNED32 := 0;
+ IO_CLOSE : constant RTEMS.UNSIGNED32 := 0;
+ IO_READ : constant RTEMS.UNSIGNED32 := 0;
+ IO_WRITE : constant RTEMS.UNSIGNED32 := 0;
+ IO_CONTROL : constant RTEMS.UNSIGNED32 := 0;
+ FATAL_ERROR_OCCURRED : constant RTEMS.UNSIGNED32 := 0;
+ RATE_MONOTONIC_CREATE : constant RTEMS.UNSIGNED32 := 0;
+ RATE_MONOTONIC_IDENT : constant RTEMS.UNSIGNED32 := 0;
+ RATE_MONOTONIC_DELETE : constant RTEMS.UNSIGNED32 := 0;
+ RATE_MONOTONIC_CANCEL : constant RTEMS.UNSIGNED32 := 0;
+ RATE_MONOTONIC_PERIOD : constant RTEMS.UNSIGNED32 := 0;
+ MULTIPROCESSING_ANNOUNCE : constant RTEMS.UNSIGNED32 := 0;
+
+end RTEMS_CALLING_OVERHEAD;
diff --git a/c/src/ada-tests/support/time_test_support.adb b/c/src/ada-tests/support/time_test_support.adb
new file mode 100644
index 0000000000..5eba15fa58
--- /dev/null
+++ b/c/src/ada-tests/support/time_test_support.adb
@@ -0,0 +1,77 @@
+--
+-- TIME_TEST_SUPPORT / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package provides routines which aid the individual tests in
+-- the Timing Test Suite and simplify their design and operation.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-1997.
+-- On-Line Applications Research Corporation (OAR).
+-- Copyright assigned to U.S. Government, 1994.
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.OARcorp.com/rtems/license.html.
+--
+-- $Id$
+--
+
+with INTERFACES; use INTERFACES;
+with RTEMS;
+with TEXT_IO;
+with UNSIGNED32_IO;
+
+package body TIME_TEST_SUPPORT is
+
+--PAGE
+--
+-- PUT_TIME
+--
+
+ procedure PUT_TIME (
+ MESSAGE : in STRING;
+ TOTAL_TIME : in RTEMS.UNSIGNED32;
+ ITERATIONS : in RTEMS.UNSIGNED32;
+ LOOP_OVERHEAD : in RTEMS.UNSIGNED32;
+ CALLING_OVERHEAD : in RTEMS.UNSIGNED32
+ ) is
+ PER_ITERATION : RTEMS.UNSIGNED32;
+ begin
+
+ PER_ITERATION := (TOTAL_TIME - LOOP_OVERHEAD) / ITERATIONS;
+ PER_ITERATION := PER_ITERATION - CALLING_OVERHEAD;
+
+ if PER_ITERATION = 0 then
+
+ TEXT_IO.PUT( "TOTAL_TIME " );
+ UNSIGNED32_IO.PUT( TOTAL_TIME );
+ TEXT_IO.NEW_LINE;
+
+ TEXT_IO.PUT( "ITERATIONS " );
+ UNSIGNED32_IO.PUT( ITERATIONS );
+ TEXT_IO.NEW_LINE;
+
+ TEXT_IO.PUT( "LOOP_OVERHEAD " );
+ UNSIGNED32_IO.PUT( LOOP_OVERHEAD );
+ TEXT_IO.NEW_LINE;
+
+ TEXT_IO.PUT( "CALLING_OVERHEAD " );
+ UNSIGNED32_IO.PUT( CALLING_OVERHEAD );
+ TEXT_IO.NEW_LINE;
+
+ end if;
+
+ TEXT_IO.PUT( MESSAGE );
+ TEXT_IO.PUT( " " );
+ UNSIGNED32_IO.PUT( PER_ITERATION );
+ TEXT_IO.NEW_LINE;
+ TEXT_IO.FLUSH;
+
+ end PUT_TIME;
+
+end TIME_TEST_SUPPORT;
diff --git a/c/src/ada-tests/support/time_test_support.ads b/c/src/ada-tests/support/time_test_support.ads
new file mode 100644
index 0000000000..6dbacaf69d
--- /dev/null
+++ b/c/src/ada-tests/support/time_test_support.ads
@@ -0,0 +1,54 @@
+--
+-- TIME_TEST_SUPPORT / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package provides routines which aid the individual tests in
+-- the Timing Test Suite and simplify their design and operation.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-1997.
+-- On-Line Applications Research Corporation (OAR).
+-- Copyright assigned to U.S. Government, 1994.
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.OARcorp.com/rtems/license.html.
+--
+-- $Id$
+--
+
+with RTEMS;
+
+package TIME_TEST_SUPPORT is
+
+--
+-- The following constants define the number of times a directive
+-- will be performed in the Timing Suite.
+--
+
+ OPERATION_COUNT : constant RTEMS.UNSIGNED32 := 100;
+ ITERATION_COUNT : constant RTEMS.UNSIGNED32 := 100;
+
+--
+-- PUT_TIME
+--
+-- DESCRIPTION:
+--
+-- This subprogram prints the MESSAGE followed by the length of
+-- time which each individual operation took. All times are
+-- in microseconds.
+--
+
+ procedure PUT_TIME (
+ MESSAGE : in STRING;
+ TOTAL_TIME : in RTEMS.UNSIGNED32;
+ ITERATIONS : in RTEMS.UNSIGNED32;
+ LOOP_OVERHEAD : in RTEMS.UNSIGNED32;
+ CALLING_OVERHEAD : in RTEMS.UNSIGNED32
+ );
+
+end TIME_TEST_SUPPORT;
diff --git a/c/src/ada-tests/support/timer_driver.adb b/c/src/ada-tests/support/timer_driver.adb
new file mode 100644
index 0000000000..caa2374759
--- /dev/null
+++ b/c/src/ada-tests/support/timer_driver.adb
@@ -0,0 +1,45 @@
+--
+-- Timer_Driver / Body
+--
+-- Description:
+--
+-- This package is the body for the Timer Driver.
+--
+-- Dependencies:
+--
+--
+--
+-- COPYRIGHT (c) 1989-1997.
+-- On-Line Applications Research Corporation (OAR).
+-- Copyright assigned to U.S. Government, 1994.
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.OARcorp.com/rtems/license.html.
+--
+-- $Id$
+--
+
+with RTEMS;
+
+package body Timer_Driver is
+
+--PAGE
+--
+-- Set_Find_Average_Overhead
+--
+--
+
+ procedure Set_Find_Average_Overhead (
+ Find_Flag : in Standard.Boolean
+ ) is
+ procedure Set_Find_Average_Overhead_base (
+ Find_Flag : in RTEMS.Boolean
+ );
+ pragma Import (C, Set_Find_Average_Overhead_base,
+ "Set_find_average_overhead");
+ begin
+ Set_Find_Average_Overhead_base (RTEMS.From_Ada_Boolean (Find_Flag));
+ end Set_Find_Average_Overhead;
+
+end Timer_Driver;
diff --git a/c/src/ada-tests/support/timer_driver.ads b/c/src/ada-tests/support/timer_driver.ads
new file mode 100644
index 0000000000..bd7c4891b7
--- /dev/null
+++ b/c/src/ada-tests/support/timer_driver.ads
@@ -0,0 +1,81 @@
+--
+-- Timer_Driver / Specification
+--
+-- Description:
+--
+-- This package is the specification for the Timer Driver.
+--
+-- Dependencies:
+--
+--
+--
+-- COPYRIGHT (c) 1989-1997.
+-- On-Line Applications Research Corporation (OAR).
+-- Copyright assigned to U.S. Government, 1994.
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.OARcorp.com/rtems/license.html.
+--
+-- $Id$
+--
+
+with RTEMS;
+
+package Timer_Driver is
+
+--
+-- Initialize
+--
+-- Description:
+--
+-- This subprogram initializes the hardware timer to start it.
+--
+
+ procedure Initialize;
+ pragma Import (C, Initialize, "Timer_initialize");
+
+--
+-- Read_Timer
+--
+-- Description:
+--
+-- This subprogram stops the timer, calculates the length of time
+-- in microseconds since the timer was started, and returns that
+-- value.
+--
+
+ function Read_Timer
+ return RTEMS.Unsigned32;
+ pragma Import (C, Read_Timer, "Read_timer");
+
+--
+-- Empty_Function
+--
+-- Description:
+--
+-- This subprogram is an empty subprogram. It is used to
+-- insure that a loop will be included in the final executable
+-- so that loop overhead can be subtracted from the directive
+-- times reported.
+--
+
+ procedure Empty_Function;
+ pragma Import (C, Empty_Function, "Empty_function");
+
+--
+-- Set_Find_Average_Overhead
+--
+-- Description:
+--
+-- This subprogram sets the Find_Average_Overhead flag to the
+-- the value passed.
+--
+
+ procedure Set_Find_Average_Overhead (
+ Find_Flag : in Standard.Boolean
+ );
+
+private
+
+end Timer_Driver;