mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1414/cpukit * Makefile.am, configure.ac: Tighten math on extraction of index so it is harder to trick by passing in a valid id of an incorrect object class. * sp49/.cvsignore, sp49/Makefile.am, sp49/init.c, sp49/sp49.doc, sp49/sp49.scn: New files.
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
PR 1414/cpukit
|
||||
* Makefile.am, configure.ac: Tighten math on extraction of index so it
|
||||
is harder to trick by passing in a valid id of an incorrect object
|
||||
class.
|
||||
* sp49/.cvsignore, sp49/Makefile.am, sp49/init.c, sp49/sp49.doc,
|
||||
sp49/sp49.scn: New files.
|
||||
|
||||
2009-05-19 Chris Johns <chrisj@rtems.org>
|
||||
|
||||
* sp04/tswitch.c: Lower sample count for small memory targets.
|
||||
|
||||
@@ -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 spsize spwatchdog spfatal01 spfatal02 spfatal03 \
|
||||
sp45 sp46 sp47 sp48 sp49 spsize spwatchdog spfatal01 spfatal02 spfatal03 \
|
||||
spfatal04 spfatal05 spfatal06 spfatal07 spfatal08 spfatal09 spobjgetnext \
|
||||
spprintk spwkspace
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ sp45/Makefile
|
||||
sp46/Makefile
|
||||
sp47/Makefile
|
||||
sp48/Makefile
|
||||
sp49/Makefile
|
||||
spwatchdog/Makefile
|
||||
spsize/Makefile
|
||||
spfatal/Makefile
|
||||
|
||||
2
testsuites/sptests/sp49/.cvsignore
Normal file
2
testsuites/sptests/sp49/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
28
testsuites/sptests/sp49/Makefile.am
Normal file
28
testsuites/sptests/sp49/Makefile.am
Normal file
@@ -0,0 +1,28 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
rtems_tests_PROGRAMS = sp49
|
||||
sp49_SOURCES = init.c
|
||||
|
||||
dist_rtems_tests_DATA = sp49.scn
|
||||
dist_rtems_tests_DATA += sp49.doc
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
|
||||
sp49_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||
|
||||
LINK_OBJS = $(sp49_OBJECTS) $(sp49_LDADD)
|
||||
LINK_LIBS = $(sp49_LDLIBS)
|
||||
|
||||
sp49$(EXEEXT): $(sp49_OBJECTS) $(sp49_DEPENDENCIES)
|
||||
@rm -f sp49$(EXEEXT)
|
||||
$(make-exe)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
54
testsuites/sptests/sp49/init.c
Normal file
54
testsuites/sptests/sp49/init.c
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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 ignored)
|
||||
{
|
||||
rtems_status_code sc;
|
||||
rtems_id q;
|
||||
uint32_t flushed;
|
||||
|
||||
puts( "\n\n*** TEST 49 ***" );
|
||||
|
||||
puts( "Create Message Queue" );
|
||||
sc = rtems_message_queue_create(
|
||||
rtems_build_name('m', 's', 'g', ' '),
|
||||
1,
|
||||
sizeof(uint32_t),
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&q
|
||||
);
|
||||
directive_failed( sc, "rtems_message_queue_create" );
|
||||
|
||||
puts( "Flush Message Queue using Task Self ID" );
|
||||
sc = rtems_message_queue_flush( rtems_task_self(), &flushed );
|
||||
fatal_directive_status( sc, RTEMS_INVALID_ID, "flush" );
|
||||
|
||||
puts( "Flush returned INVALID_ID as expected" );
|
||||
|
||||
puts( "*** END OF TEST 49 ***" );
|
||||
rtems_test_exit( 0 );
|
||||
}
|
||||
|
||||
/* configuration stuff */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 1
|
||||
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
|
||||
#define CONFIGURE_MESSAGE_BUFFER_MEMORY 256 /* overkill */
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include <rtems/confdefs.h>
|
||||
25
testsuites/sptests/sp49/sp49.doc
Normal file
25
testsuites/sptests/sp49/sp49.doc
Normal file
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# COPYRIGHT (c) 1989-2008.
|
||||
# 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: sp49
|
||||
|
||||
directives:
|
||||
|
||||
rtems_task_self
|
||||
rtems_message_queue_create
|
||||
rtems_message_queue_flush
|
||||
|
||||
concepts:
|
||||
|
||||
+ Ensure that the id for a task cannot be used to operate upon
|
||||
another object.
|
||||
5
testsuites/sptests/sp49/sp49.scn
Normal file
5
testsuites/sptests/sp49/sp49.scn
Normal file
@@ -0,0 +1,5 @@
|
||||
*** TEST 49 ***
|
||||
Create Message Queue
|
||||
Flush Message Queue using Task Self ID
|
||||
Flush returned INVALID_ID as expected
|
||||
*** END OF TEST 49 ***
|
||||
Reference in New Issue
Block a user