summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-21 15:16:57 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-21 15:16:57 +0000
commitbbebcd2c0d38338c130e8f69e22b0da980ea3e14 (patch)
treedfe38a28b5e92dd656bf82871adf93500b368346 /testsuites
parent2009-07-21 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-bbebcd2c0d38338c130e8f69e22b0da980ea3e14.tar.bz2
2009-07-21 Joel Sherrill <joel.sherrill@oarcorp.com>
* spintrcritical06/init.c: Add comment to indicate test is not finished and known to not hit the case. * Makefile.am, configure.ac: Add a couple more interrupt critical section tests. * spintrcritical08/.cvsignore, spintrcritical08/Makefile.am, spintrcritical08/init.c, spintrcritical08/spintrcritical08.doc, spintrcritical08/spintrcritical08.scn, spintrcritical09/.cvsignore, spintrcritical09/Makefile.am, spintrcritical09/init.c, spintrcritical09/spintrcritical09.doc, spintrcritical09/spintrcritical09.scn: New files.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/sptests/ChangeLog13
-rw-r--r--testsuites/sptests/Makefile.am3
-rw-r--r--testsuites/sptests/configure.ac2
-rw-r--r--testsuites/sptests/spintrcritical06/init.c18
-rw-r--r--testsuites/sptests/spintrcritical08/.cvsignore2
-rw-r--r--testsuites/sptests/spintrcritical08/Makefile.am30
-rw-r--r--testsuites/sptests/spintrcritical08/init.c99
-rw-r--r--testsuites/sptests/spintrcritical08/spintrcritical08.doc24
-rw-r--r--testsuites/sptests/spintrcritical08/spintrcritical08.scn6
-rw-r--r--testsuites/sptests/spintrcritical09/.cvsignore2
-rw-r--r--testsuites/sptests/spintrcritical09/Makefile.am29
-rw-r--r--testsuites/sptests/spintrcritical09/init.c125
-rw-r--r--testsuites/sptests/spintrcritical09/spintrcritical09.doc28
-rw-r--r--testsuites/sptests/spintrcritical09/spintrcritical09.scn0
14 files changed, 378 insertions, 3 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index 565967ea52..f7777ef17f 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,3 +1,16 @@
+2009-07-21 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * spintrcritical06/init.c: Add comment to indicate test is not finished
+ and known to not hit the case.
+ * Makefile.am, configure.ac: Add a couple more interrupt critical
+ section tests.
+ * spintrcritical08/.cvsignore, spintrcritical08/Makefile.am,
+ spintrcritical08/init.c, spintrcritical08/spintrcritical08.doc,
+ spintrcritical08/spintrcritical08.scn, spintrcritical09/.cvsignore,
+ spintrcritical09/Makefile.am, spintrcritical09/init.c,
+ spintrcritical09/spintrcritical09.doc,
+ spintrcritical09/spintrcritical09.scn: New files.
+
2009-07-20 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, spintrcritical06/init.c: Add first attempt
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 2eaec83f40..7f7dc46787 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -19,7 +19,8 @@ SUBDIRS = \
spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \
spfatal08 spfatal09 spfatal10 spfatal11 spfatal12 \
spintrcritical01 spintrcritical02 spintrcritical03 spintrcritical04 \
- spintrcritical05 spintrcritical06 spintrcritical07
+ spintrcritical05 spintrcritical06 spintrcritical07 spintrcritical08 \
+ spintrcritical09
DIST_SUBDIRS = $(SUBDIRS) spfatal_support spintrcritical_support
EXTRA_DIST = spfatal_support/init.c spfatal_support/system.h
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index d505ff4fdc..c9c1d5edd4 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -105,6 +105,8 @@ spintrcritical04/Makefile
spintrcritical05/Makefile
spintrcritical06/Makefile
spintrcritical07/Makefile
+spintrcritical08/Makefile
+spintrcritical09/Makefile
spobjgetnext/Makefile
spprintk/Makefile
spsize/Makefile
diff --git a/testsuites/sptests/spintrcritical06/init.c b/testsuites/sptests/spintrcritical06/init.c
index 0284b27a5f..6500561a28 100644
--- a/testsuites/sptests/spintrcritical06/init.c
+++ b/testsuites/sptests/spintrcritical06/init.c
@@ -61,6 +61,7 @@ rtems_timer_service_routine test_release_from_isr(
void *arg
)
{
+printk("r");
(void) rtems_task_restart( Secondary_task_id, 1 );
}
@@ -70,14 +71,19 @@ rtems_task Secondary_task(
{
rtems_status_code status;
- if ( arg )
+#if 0
+ if ( arg ) {
+ printk("f");
(void) rtems_semaphore_flush( Semaphore );
+ }
+#endif
- #if defined(PRIORITY_NO_TIMEOUT_REVERSE)
+ #if 0 && defined(PRIORITY_NO_TIMEOUT_REVERSE)
status = rtems_task_resume( Main_task );
directive_failed( status, "rtems_task_resume" );
#endif
+ printk("O");
status = rtems_semaphore_obtain(
Semaphore,
RTEMS_DEFAULT_OPTIONS,
@@ -95,6 +101,13 @@ rtems_task Init(
puts( "\n\n*** TEST INTERRUPT CRITICAL SECTION " TEST_NAME " ***" );
+#if defined(PRIORITY_NO_TIMEOUT_REVERSE)
+ puts( "WARNING!!! TEST IS NOT COMPLETE!!!" );
+ puts( "WARNING!!! TEST IS NOT COMPLETE!!!" );
+ puts( "WARNING!!! TEST IS NOT COMPLETE!!!" );
+ puts( "WARNING!!! TEST IS NOT COMPLETE!!!" );
+#endif
+
puts( "Init - Trying to generate semaphore release from ISR while blocking" );
puts( "Init - Variation is: " TEST_STRING );
status = rtems_semaphore_create(
@@ -131,6 +144,7 @@ rtems_task Init(
directive_failed( status, "rtems_task_suspend" );
#endif
+printk("o");
status = rtems_semaphore_obtain(
Semaphore,
RTEMS_DEFAULT_OPTIONS,
diff --git a/testsuites/sptests/spintrcritical08/.cvsignore b/testsuites/sptests/spintrcritical08/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/sptests/spintrcritical08/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/sptests/spintrcritical08/Makefile.am b/testsuites/sptests/spintrcritical08/Makefile.am
new file mode 100644
index 0000000000..9fa72f9df8
--- /dev/null
+++ b/testsuites/sptests/spintrcritical08/Makefile.am
@@ -0,0 +1,30 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = spintrcritical08
+spintrcritical08_SOURCES = init.c \
+ ../spintrcritical_support/intrcritical.c
+
+dist_rtems_tests_DATA = spintrcritical08.scn
+dist_rtems_tests_DATA += spintrcritical08.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+spintrcritical08_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/spintrcritical_support
+
+LINK_OBJS = $(spintrcritical08_OBJECTS) $(spintrcritical08_LDADD)
+LINK_LIBS = $(spintrcritical08_LDLIBS)
+
+spintrcritical08$(EXEEXT): $(spintrcritical08_OBJECTS) $(spintrcritical08_DEPENDENCIES)
+ @rm -f spintrcritical08$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/spintrcritical08/init.c b/testsuites/sptests/spintrcritical08/init.c
new file mode 100644
index 0000000000..51b5b17c4b
--- /dev/null
+++ b/testsuites/sptests/spintrcritical08/init.c
@@ -0,0 +1,99 @@
+/*
+ * 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$
+ */
+
+#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ 1
+#include <tmacros.h>
+#include <intrcritical.h>
+
+rtems_id Main_task;
+rtems_id Period;
+volatile bool case_hit;
+
+rtems_rate_monotonic_period_states getState(void)
+{
+ Objects_Locations location;
+ Rate_monotonic_Control *period;
+
+ period = (Rate_monotonic_Control *)_Objects_Get(
+ &_Rate_monotonic_Information, Period, &location );
+ if ( location != OBJECTS_LOCAL ) {
+ puts( "Bad object lookup" );
+ rtems_test_exit(0);
+ }
+ _Thread_Unnest_dispatch();
+
+ return period->state;
+}
+
+rtems_timer_service_routine test_release_from_isr(
+ rtems_id timer,
+ void *arg
+)
+{
+ if ( getState() == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING )
+ case_hit = true;
+}
+
+rtems_task Init(
+ rtems_task_argument ignored
+)
+{
+ rtems_status_code sc;
+ int resets;
+
+ puts( "\n\n*** TEST INTERRUPT CRITICAL SECTION 08 ***" );
+
+ puts( "Init - Trying to generate period ending while blocking" );
+
+ puts( "Init - rtems_rate_monotonic_create - OK" );
+ sc = rtems_rate_monotonic_create(
+ rtems_build_name( 'P', 'E', 'R', '1' ),
+ &Period
+ );
+ directive_failed( sc, "rtems_rate_monotonic_create" );
+
+ Main_task = rtems_task_self();
+
+ interrupt_critical_section_test_support_initialize( test_release_from_isr );
+
+ case_hit = false;
+
+ for (resets=0 ; case_hit == false && resets< 2 ;) {
+ if ( interrupt_critical_section_test_support_delay() )
+ resets++;
+
+ sc = rtems_rate_monotonic_period( Period, 1 );
+ if ( sc == RTEMS_TIMEOUT )
+ continue;
+ directive_failed( sc, "rtems_monotonic_period");
+ }
+
+ if ( case_hit ) {
+ puts( "Init - It appears the case has been hit" );
+ puts( "*** END OF TEST INTERRUPT CRITICAL SECTION 08 ***" );
+ }
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 2
+#define CONFIGURE_MAXIMUM_TIMERS 1
+#define CONFIGURE_MAXIMUM_PERIODS 1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+
+/* global variables */
diff --git a/testsuites/sptests/spintrcritical08/spintrcritical08.doc b/testsuites/sptests/spintrcritical08/spintrcritical08.doc
new file mode 100644
index 0000000000..bc92ea8b9d
--- /dev/null
+++ b/testsuites/sptests/spintrcritical08/spintrcritical08.doc
@@ -0,0 +1,24 @@
+#
+# $Id$
+#
+# 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.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: spintrcritical08
+
+directives:
+
+ rtems_rate_monotonic_create
+ rtems_rate_monotonic_period
+
+concepts:
+
++ Ensure that having the period expire while we are in the process of
+ blocking on the period is handled properly.
diff --git a/testsuites/sptests/spintrcritical08/spintrcritical08.scn b/testsuites/sptests/spintrcritical08/spintrcritical08.scn
new file mode 100644
index 0000000000..86aa7fad54
--- /dev/null
+++ b/testsuites/sptests/spintrcritical08/spintrcritical08.scn
@@ -0,0 +1,6 @@
+*** TEST INTERRUPT CRITICAL SECTION 08 ***
+Init - Trying to generate period ending while blocking
+Init - rtems_rate_monotonic_create - OK
+Support - rtems_timer_create - creating timer 1
+Init - It appears the case has been hit
+*** END OF TEST INTERRUPT CRITICAL SECTION 08 ***
diff --git a/testsuites/sptests/spintrcritical09/.cvsignore b/testsuites/sptests/spintrcritical09/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/sptests/spintrcritical09/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/sptests/spintrcritical09/Makefile.am b/testsuites/sptests/spintrcritical09/Makefile.am
new file mode 100644
index 0000000000..4f27ca55f5
--- /dev/null
+++ b/testsuites/sptests/spintrcritical09/Makefile.am
@@ -0,0 +1,29 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = spintrcritical09
+spintrcritical09_SOURCES = init.c ../spintrcritical_support/intrcritical.c
+
+dist_rtems_tests_DATA = spintrcritical09.scn
+dist_rtems_tests_DATA += spintrcritical09.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+spintrcritical09_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/spintrcritical_support
+
+LINK_OBJS = $(spintrcritical09_OBJECTS) $(spintrcritical09_LDADD)
+LINK_LIBS = $(spintrcritical09_LDLIBS)
+
+spintrcritical09$(EXEEXT): $(spintrcritical09_OBJECTS) $(spintrcritical09_DEPENDENCIES)
+ @rm -f spintrcritical09$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/spintrcritical09/init.c b/testsuites/sptests/spintrcritical09/init.c
new file mode 100644
index 0000000000..78a0fcb9e0
--- /dev/null
+++ b/testsuites/sptests/spintrcritical09/init.c
@@ -0,0 +1,125 @@
+/*
+ * 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$
+ */
+
+#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ 1
+#include <tmacros.h>
+#include <intrcritical.h>
+
+rtems_id Main_task;
+rtems_id Flusher_id;
+rtems_id Semaphore;
+volatile bool case_hit;
+
+Thread_blocking_operation_States getState(void)
+{
+ Objects_Locations location;
+ Semaphore_Control *sem;
+
+ sem = (Semaphore_Control *)_Objects_Get(
+ &_Semaphore_Information, Semaphore, &location );
+ if ( location != OBJECTS_LOCAL ) {
+ puts( "Bad object lookup" );
+ rtems_test_exit(0);
+ }
+ _Thread_Unnest_dispatch();
+
+ return sem->Core_control.semaphore.Wait_queue.sync_state;
+}
+
+rtems_timer_service_routine test_release_from_isr(
+ rtems_id timer,
+ void *arg
+)
+{
+ if ( getState() == THREAD_BLOCKING_OPERATION_TIMEOUT ) {
+ case_hit = true;
+ }
+}
+
+rtems_task Flusher(
+ rtems_task_argument ignored
+)
+{
+ rtems_status_code sc;
+
+ while (1) {
+ sc = rtems_semaphore_flush( Semaphore );
+ directive_failed( sc, "rtems_semaphore_flush" );
+
+ sc = rtems_task_wake_after( 2 );
+ directive_failed( sc, "rtems_task_wake_after" );
+ }
+}
+
+rtems_task Init(
+ rtems_task_argument ignored
+)
+{
+ rtems_status_code sc;
+
+ puts( "\n\n*** TEST INTERRUPT CRITICAL SECTION 09 ***" );
+
+ puts( "Init - Trying to generate timeout from ISR while blocking" );
+ sc = rtems_semaphore_create(
+ rtems_build_name( 'S', 'M', '1', ' ' ),
+ 1,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ RTEMS_NO_PRIORITY,
+ &Semaphore
+ );
+ directive_failed( sc, "rtems_semaphore_create of SM1" );
+
+ Main_task = rtems_task_self();
+
+ sc = rtems_task_create(
+ rtems_build_name( 'F', 'L', 'S', 'H' ),
+ 1,
+ RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Flusher_id
+ );
+ directive_failed( sc, "rtems_task_create" );
+
+ sc = rtems_task_start( Flusher_id, Flusher, 0 );
+ directive_failed( sc, "rtems_task_start" );
+
+ interrupt_critical_section_test_support_initialize( test_release_from_isr );
+
+ case_hit = false;
+
+ while (!case_hit) {
+ interrupt_critical_section_test_support_delay();
+
+ (void) rtems_semaphore_obtain( Semaphore, RTEMS_DEFAULT_OPTIONS, 1 );
+ }
+
+ puts( "Init - Case hit" );
+
+ puts( "*** END OF TEST INTERRUPT CRITICAL SECTION 09 ***" );
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 2
+#define CONFIGURE_MAXIMUM_TIMERS 1
+#define CONFIGURE_MAXIMUM_SEMAPHORES 1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+#define CONFIGURE_MICROSECONDS_PER_TICK 500
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+
+/* global variables */
diff --git a/testsuites/sptests/spintrcritical09/spintrcritical09.doc b/testsuites/sptests/spintrcritical09/spintrcritical09.doc
new file mode 100644
index 0000000000..09522d5fe6
--- /dev/null
+++ b/testsuites/sptests/spintrcritical09/spintrcritical09.doc
@@ -0,0 +1,28 @@
+#
+# $Id$
+#
+# 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.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: spintrcritical09
+
+directives:
+
+ rtems_semaphore_flush
+ rtems_task_wake_after
+ rtems_semaphore_create
+ rtems_task_create
+ rtems_task_start
+ rtems_semaphore_obtain
+
+concepts:
+
++ Ensure that timing out while while the task is in the process
+ of blocking on a thread queue works as expected.
diff --git a/testsuites/sptests/spintrcritical09/spintrcritical09.scn b/testsuites/sptests/spintrcritical09/spintrcritical09.scn
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/testsuites/sptests/spintrcritical09/spintrcritical09.scn