mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -105,6 +105,8 @@ spintrcritical04/Makefile
|
||||
spintrcritical05/Makefile
|
||||
spintrcritical06/Makefile
|
||||
spintrcritical07/Makefile
|
||||
spintrcritical08/Makefile
|
||||
spintrcritical09/Makefile
|
||||
spobjgetnext/Makefile
|
||||
spprintk/Makefile
|
||||
spsize/Makefile
|
||||
|
||||
@@ -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,
|
||||
|
||||
2
testsuites/sptests/spintrcritical08/.cvsignore
Normal file
2
testsuites/sptests/spintrcritical08/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
30
testsuites/sptests/spintrcritical08/Makefile.am
Normal file
30
testsuites/sptests/spintrcritical08/Makefile.am
Normal file
@@ -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
|
||||
99
testsuites/sptests/spintrcritical08/init.c
Normal file
99
testsuites/sptests/spintrcritical08/init.c
Normal file
@@ -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 */
|
||||
24
testsuites/sptests/spintrcritical08/spintrcritical08.doc
Normal file
24
testsuites/sptests/spintrcritical08/spintrcritical08.doc
Normal file
@@ -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.
|
||||
6
testsuites/sptests/spintrcritical08/spintrcritical08.scn
Normal file
6
testsuites/sptests/spintrcritical08/spintrcritical08.scn
Normal file
@@ -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 ***
|
||||
2
testsuites/sptests/spintrcritical09/.cvsignore
Normal file
2
testsuites/sptests/spintrcritical09/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
29
testsuites/sptests/spintrcritical09/Makefile.am
Normal file
29
testsuites/sptests/spintrcritical09/Makefile.am
Normal file
@@ -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
|
||||
125
testsuites/sptests/spintrcritical09/init.c
Normal file
125
testsuites/sptests/spintrcritical09/init.c
Normal file
@@ -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 */
|
||||
28
testsuites/sptests/spintrcritical09/spintrcritical09.doc
Normal file
28
testsuites/sptests/spintrcritical09/spintrcritical09.doc
Normal file
@@ -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.
|
||||
Reference in New Issue
Block a user