diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-10 20:28:10 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-10 20:28:10 +0000 |
commit | 937a22a7cfcf467a779c7d51d4695f220d39e619 (patch) | |
tree | 623993441d5d40284cd9c5acd618f1500004deb0 /testsuites/sptests/sp41 | |
parent | 2009-07-10 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-937a22a7cfcf467a779c7d51d4695f220d39e619.tar.bz2 |
2009-07-10 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac: Add new infrastructure which is more
reliable about generating cases which hit interrupt critical
sections. Remove sp41 since it used its own mechanism.
* spintrcritical01/.cvsignore, spintrcritical01/Makefile.am,
spintrcritical01/init.c, spintrcritical01/spintrcritical01.doc,
spintrcritical01/spintrcritical01.scn, spintrcritical02/.cvsignore,
spintrcritical02/Makefile.am, spintrcritical02/spintrcritical02.doc,
spintrcritical02/spintrcritical02.scn, spintrcritical03/.cvsignore,
spintrcritical03/Makefile.am, spintrcritical03/spintrcritical03.doc,
spintrcritical03/spintrcritical03.scn, spintrcritical04/.cvsignore,
spintrcritical04/Makefile.am, spintrcritical04/spintrcritical04.doc,
spintrcritical04/spintrcritical04.scn, spintrcritical05/.cvsignore,
spintrcritical05/Makefile.am, spintrcritical05/spintrcritical05.doc,
spintrcritical05/spintrcritical05.scn: New files.
* sp41/.cvsignore, sp41/Makefile.am, sp41/init.c, sp41/sp41.scn,
sp41/system.h: Removed.
Diffstat (limited to 'testsuites/sptests/sp41')
-rw-r--r-- | testsuites/sptests/sp41/.cvsignore | 2 | ||||
-rw-r--r-- | testsuites/sptests/sp41/Makefile.am | 27 | ||||
-rw-r--r-- | testsuites/sptests/sp41/init.c | 206 | ||||
-rw-r--r-- | testsuites/sptests/sp41/sp41.scn | 4 | ||||
-rw-r--r-- | testsuites/sptests/sp41/system.h | 39 |
5 files changed, 0 insertions, 278 deletions
diff --git a/testsuites/sptests/sp41/.cvsignore b/testsuites/sptests/sp41/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp41/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp41/Makefile.am b/testsuites/sptests/sp41/Makefile.am deleted file mode 100644 index 204b41354b..0000000000 --- a/testsuites/sptests/sp41/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -## -## $Id$ -## - -MANAGERS = all - -rtems_tests_PROGRAMS = sp41 -sp41_SOURCES = init.c system.h - -dist_rtems_tests_DATA = sp41.scn - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../automake/compile.am -include $(top_srcdir)/../automake/leaf.am - -sp41_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel) - -AM_CPPFLAGS += -I$(top_srcdir)/../support/include - -LINK_OBJS = $(sp41_OBJECTS) $(sp41_LDADD) -LINK_LIBS = $(sp41_LDLIBS) - -sp41$(EXEEXT): $(sp41_OBJECTS) $(sp41_DEPENDENCIES) - @rm -f sp41$(EXEEXT) - $(make-exe) - -include $(top_srcdir)/../automake/local.am diff --git a/testsuites/sptests/sp41/init.c b/testsuites/sptests/sp41/init.c deleted file mode 100644 index c86eb4bf80..0000000000 --- a/testsuites/sptests/sp41/init.c +++ /dev/null @@ -1,206 +0,0 @@ -/* - * 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 CONFIGURE_INIT -#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ 1 -#include "system.h" - -volatile bool case_hit; - -rtems_id main_task; -rtems_id Semaphore; - -/* prototypes */ -Thread_blocking_operation_States getState(void); -rtems_timer_service_routine test_release_from_isr( - rtems_id timer, - void *arg -); -rtems_timer_service_routine test_release_with_timeout_from_isr( - rtems_id timer, - void *arg -); - -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 -) -{ - rtems_status_code status; - - if ( getState() == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { - case_hit = TRUE; - } - status = rtems_semaphore_release( Semaphore ); -} - -rtems_timer_service_routine test_release_with_timeout_from_isr( - rtems_id timer, - void *arg -) -{ - rtems_status_code status; - - if ( getState() == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { - /* - * We want to catch the task while it is blocking. Otherwise - * just send and make it happy. - */ - case_hit = TRUE; - } - status = rtems_semaphore_release( Semaphore ); -} - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_id timer; - int i; - int max; - uint32_t iterations = 0; - - puts( "\n\n*** TEST 41 ***" ); - - main_task = rtems_task_self(); - - /* - * Timer used in multiple ways - */ - status = rtems_timer_create( 1, &timer ); - directive_failed( status, "rtems_timer_create" ); - - status = rtems_semaphore_create( - rtems_build_name( 'S', 'M', '1', ' ' ), - 1, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_NO_PRIORITY, - &Semaphore - ); - directive_failed( status, "rtems_semaphore_create of SM1" ); - - /* - * Test semaphore release successful from ISR -- obtain is forever - */ - case_hit = FALSE; - iterations = 0; - max = 1; - - while (1) { - if ( case_hit ) - break; - status = rtems_timer_fire_after( timer, 1, test_release_from_isr, NULL ); - directive_failed( status, "timer_fire_after failed" ); - - for (i=0 ; i<max ; i++ ) - if ( getState() == THREAD_BLOCKING_OPERATION_SATISFIED ) - break; - - status = rtems_semaphore_obtain( Semaphore, RTEMS_DEFAULT_OPTIONS, 0 ); - directive_failed( status, "rtems_semaphore_obtain" ); - if ( case_hit == TRUE ) - break; - max += 2; - - /* with our clock tick, this is about 30 seconds */ - if ( ++iterations >= 4L * 1000L * 30L) - break; - } - - status = rtems_semaphore_release( Semaphore ); - directive_failed( status, "rtems_semaphore_release" ); - printf( - "Release from ISR hitting synchronization point has %soccurred\n", - (( case_hit == TRUE ) ? "" : "NOT ") - ); - - /* - * Test semaphore release successful from ISR -- obtain has timeout - */ - case_hit = FALSE; - iterations = 0; - max = 1; - - while (1) { - if ( case_hit ) - break; - status = rtems_timer_fire_after( - timer, 1, test_release_with_timeout_from_isr, NULL ); - directive_failed( status, "timer_fire_after failed" ); - - for (i=0 ; i<max ; i++ ) - if ( getState() == THREAD_BLOCKING_OPERATION_SATISFIED ) - break; - - status = rtems_semaphore_obtain( Semaphore, RTEMS_DEFAULT_OPTIONS, 10 ); - directive_failed( status, "rtems_semaphore_obtain" ); - if ( case_hit == TRUE ) - break; - max += 2; - - /* with our clock tick, this is about 30 seconds */ - if ( ++iterations >= 4L * 1000L * 30L) - break; - } - - printf( - "Release from ISR (with timeout) hitting synchronization " - "point has %soccurred\n", - (( case_hit == TRUE ) ? "" : "NOT ") - ); - - /* - * Now try for a timeout case -- semaphore must not be available - */ - iterations = 0; - case_hit = FALSE; - max = 1; - - puts( - "Run multiple times in attempt to hit threadq timeout synchronization point" - ); - while (1) { - - for (i=0 ; i<max ; i++ ) - if ( getState() == THREAD_BLOCKING_OPERATION_SATISFIED ) - break; - - status = rtems_semaphore_obtain( Semaphore, RTEMS_DEFAULT_OPTIONS, 1 ); - fatal_directive_status( status, RTEMS_TIMEOUT, "rtems_semaphore_obtain" ); - - if ( ++max > 10240 ) - max = 0; - - /* with our clock tick, this is about 30 seconds */ - if ( ++iterations >= 4L * 1000L * 30L) - break; - } - - puts( "*** END OF TEST 41 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp41/sp41.scn b/testsuites/sptests/sp41/sp41.scn deleted file mode 100644 index fb661e3f35..0000000000 --- a/testsuites/sptests/sp41/sp41.scn +++ /dev/null @@ -1,4 +0,0 @@ -*** TEST 41 *** -Release from ISR hitting synchronization point has occurred -Release from ISR (with timeout) hitting synchronization point has occurred -Run multiple times in attempt to hit threadq timeout synchronization point diff --git a/testsuites/sptests/sp41/system.h b/testsuites/sptests/sp41/system.h deleted file mode 100644 index f2a81e6634..0000000000 --- a/testsuites/sptests/sp41/system.h +++ /dev/null @@ -1,39 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-2007. - * 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 <tmacros.h> - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_MICROSECONDS_PER_TICK 250 - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_TIMERS 1 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 - -#include <rtems/confdefs.h> - -/* end of include file */ |