URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk/rtos/rtems/c/src/tests/tmitrontests
- from Rev 30 to Rev 173
- ↔ Reverse comparison
Rev 30 → Rev 173
/tmitronsem01/init.c
0,0 → 1,144
/* 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 |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* 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: init.c,v 1.2 2001-09-27 12:02:39 chris Exp $ |
*/ |
|
#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 ); |
} |
/tmitronsem01/tmitronsem01.doc
0,0 → 1,9
# |
# $Id: tmitronsem01.doc,v 1.1 1999/11/09 22:07:23 joel Exp $ |
# |
# 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 |
/tmitronsem01/Makefile.am
0,0 → 1,45
## |
## $Id: Makefile.am,v 1.2 2001-09-27 12:02:39 chris Exp $ |
## |
|
AUTOMAKE_OPTIONS = foreign 1.4 |
|
TEST = tmitronsem01 |
|
MANAGERS = all |
|
C_FILES = init.c |
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o) |
|
H_FILES = system.h |
noinst_HEADERS = $(H_FILES) |
|
DOCTYPES = doc |
DOCS = $(DOCTYPES:%=$(TEST).%) |
|
SRCS = $(DOCS) $(C_FILES) $(H_FILES) |
OBJS = $(C_O_FILES) |
|
PRINT_SRCS = $(DOCS) |
|
PGM = ${ARCH}/$(TEST).exe |
|
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg |
include $(RTEMS_ROOT)/make/leaf.cfg |
include $(top_srcdir)/tmitrontests.am |
|
# |
# (OPTIONAL) Add local stuff here using += |
# |
|
OPERATION_COUNT = @OPERATION_COUNT@ |
AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) |
|
${PGM}: $(OBJS) $(LINK_FILES) |
$(make-exe) |
|
all-local: $(ARCH) $(TMPINSTALL_FILES) |
|
EXTRA_DIST = $(C_FILES) $(DOCS) |
|
include $(top_srcdir)/../../../../automake/local.am |
/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-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* 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: system.h,v 1.2 2001-09-27 12:02:39 chris Exp $ |
*/ |
|
#include <tmacros.h> |
#include <itron.h> |
#include <assert.h> |
|
/* functions */ |
|
void ITRON_Init( void ); |
|
/* configuration information */ |
|
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER |
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
|
#define CONFIGURE_MAXIMUM_ITRON_TASKS 1 |
#define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES 100 |
#define CONFIGURE_ITRON_INIT_TASK_TABLE |
|
#include <confdefs.h> |
|
/* global variables */ |
|
TEST_EXTERN rtems_id Global_variable; /* example global variable */ |
|
/* end of include file */ |
/include/timesys.h
0,0 → 1,55
/* timesys.h |
* |
* This header file contains the global variables for the Time |
* suite. |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* 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: timesys.h,v 1.2 2001-09-27 12:02:39 chris Exp $ |
*/ |
|
#include <tmacros.h> |
|
/* |
* How many times a particular operation is performed while timed. |
*/ |
|
#ifndef OPERATION_COUNT |
#define OPERATION_COUNT 100 |
#endif |
|
/* 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 */ |
/include/Makefile.am
0,0 → 1,9
## |
## $Id: Makefile.am,v 1.2 2001-09-27 12:02:39 chris Exp $ |
## |
|
AUTOMAKE_OPTIONS = foreign 1.4 |
|
noinst_HEADERS = timesys.h |
|
include $(top_srcdir)/../../../../automake/local.am |
/configure.in
0,0 → 1,47
dnl Process this file with autoconf to produce a configure script. |
dnl |
dnl $Id: configure.in,v 1.2 2001-09-27 12:02:38 chris Exp $ |
|
AC_PREREQ(2.13) |
AC_INIT(tmitronsem01) |
RTEMS_TOP(../../../..) |
AC_CONFIG_AUX_DIR(../../../..) |
|
RTEMS_CANONICAL_TARGET_CPU |
|
AM_INIT_AUTOMAKE(rtems-c-src-tests-tmitrontests,$RTEMS_VERSION,no) |
AM_MAINTAINER_MODE |
|
RTEMS_ENABLE_INLINES |
RTEMS_ENABLE_GCC28 |
RTEMS_ENABLE_BARE |
|
RTEMS_ENV_RTEMSBSP |
RTEMS_CHECK_CPU |
RTEMS_CANONICAL_HOST |
|
RTEMS_PROJECT_ROOT |
|
RTEMS_PROG_CC_FOR_TARGET |
|
RTEMS_CANONICALIZE_TOOLS |
|
RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) |
|
AC_SUBST(RTEMS_USE_GCC272) |
AC_SUBST(BARE_CPU_CFLAGS) |
AC_SUBST(BARE_CPU_MODEL) |
AC_SUBST(CC_CFLAGS_DEFAULT) |
AC_SUBST(CC_CFLAGS_DEBUG_V) |
AC_SUBST(CC_CFLAGS_PROFILE_V) |
AC_SUBST(CC_LDFLAGS_PROFILE_V) |
|
OPERATION_COUNT=${OPERATION_COUNT-100} |
AC_SUBST(OPERATION_COUNT) |
|
# Explicitly list all Makefiles here |
AC_OUTPUT( |
Makefile |
include/Makefile |
tmitronsem01/Makefile |
) |
/Makefile.am
0,0 → 1,15
## |
## $Id: Makefile.am,v 1.2 2001-09-27 12:02:38 chris Exp $ |
## |
|
AUTOMAKE_OPTIONS = foreign 1.4 |
ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal |
|
ITRON_DIRS = include tmitronsem01 |
|
SUBDIRS = $(ITRON_DIRS) |
|
EXTRA_DIST = tmitrontests.am |
|
include $(top_srcdir)/../../../../automake/subdirs.am |
include $(top_srcdir)/../../../../automake/local.am |
/tmitrontests.am
0,0 → 1,11
project_bspdir=$(PROJECT_ROOT)/@RTEMS_BSP@ |
|
$(project_bspdir)/tests: |
@$(mkinstalldirs) $@ |
|
$(project_bspdir)/tests/$(TEST)$(LIB_VARIANT).exe: $(PGM) |
$(INSTALL_PROGRAM) $< $@ |
|
TMPINSTALL_FILES += \ |
$(project_bspdir)/tests \ |
$(project_bspdir)/tests/$(TEST)$(LIB_VARIANT).exe |
/README
0,0 → 1,6
# |
# $Id: README,v 1.2 2001-09-27 12:02:38 chris Exp $ |
# |
|
This directory contains the functionality tests for the ITRON 3.0 API |
implementation. |