From 682c20c75a3698ab8e5b492f422f636d17e42606 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 21 Jun 2010 18:26:06 +0000 Subject: 2010-06-21 Joel Sherrill * sptest_operation_from_tsr/Makefile.am, sptest_operation_from_tsr/TEST.doc, sptest_operation_from_tsr/TEST.scn, sptest_operation_from_tsr/init.c: New files. --- rtems-test-template/ChangeLog | 7 ++ .../sptest_operation_from_tsr/Makefile.am | 26 +++++++ .../sptest_operation_from_tsr/TEST.doc | 22 ++++++ .../sptest_operation_from_tsr/TEST.scn | 1 + .../sptest_operation_from_tsr/init.c | 87 ++++++++++++++++++++++ 5 files changed, 143 insertions(+) create mode 100644 rtems-test-template/sptest_operation_from_tsr/Makefile.am create mode 100644 rtems-test-template/sptest_operation_from_tsr/TEST.doc create mode 100644 rtems-test-template/sptest_operation_from_tsr/TEST.scn create mode 100644 rtems-test-template/sptest_operation_from_tsr/init.c (limited to 'rtems-test-template') diff --git a/rtems-test-template/ChangeLog b/rtems-test-template/ChangeLog index 6087ea0..442d6a3 100644 --- a/rtems-test-template/ChangeLog +++ b/rtems-test-template/ChangeLog @@ -1,3 +1,10 @@ +2010-06-21 Joel Sherrill + + * sptest_operation_from_tsr/Makefile.am, + sptest_operation_from_tsr/TEST.doc, + sptest_operation_from_tsr/TEST.scn, sptest_operation_from_tsr/init.c: + New files. + 2010-06-21 Joel Sherrill * tmtest/Makefile.am, tmtest/TEST.doc, tmtest/init.c: New files. diff --git a/rtems-test-template/sptest_operation_from_tsr/Makefile.am b/rtems-test-template/sptest_operation_from_tsr/Makefile.am new file mode 100644 index 0000000..0f35215 --- /dev/null +++ b/rtems-test-template/sptest_operation_from_tsr/Makefile.am @@ -0,0 +1,26 @@ +## +## $Id$ +## + +MANAGERS = all + +rtems_tests_PROGRAMS = @LOWER@ +@LOWER@_SOURCES = init.c ../../support/src/spin.c + +dist_rtems_tests_DATA = @LOWER@.scn +dist_rtems_tests_DATA += @LOWER@.doc + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/leaf.am + +AM_CPPFLAGS += -I$(top_srcdir)/../support/include + +LINK_OBJS = $(@LOWER@_OBJECTS) $(@LOWER@_LDADD) +LINK_LIBS = $(@LOWER@_LDLIBS) + +@LOWER@$(EXEEXT): $(@LOWER@_OBJECTS) $(@LOWER@_DEPENDENCIES) + @rm -f @LOWER@$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/rtems-test-template/sptest_operation_from_tsr/TEST.doc b/rtems-test-template/sptest_operation_from_tsr/TEST.doc new file mode 100644 index 0000000..5c5378c --- /dev/null +++ b/rtems-test-template/sptest_operation_from_tsr/TEST.doc @@ -0,0 +1,22 @@ +# +# $Id$ +# +# COPYRIGHT (c) 1989-2010. +# 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.rtems.com/license/LICENSE. +# + +This file describes the directives and concepts tested by this test set. + +test set name: @LOWER@ + +directives: + + XXX list them + +concepts: + ++ XXX list them diff --git a/rtems-test-template/sptest_operation_from_tsr/TEST.scn b/rtems-test-template/sptest_operation_from_tsr/TEST.scn new file mode 100644 index 0000000..a636120 --- /dev/null +++ b/rtems-test-template/sptest_operation_from_tsr/TEST.scn @@ -0,0 +1 @@ +XXX fill in with test output diff --git a/rtems-test-template/sptest_operation_from_tsr/init.c b/rtems-test-template/sptest_operation_from_tsr/init.c new file mode 100644 index 0000000..fef2ad5 --- /dev/null +++ b/rtems-test-template/sptest_operation_from_tsr/init.c @@ -0,0 +1,87 @@ +/* + * COPYRIGHT (c) 1989-2009. + * 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.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#include + +volatile bool operation_performed_from_tsr; + +rtems_timer_service_routine test_operation_from_isr( + rtems_id timer, + void *arg +) +{ + /* do something from ISR */ + + + operation_performed_from_tsr = true; +} + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + rtems_id timer; + + puts( "\n\n*** TEST @DESC@ ***" ); + + /* + * Timer used in multiple ways + */ + status = rtems_timer_create( rtems_build_name('T', 'M', 'R', '0'), &timer ); + directive_failed( status, "rtems_timer_create" ); + + operation_performed_from_tsr = false; + + /* + * Test Operation from ISR + */ + status = rtems_timer_fire_after( timer, 10, test_operation_from_isr, NULL ); + directive_failed( status, "timer_fire_after failed" ); + + /* XXX pick a delay method */ +#if 0 + status = rtems_task_wake_after( 20 ); +#else + { + rtems_interval start; + rtems_interval now; + start = rtems_clock_get_ticks_since_boot(); + do { + now = rtems_clock_get_ticks_since_boot(); + } while ( (now-start) > 100 ); + } +#endif + if ( !operation_performed_from_tsr ) { + puts( "Operation from ISR did not get processed\n" ); + rtems_test_exit( 0 ); + } + + /* XXX also may be able to confirm operation actually was performed */ + + puts( "*** END OF TEST @DESC@ ***" ); + rtems_test_exit( 0 ); +} + +/* configuration information */ + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_MAXIMUM_TASKS 1 +#define CONFIGURE_MAXIMUM_TIMERS 1 + +#define CONFIGURE_INIT +#include +/* end of file */ + -- cgit v1.2.3