forked from Imagelibrary/rtems
2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1413/cpukit * Makefile.am, configure.ac: Add test for case where server based timers which reinitiated themselves did not get reinserted onto timer chain. * sp50/.cvsignore, sp50/Makefile.am, sp50/init.c, sp50/sp50.doc, sp50/sp50.scn: New files.
This commit is contained in:
@@ -1,3 +1,12 @@
|
|||||||
|
2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
|
PR 1413/cpukit
|
||||||
|
* Makefile.am, configure.ac: Add test for case where server based
|
||||||
|
timers which reinitiated themselves did not get reinserted onto timer
|
||||||
|
chain.
|
||||||
|
* sp50/.cvsignore, sp50/Makefile.am, sp50/init.c, sp50/sp50.doc,
|
||||||
|
sp50/sp50.scn: New files.
|
||||||
|
|
||||||
2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com>
|
2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
PR 1414/cpukit
|
PR 1414/cpukit
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ ACLOCAL_AMFLAGS = -I ../aclocal
|
|||||||
SUBDIRS = sp01 sp02 sp03 sp04 sp05 sp06 sp07 sp08 sp09 sp11 sp12 sp13 sp14 \
|
SUBDIRS = sp01 sp02 sp03 sp04 sp05 sp06 sp07 sp08 sp09 sp11 sp12 sp13 sp14 \
|
||||||
sp15 sp16 sp17 sp19 sp20 sp21 sp22 sp23 sp24 sp25 sp26 sp27 sp28 sp29 \
|
sp15 sp16 sp17 sp19 sp20 sp21 sp22 sp23 sp24 sp25 sp26 sp27 sp28 sp29 \
|
||||||
sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 sp40 sp41 sp42 sp43 sp44 \
|
sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 sp40 sp41 sp42 sp43 sp44 \
|
||||||
sp45 sp46 sp47 sp48 sp49 spsize spwatchdog spfatal01 spfatal02 spfatal03 \
|
sp45 sp46 sp47 sp48 sp49 sp50 spsize spwatchdog \
|
||||||
spfatal04 spfatal05 spfatal06 spfatal07 spfatal08 spfatal09 spobjgetnext \
|
spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \
|
||||||
|
spfatal08 spfatal09 spobjgetnext \
|
||||||
spprintk spwkspace
|
spprintk spwkspace
|
||||||
|
|
||||||
DIST_SUBDIRS = $(SUBDIRS) spfatal spfatal_support
|
DIST_SUBDIRS = $(SUBDIRS) spfatal spfatal_support
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ sp46/Makefile
|
|||||||
sp47/Makefile
|
sp47/Makefile
|
||||||
sp48/Makefile
|
sp48/Makefile
|
||||||
sp49/Makefile
|
sp49/Makefile
|
||||||
|
sp50/Makefile
|
||||||
spwatchdog/Makefile
|
spwatchdog/Makefile
|
||||||
spsize/Makefile
|
spsize/Makefile
|
||||||
spfatal/Makefile
|
spfatal/Makefile
|
||||||
|
|||||||
2
testsuites/sptests/sp50/.cvsignore
Normal file
2
testsuites/sptests/sp50/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
28
testsuites/sptests/sp50/Makefile.am
Normal file
28
testsuites/sptests/sp50/Makefile.am
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
##
|
||||||
|
## $Id$
|
||||||
|
##
|
||||||
|
|
||||||
|
MANAGERS = all
|
||||||
|
|
||||||
|
rtems_tests_PROGRAMS = sp50
|
||||||
|
sp50_SOURCES = init.c
|
||||||
|
|
||||||
|
dist_rtems_tests_DATA = sp50.scn
|
||||||
|
dist_rtems_tests_DATA += sp50.doc
|
||||||
|
|
||||||
|
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||||
|
include $(top_srcdir)/../automake/compile.am
|
||||||
|
include $(top_srcdir)/../automake/leaf.am
|
||||||
|
|
||||||
|
sp50_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||||
|
|
||||||
|
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||||
|
|
||||||
|
LINK_OBJS = $(sp50_OBJECTS) $(sp50_LDADD)
|
||||||
|
LINK_LIBS = $(sp50_LDLIBS)
|
||||||
|
|
||||||
|
sp50$(EXEEXT): $(sp50_OBJECTS) $(sp50_DEPENDENCIES)
|
||||||
|
@rm -f sp50$(EXEEXT)
|
||||||
|
$(make-exe)
|
||||||
|
|
||||||
|
include $(top_srcdir)/../automake/local.am
|
||||||
92
testsuites/sptests/sp50/init.c
Normal file
92
testsuites/sptests/sp50/init.c
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* 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 <tmacros.h>
|
||||||
|
|
||||||
|
volatile int Fired;
|
||||||
|
volatile bool timerRan;
|
||||||
|
|
||||||
|
rtems_timer_service_routine Timer_Routine( rtems_id id, void *ignored )
|
||||||
|
{
|
||||||
|
rtems_status_code sc;
|
||||||
|
|
||||||
|
Fired++;
|
||||||
|
timerRan = true;
|
||||||
|
|
||||||
|
sc = rtems_timer_server_fire_after(
|
||||||
|
id,
|
||||||
|
get_ticks_per_second(),
|
||||||
|
Timer_Routine,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
rtems_task Init(
|
||||||
|
rtems_task_argument argument
|
||||||
|
)
|
||||||
|
{
|
||||||
|
rtems_status_code sc;
|
||||||
|
rtems_id timer1;
|
||||||
|
struct timespec uptime;
|
||||||
|
|
||||||
|
puts( "\n\n*** TEST 50 ***" );
|
||||||
|
|
||||||
|
sc = rtems_timer_initiate_server(
|
||||||
|
1,
|
||||||
|
RTEMS_MINIMUM_STACK_SIZE,
|
||||||
|
RTEMS_DEFAULT_ATTRIBUTES
|
||||||
|
);
|
||||||
|
directive_failed( sc, "rtems_timer_initiate_server" );
|
||||||
|
|
||||||
|
sc = rtems_timer_create(rtems_build_name( 'T', 'M', 'R', '1' ), &timer1);
|
||||||
|
directive_failed( sc, "rtems_timer_create" );
|
||||||
|
|
||||||
|
Fired = 0;
|
||||||
|
timerRan = false;
|
||||||
|
|
||||||
|
Timer_Routine(timer1, NULL);
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
sc = rtems_task_wake_after( 10 );
|
||||||
|
directive_failed( sc, "rtems_task_wake_after" );
|
||||||
|
|
||||||
|
if ( timerRan == true ) {
|
||||||
|
timerRan = false;
|
||||||
|
|
||||||
|
sc = rtems_clock_get_uptime( &uptime );
|
||||||
|
directive_failed( sc, "rtems_clock_get_uptime" );
|
||||||
|
|
||||||
|
printf( "Timer fired at %d\n", uptime.tv_sec );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( Fired >= 10 ) {
|
||||||
|
puts( "*** END OF TEST 50 ***" );
|
||||||
|
rtems_test_exit( 0 );
|
||||||
|
}
|
||||||
|
/* technically the following is a critical section */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**************** START OF CONFIGURATION INFORMATION ****************/
|
||||||
|
|
||||||
|
#define CONFIGURE_INIT
|
||||||
|
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||||
|
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||||
|
|
||||||
|
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||||
|
#define CONFIGURE_MAXIMUM_TIMERS 1
|
||||||
|
|
||||||
|
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||||
|
|
||||||
|
#include <rtems/confdefs.h>
|
||||||
|
|
||||||
|
/**************** END OF CONFIGURATION INFORMATION ****************/
|
||||||
23
testsuites/sptests/sp50/sp50.doc
Normal file
23
testsuites/sptests/sp50/sp50.doc
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#
|
||||||
|
# $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: sp50
|
||||||
|
|
||||||
|
directives:
|
||||||
|
|
||||||
|
rtems_timer_initiate_server
|
||||||
|
rtems_timer_server_fire_after
|
||||||
|
|
||||||
|
concepts:
|
||||||
|
|
||||||
|
+ Ensure that a server based timer can repeatedly schedule itself to fire.
|
||||||
12
testsuites/sptests/sp50/sp50.scn
Normal file
12
testsuites/sptests/sp50/sp50.scn
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
*** TEST 50 ***
|
||||||
|
Timer fired at 0
|
||||||
|
Timer fired at 1
|
||||||
|
Timer fired at 2
|
||||||
|
Timer fired at 3
|
||||||
|
Timer fired at 4
|
||||||
|
Timer fired at 5
|
||||||
|
Timer fired at 6
|
||||||
|
Timer fired at 7
|
||||||
|
Timer fired at 8
|
||||||
|
Timer fired at 9
|
||||||
|
*** END OF TEST 50 ***
|
||||||
Reference in New Issue
Block a user