summaryrefslogtreecommitdiffstats
path: root/testsuites/tmitrontests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-09 22:07:23 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-09 22:07:23 +0000
commit352c9b2035e32e56f10f261d94955d97f4ab0f1c (patch)
treef433e95ae0ab8d8854ea19b7f4bfab3ffb431726 /testsuites/tmitrontests
parent1007c3c8bae39e479f4c64d6c9ad6681442f7e8c (diff)
downloadrtems-352c9b2035e32e56f10f261d94955d97f4ab0f1c.tar.bz2
This patch adds the basic framework for the ITRON 3.0 API implementation
for RTEMS.
Diffstat (limited to '')
-rw-r--r--testsuites/tmitrontests/Makefile.am21
-rw-r--r--testsuites/tmitrontests/README6
-rw-r--r--testsuites/tmitrontests/include/Makefile.am9
-rw-r--r--testsuites/tmitrontests/include/timesys.h55
-rw-r--r--testsuites/tmitrontests/tmitronsem01/init.c141
-rw-r--r--testsuites/tmitrontests/tmitronsem01/system.h39
-rw-r--r--testsuites/tmitrontests/tmitronsem01/tmitronsem01.doc9
7 files changed, 280 insertions, 0 deletions
diff --git a/testsuites/tmitrontests/Makefile.am b/testsuites/tmitrontests/Makefile.am
new file mode 100644
index 0000000000..3b10073729
--- /dev/null
+++ b/testsuites/tmitrontests/Makefile.am
@@ -0,0 +1,21 @@
+##
+## $Id$
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
+
+project_bspdir = $(PROJECT_ROOT)/@RTEMS_BSP@
+
+PREINSTALLDIRS = $(project_bspdir)/tests/screens/psxtests
+$(PREINSTALLDIRS):
+ @$(mkinstalldirs) $@
+
+all-local: $(PREINSTALLDIRS)
+
+ITRON_DIRS = include tmitronsem01
+
+SUBDIRS = $(ITRON_DIRS)
+
+include $(top_srcdir)/../../../../automake/subdirs.am
+include $(top_srcdir)/../../../../automake/local.am
diff --git a/testsuites/tmitrontests/README b/testsuites/tmitrontests/README
new file mode 100644
index 0000000000..65c5d4165d
--- /dev/null
+++ b/testsuites/tmitrontests/README
@@ -0,0 +1,6 @@
+#
+# $Id$
+#
+
+This directory contains the functionality tests for the ITRON 3.0 API
+implementation.
diff --git a/testsuites/tmitrontests/include/Makefile.am b/testsuites/tmitrontests/include/Makefile.am
new file mode 100644
index 0000000000..fcf88cb578
--- /dev/null
+++ b/testsuites/tmitrontests/include/Makefile.am
@@ -0,0 +1,9 @@
+##
+## $Id$
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+
+noinst_HEADERS = timesys.h
+
+include $(top_srcdir)/../../../../automake/local.am
diff --git a/testsuites/tmitrontests/include/timesys.h b/testsuites/tmitrontests/include/timesys.h
new file mode 100644
index 0000000000..4f75a9abf2
--- /dev/null
+++ b/testsuites/tmitrontests/include/timesys.h
@@ -0,0 +1,55 @@
+/* timesys.h
+ *
+ * This header file contains the global variables for the Time
+ * suite.
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+
+/*
+ * How many times a particular operation is performed while timed.
+ */
+
+#define OPERATION_COUNT 100
+#define IT_COUNT 100
+
+/* functions */
+
+#define put_time( _message, _total_time, \
+ _iterations, _loop_overhead, _overhead ) \
+ printf( \
+ "%s %d\n", \
+ (_message), \
+ (((_total_time) - (_loop_overhead)) / (_iterations)) - (_overhead) \
+ )
+
+#if defined(STACK_CHECKER_ON) || defined(RTEMS_DEBUG)
+#define Print_Warning() \
+ do { \
+ puts( \
+ "\n" \
+ "THE TIMES REPORTED BY THIS TEST INCLUDE DEBUG CODE!\n" \
+ "\n" \
+ ); \
+ } while (0)
+
+#else
+#define Print_Warning()
+#endif
+
+/* variables */
+
+TEST_EXTERN volatile unsigned32 end_time; /* ending time variable */
+TEST_EXTERN volatile unsigned32 overhead; /* loop overhead variable */
+
+/* end of include file */
diff --git a/testsuites/tmitrontests/tmitronsem01/init.c b/testsuites/tmitrontests/tmitronsem01/init.c
new file mode 100644
index 0000000000..396d45d04b
--- /dev/null
+++ b/testsuites/tmitrontests/tmitronsem01/init.c
@@ -0,0 +1,141 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is called from init_exec and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#define TEST_INIT
+#include "system.h"
+#include <timesys.h>
+#include <stdio.h>
+
+void ITRON_Init( void )
+{
+ T_CSEM pk_csem;
+ T_RSEM pk_rsem;
+ int index;
+
+ pk_csem.isemcnt = 2;
+ pk_csem.maxsem = 3;
+ pk_csem.sematr = TA_TFIFO;
+
+ printf( "\n\n*** TMITRON01 -- ITRON TIMING TEST ***\n" );
+
+ /*
+ * time one invocation of cre_sem
+ */
+
+ Timer_initialize();
+ (void) cre_sem( 1, &pk_csem );
+ end_time = Read_timer();
+ put_time(
+ "cre_sem",
+ end_time,
+ 1,
+ 0, /* no loop overhead to take out */
+ 0 /* no calling overhead */
+ );
+
+ /*
+ * time one invocation of del_sem
+ */
+
+ Timer_initialize();
+ (void) del_sem( 1 );
+ end_time = Read_timer();
+ put_time(
+ "del_sem",
+ end_time,
+ 1,
+ 0, /* no loop overhead to take out */
+ 0 /* no calling overhead */
+ );
+
+ pk_csem.isemcnt = 100;
+ pk_csem.maxsem = 100;
+ pk_csem.sematr = TA_TFIFO;
+ (void) cre_sem( 1, &pk_csem );
+
+ /*
+ * time preq_sem (available)
+ */
+
+ Timer_initialize();
+ for ( index = 1 ; index<=OPERATION_COUNT ; index++ )
+ (void) preq_sem( 1 );
+ end_time = Read_timer();
+ put_time(
+ "preq_sem (available)",
+ end_time,
+ OPERATION_COUNT,
+ 0, /* don't take the loop overhead out */
+ 0 /* no calling overhead */
+ );
+
+ /*
+ * time preq_sem (not available)
+ */
+
+ Timer_initialize();
+ for ( index = 1 ; index<=OPERATION_COUNT ; index++ )
+ (void) preq_sem( 1 );
+ end_time = Read_timer();
+ put_time(
+ "preq_sem (not available)",
+ end_time,
+ OPERATION_COUNT,
+ 0, /* don't take the loop overhead out */
+ 0 /* no calling overhead */
+ );
+
+ /*
+ * time sig_sem (no waiting tasks)
+ */
+
+ Timer_initialize();
+ for ( index = 1 ; index<=OPERATION_COUNT ; index++ )
+ (void) sig_sem( 1 );
+ end_time = Read_timer();
+ put_time(
+ "sig_sem (no waiting tasks)",
+ end_time,
+ OPERATION_COUNT,
+ 0, /* don't take the loop overhead out */
+ 0 /* no calling overhead */
+ );
+
+ /*
+ * time ref_sem
+ */
+
+ Timer_initialize();
+ for ( index = 1 ; index<=OPERATION_COUNT ; index++ )
+ (void) ref_sem( 1, &pk_rsem );
+ end_time = Read_timer();
+ put_time(
+ "ref_sem",
+ end_time,
+ OPERATION_COUNT,
+ 0, /* don't take the loop overhead out */
+ 0 /* no calling overhead */
+ );
+
+ printf( "\n\nXXX ADD BLOCKING AND PREEMPTING TIME TESTS\n\n" );
+
+
+ printf( "*** END OF TMITRON01 -- ITRON TIMING TEST ***\n" );
+ exit( 0 );
+}
diff --git a/testsuites/tmitrontests/tmitronsem01/system.h b/testsuites/tmitrontests/tmitronsem01/system.h
new file mode 100644
index 0000000000..0537ae527a
--- /dev/null
+++ b/testsuites/tmitrontests/tmitronsem01/system.h
@@ -0,0 +1,39 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+#include <itron.h>
+#include <assert.h>
+
+/* functions */
+
+void ITRON_Init( void );
+
+/* configuration information */
+
+#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
+#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_ITRON_INIT_TASK_TABLE
+#define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES 100
+
+#include <confdefs.h>
+
+/* global variables */
+
+TEST_EXTERN rtems_id Global_variable; /* example global variable */
+
+/* end of include file */
diff --git a/testsuites/tmitrontests/tmitronsem01/tmitronsem01.doc b/testsuites/tmitrontests/tmitronsem01/tmitronsem01.doc
new file mode 100644
index 0000000000..558f0594c8
--- /dev/null
+++ b/testsuites/tmitrontests/tmitronsem01/tmitronsem01.doc
@@ -0,0 +1,9 @@
+#
+# $Id$
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.OARcorp.com/rtems/license.html.
+#
+
+Time some basic ITRON semaphore operations