2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com>

PR 1415/cpukit
	* Makefile.am, configure.ac: Add test for very simple priority ceiling
	violation.
	* sp51/.cvsignore, sp51/Makefile.am, sp51/init.c, sp51/sp51.doc,
	sp51/sp51.scn: New files.
This commit is contained in:
Joel Sherrill
2009-05-21 19:40:07 +00:00
parent 8abaa16177
commit e379e962b3
8 changed files with 128 additions and 1 deletions

View File

@@ -1,3 +1,11 @@
2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1415/cpukit
* Makefile.am, configure.ac: Add test for very simple priority ceiling
violation.
* sp51/.cvsignore, sp51/Makefile.am, sp51/init.c, sp51/sp51.doc,
sp51/sp51.scn: New files.
2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1413/cpukit

View File

@@ -8,7 +8,7 @@ ACLOCAL_AMFLAGS = -I ../aclocal
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 sp38 sp39 sp40 sp41 sp42 sp43 sp44 \
sp45 sp46 sp47 sp48 sp49 sp50 spsize spwatchdog \
sp45 sp46 sp47 sp48 sp49 sp50 sp51 spsize spwatchdog \
spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \
spfatal08 spfatal09 spobjgetnext \
spprintk spwkspace

View File

@@ -75,6 +75,7 @@ sp47/Makefile
sp48/Makefile
sp49/Makefile
sp50/Makefile
sp51/Makefile
spwatchdog/Makefile
spsize/Makefile
spfatal/Makefile

View File

@@ -0,0 +1,2 @@
Makefile
Makefile.in

View File

@@ -0,0 +1,28 @@
##
## $Id$
##
MANAGERS = all
rtems_tests_PROGRAMS = sp51
sp51_SOURCES = init.c
dist_rtems_tests_DATA = sp51.scn
dist_rtems_tests_DATA += sp51.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
include $(top_srcdir)/../automake/leaf.am
sp51_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
LINK_OBJS = $(sp51_OBJECTS) $(sp51_LDADD)
LINK_LIBS = $(sp51_LDLIBS)
sp51$(EXEEXT): $(sp51_OBJECTS) $(sp51_DEPENDENCIES)
@rm -f sp51$(EXEEXT)
$(make-exe)
include $(top_srcdir)/../automake/local.am

View File

@@ -0,0 +1,60 @@
/*
* 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>
rtems_task Init(
rtems_task_argument argument
)
{
rtems_status_code sc;
rtems_id mutex;
puts( "\n\n*** TEST 51 ***" );
puts( "Create semaphore" );
sc = rtems_semaphore_create(
rtems_build_name( 'S', 'E', 'M', '1' ),
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY_CEILING | RTEMS_PRIORITY,
(RTEMS_MAXIMUM_PRIORITY - 4u),
&mutex
);
directive_failed( sc, "rtems_semaphore_create" );
puts( "Obtain semaphore -- violate ceiling" );
sc = rtems_semaphore_obtain( mutex, RTEMS_DEFAULT_OPTIONS, 0 );
fatal_directive_status( sc, RTEMS_INTERNAL_ERROR, "rtems_semaphore_obtain" );
puts( "Release semaphore we did not obtain-- violate ceiling" );
sc = rtems_semaphore_release( mutex );
fatal_directive_status(
sc, RTEMS_NOT_OWNER_OF_RESOURCE, "rtems_semaphore_release" );
puts( "*** END OF TEST 51 ***" );
rtems_test_exit( 0 );
}
/**************** START OF CONFIGURATION INFORMATION ****************/
#define CONFIGURE_INIT
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 1
#define CONFIGURE_MAXIMUM_SEMAPHORES 1
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h>
/**************** END OF CONFIGURATION INFORMATION ****************/

View 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: sp51
directives:
rtems_semaphore_create
rtems_semaphore_obtain
rtems_semaphore_mutex
concepts:
+ Ensure that obtaining a binary semaphore with priority ceiling enabled
properly detects a ceiling violation when there is no conflict.
+ Ensure the when the binary semaphore lock fails to acquire the mutex,
it is an error to release it since the lock failed.

View File