From e8f4303a4c504b0dc3f0ed138b7532f9ffa84067 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 21 Dec 2007 15:50:33 +0000 Subject: 2007-12-21 Xi Yang * Makefile.am, configure.ac: Add support for proper stacking of priority inheritance on mutexes as well as enforce proper order of release. * sp36/.cvsignore, sp36/Makefile.am, sp36/sp36.doc, sp36/sp36.scn: New files. --- testsuites/sptests/ChangeLog | 8 +++++++ testsuites/sptests/Makefile.am | 2 +- testsuites/sptests/configure.ac | 1 + testsuites/sptests/sp36/.cvsignore | 2 ++ testsuites/sptests/sp36/Makefile.am | 26 +++++++++++++++++++++++ testsuites/sptests/sp36/sp36.doc | 42 +++++++++++++++++++++++++++++++++++++ testsuites/sptests/sp36/sp36.scn | 0 7 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 testsuites/sptests/sp36/.cvsignore create mode 100644 testsuites/sptests/sp36/Makefile.am create mode 100644 testsuites/sptests/sp36/sp36.doc create mode 100644 testsuites/sptests/sp36/sp36.scn (limited to 'testsuites/sptests') diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index 06a3a20373..c62f6e9a99 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,3 +1,11 @@ +2007-12-21 Xi Yang + + * Makefile.am, configure.ac: Add support for proper stacking of + priority inheritance on mutexes as well as enforce proper order of + release. + * sp36/.cvsignore, sp36/Makefile.am, sp36/sp36.doc, + sp36/sp36.scn: New files. + 2007-12-20 Joel Sherrill * sp07/task1.c, sp34/changepri.c, sp35/priinv.c: Add rtems_task_self() diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am index 71f98fbf60..2f5c12c9cf 100644 --- a/testsuites/sptests/Makefile.am +++ b/testsuites/sptests/Makefile.am @@ -7,7 +7,7 @@ ACLOCAL_AMFLAGS = -I ../aclocal ## spfatal is not included for now 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 \ - sp30 sp31 sp32 sp33 sp34 sp35 sp37 spsize + sp30 sp31 sp32 sp33 sp34 sp35 sp36 sp37 spsize DIST_SUBDIRS = $(SUBDIRS) spfatal include $(top_srcdir)/../automake/subdirs.am diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac index 706bdb30f1..95333af8d6 100644 --- a/testsuites/sptests/configure.ac +++ b/testsuites/sptests/configure.ac @@ -60,6 +60,7 @@ sp32/Makefile sp33/Makefile sp34/Makefile sp35/Makefile +sp36/Makefile sp37/Makefile spsize/Makefile spfatal/Makefile diff --git a/testsuites/sptests/sp36/.cvsignore b/testsuites/sptests/sp36/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/testsuites/sptests/sp36/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/testsuites/sptests/sp36/Makefile.am b/testsuites/sptests/sp36/Makefile.am new file mode 100644 index 0000000000..6e837e83e0 --- /dev/null +++ b/testsuites/sptests/sp36/Makefile.am @@ -0,0 +1,26 @@ +## +## $Id$ +## + +MANAGERS = all + +rtems_tests_PROGRAMS = sp36.exe +sp36_exe_SOURCES = strict_order_mut.c + +dist_rtems_tests_DATA = sp36.scn +dist_rtems_tests_DATA += sp36.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 = $(sp36_exe_OBJECTS) $(sp36_exe_LDADD) +LINK_LIBS = $(sp36_exe_LDLIBS) + +sp36.exe$(EXEEXT): $(sp36_exe_OBJECTS) $(sp36_exe_DEPENDENCIES) + @rm -f sp36.exe$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/sptests/sp36/sp36.doc b/testsuites/sptests/sp36/sp36.doc new file mode 100644 index 0000000000..d67943b93a --- /dev/null +++ b/testsuites/sptests/sp36/sp36.doc @@ -0,0 +1,42 @@ +This is a simple test program to demonstrate strict order mutex. + +1)What's strict order mutex ? + + In rtems,when a task release a priority_inheritance or + priority ceiling semaphore,the kernel detect whether + this task holds priority_inheritance or priority + ceiling semaphore, if not, set the priority of task + back to real priority of task. + This method is right, but in theory, we would like + to reset the priority after releasing the mutex if + releasing it in LIFO order.Do it like this can decrease + the blocking time of a higher priority task . + +2)How to enable "strict order mutex " ? + + When configuring the rtems , add + ENABLE_STRICT_ORDER_MUTEX=1 + to your configure parameter. + + +3)About this test program + + T0,T1,S0,S1 + + T0,priority 4 + T1,priority 1 + + S0,priority inheritance + S1,priority ceiling,priority ceiling 1 + + 1,T0 obtain S0 then obtain S1, priority of T0 should be improved to 1 + 2,T0 try to release S0, but not in strict order, return error code + 3,T0 release S1,the priority of T0 back to 4 + 4,T1 try to obtain S0 + 5,T1 should be blocked and the priority of T0 should be improved to 1 + 6,T0 release S0 + 7,T1 obtain S0 + 8,OVER. + + + diff --git a/testsuites/sptests/sp36/sp36.scn b/testsuites/sptests/sp36/sp36.scn new file mode 100644 index 0000000000..e69de29bb2 -- cgit v1.2.3