forked from Imagelibrary/rtems
2007-12-21 Xi Yang <hiyangxi@gmail.com>
* 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.
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2007-12-21 Xi Yang <hiyangxi@gmail.com>
|
||||
|
||||
* 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 <joel.sherrill@oarcorp.com>
|
||||
|
||||
* sp07/task1.c, sp34/changepri.c, sp35/priinv.c: Add rtems_task_self()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -60,6 +60,7 @@ sp32/Makefile
|
||||
sp33/Makefile
|
||||
sp34/Makefile
|
||||
sp35/Makefile
|
||||
sp36/Makefile
|
||||
sp37/Makefile
|
||||
spsize/Makefile
|
||||
spfatal/Makefile
|
||||
|
||||
2
testsuites/sptests/sp36/.cvsignore
Normal file
2
testsuites/sptests/sp36/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
26
testsuites/sptests/sp36/Makefile.am
Normal file
26
testsuites/sptests/sp36/Makefile.am
Normal file
@@ -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
|
||||
42
testsuites/sptests/sp36/sp36.doc
Normal file
42
testsuites/sptests/sp36/sp36.doc
Normal file
@@ -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.
|
||||
|
||||
|
||||
|
||||
0
testsuites/sptests/sp36/sp36.scn
Normal file
0
testsuites/sptests/sp36/sp36.scn
Normal file
Reference in New Issue
Block a user