change log for rtems (2010-06-20)

rtems-vc at rtems.org rtems-vc at rtems.org
Sun Jun 20 20:11:57 UTC 2010


 *joel*:
2010-06-20	Joel Sherrill <joel.sherrill at oarcorp.com>

	* sapi/include/confdefs.h: Add parameters for FIFOs and pipes since
	they are distinct to the user.

M 1.2443  cpukit/ChangeLog
M  1.143  cpukit/sapi/include/confdefs.h

diff -u rtems/cpukit/ChangeLog:1.2442 rtems/cpukit/ChangeLog:1.2443
--- rtems/cpukit/ChangeLog:1.2442	Sat Jun 19 18:39:55 2010
+++ rtems/cpukit/ChangeLog	Sun Jun 20 14:41:32 2010
@@ -1,3 +1,8 @@
+2010-06-20	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* sapi/include/confdefs.h: Add parameters for FIFOs and pipes since
+	they are distinct to the user.
+
 2010-06-19	Joel Sherrill <joel.sherrilL at OARcorp.com>
 
 	* sapi/include/confdefs.h: Add CONFIGURE_MAXIMUM_FIFOS to account for

diff -u rtems/cpukit/sapi/include/confdefs.h:1.142 rtems/cpukit/sapi/include/confdefs.h:1.143
--- rtems/cpukit/sapi/include/confdefs.h:1.142	Sat Jun 19 18:39:56 2010
+++ rtems/cpukit/sapi/include/confdefs.h	Sun Jun 20 14:41:33 2010
@@ -288,11 +288,10 @@
 #endif
 
 /**
- *  It should be called FIFOs not pipes
+ *  Internall it is called FIFOs not pipes
  */
 #if defined(CONFIGURE_PIPES_ENABLED)
   #define CONFIGURE_FIFOS_ENABLED
-  #warning "Use CONFIGURE_FIFOS_ENABLED not CONFIGURE_PIPES_ENABLED"
 #endif
 
 /**
@@ -313,11 +312,19 @@
  *  This sets up the resources for the PIPES/FIFOs
  */
 #if defined(CONFIGURE_FIFOS_ENABLED)
+  #if !defined(CONFIGURE_MAXIMUM_FIFOS) && !defined(CONFIGURE_MAXIMUM_PIPES)
+     #error "No FIFOs or PIPES configured"
+  #endif
   #if !defined(CONFIGURE_MAXIMUM_FIFOS)
-    #error "FIFOs enabled but no FIFOs configured."
+    #define CONFIGURE_MAXIMUM_FIFOS 0
+  #endif
+  #if !defined(CONFIGURE_MAXIMUM_PIPES)
+    #define CONFIGURE_MAXIMUM_PIPES 0
   #endif
-  #define CONFIGURE_BARRIERS_FOR_FIFOS   (2 * CONFIGURE_MAXIMUM_FIFOS)
-  #define CONFIGURE_SEMAPHORES_FOR_FIFOS (1 + CONFIGURE_MAXIMUM_FIFOS)
+  #define CONFIGURE_BARRIERS_FOR_FIFOS \
+    (2 * (CONFIGURE_MAXIMUM_FIFOS + CONFIGURE_MAXIMUM_PIPES))
+  #define CONFIGURE_SEMAPHORES_FOR_FIFOS \
+    (1 + (CONFIGURE_MAXIMUM_FIFOS + CONFIGURE_MAXIMUM_PIPES))
 #else
   #define CONFIGURE_BARRIERS_FOR_FIFOS   0
   #define CONFIGURE_SEMAPHORES_FOR_FIFOS 0


 *joel*:
2010-06-20	Joel Sherrill <joel.sherrill at oarcorp.com>

	* Makefile.am, configure.ac: New test for error cases in FIFO creation.
	* spfifo08/.cvsignore, spfifo08/Makefile.am, spfifo08/init.c,
	spfifo08/spfifo08.doc, spfifo08/spfifo08.scn: New files.

M  1.375  testsuites/sptests/ChangeLog
M   1.87  testsuites/sptests/Makefile.am
M   1.92  testsuites/sptests/configure.ac
A    1.1  testsuites/sptests/spfifo08/.cvsignore
A    1.1  testsuites/sptests/spfifo08/Makefile.am
A    1.1  testsuites/sptests/spfifo08/init.c
A    1.1  testsuites/sptests/spfifo08/spfifo08.doc
A    1.1  testsuites/sptests/spfifo08/spfifo08.scn

diff -u rtems/testsuites/sptests/ChangeLog:1.374 rtems/testsuites/sptests/ChangeLog:1.375
--- rtems/testsuites/sptests/ChangeLog:1.374	Sat Jun 19 15:55:03 2010
+++ rtems/testsuites/sptests/ChangeLog	Sun Jun 20 14:48:02 2010
@@ -1,3 +1,9 @@
+2010-06-20	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* Makefile.am, configure.ac: New test for error cases in FIFO creation.
+	* spfifo08/.cvsignore, spfifo08/Makefile.am, spfifo08/init.c,
+	spfifo08/spfifo08.doc, spfifo08/spfifo08.scn: New files.
+
 2010-06-19	Joel Sherrill <joel.sherrill at oarcorp.com>
 
 	* sp09/screen01.c, sp09/sp09.scn, sp43/init.c, sp43/sp43.scn,

diff -u rtems/testsuites/sptests/Makefile.am:1.86 rtems/testsuites/sptests/Makefile.am:1.87
--- rtems/testsuites/sptests/Makefile.am:1.86	Sat Jun 19 11:01:27 2010
+++ rtems/testsuites/sptests/Makefile.am	Sun Jun 20 14:48:02 2010
@@ -19,7 +19,7 @@
     spstkalloc spthreadq01 spwatchdog spwkspace \
     spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \
     spfatal08 spfatal09 spfatal10 spfatal11 spfatal12 spfatal13 \
-    spfifo01 spfifo02 spfifo03 spfifo04 \
+    spfifo01 spfifo02 spfifo03 spfifo04 spfifo08 \
     spintrcritical01 spintrcritical02 spintrcritical03 spintrcritical04 \
     spintrcritical05 spintrcritical06 spintrcritical07 spintrcritical08 \
     spintrcritical09 spintrcritical10 spintrcritical11 spintrcritical12 \

diff -u rtems/testsuites/sptests/configure.ac:1.91 rtems/testsuites/sptests/configure.ac:1.92
--- rtems/testsuites/sptests/configure.ac:1.91	Sat Jun 19 11:01:27 2010
+++ rtems/testsuites/sptests/configure.ac	Sun Jun 20 14:48:03 2010
@@ -116,6 +116,7 @@
 spfifo02/Makefile
 spfifo03/Makefile
 spfifo04/Makefile
+spfifo08/Makefile
 spintrcritical01/Makefile
 spintrcritical02/Makefile
 spintrcritical03/Makefile

diff -u /dev/null rtems/testsuites/sptests/spfifo08/.cvsignore:1.1
--- /dev/null	Sun Jun 20 15:11:56 2010
+++ rtems/testsuites/sptests/spfifo08/.cvsignore	Sun Jun 20 14:48:03 2010
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in

diff -u /dev/null rtems/testsuites/sptests/spfifo08/Makefile.am:1.1
--- /dev/null	Sun Jun 20 15:11:56 2010
+++ rtems/testsuites/sptests/spfifo08/Makefile.am	Sun Jun 20 14:48:03 2010
@@ -0,0 +1,26 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = spfifo08
+spfifo08_SOURCES = init.c ../../support/src/spin.c
+
+dist_rtems_tests_DATA = spfifo08.scn
+dist_rtems_tests_DATA += spfifo08.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(spfifo08_OBJECTS) $(spfifo08_LDADD)
+LINK_LIBS = $(spfifo08_LDLIBS)
+
+spfifo08$(EXEEXT): $(spfifo08_OBJECTS) $(spfifo08_DEPENDENCIES)
+	@rm -f spfifo08$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am

diff -u /dev/null rtems/testsuites/sptests/spfifo08/init.c:1.1
--- /dev/null	Sun Jun 20 15:11:56 2010
+++ rtems/testsuites/sptests/spfifo08/init.c	Sun Jun 20 14:48:03 2010
@@ -0,0 +1,165 @@
+/*
+ *  COPYRIGHT (c) 1989-2010.
+ *  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>
+#include "test_support.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#define MAXIMUM 10
+rtems_id Barriers[MAXIMUM];
+int BarrierCount;
+
+rtems_id Semaphores[MAXIMUM];
+int SemaphoreCount;
+
+void create_all_barriers(void)
+{
+  rtems_status_code status;
+  int               i;
+
+  BarrierCount = 0;
+
+  for ( i=0 ; i<MAXIMUM ; i++ ) {
+    status = rtems_barrier_create(
+      rtems_build_name( 'B', 'A', 'R', 0x30+i ),
+      RTEMS_BARRIER_MANUAL_RELEASE,
+      0,
+      &Barriers[i]
+    );
+    if ( status == RTEMS_TOO_MANY ) {
+      printf( "%d Barriers created\n", BarrierCount );
+      return;
+    } 
+
+    directive_failed( status, "barrier create" );
+    BarrierCount++;
+  }
+}
+
+void create_all_semaphores(void)
+{
+  rtems_status_code status;
+  int               i;
+
+  SemaphoreCount = 0;
+
+  for ( i=0 ; i<MAXIMUM ; i++ ) {
+    status = rtems_semaphore_create(
+      rtems_build_name( 'S', 'E', 'M', 0x30+i ),
+      0,
+      RTEMS_DEFAULT_ATTRIBUTES,
+      0,
+      &Semaphores[i]
+    );
+    if ( status == RTEMS_TOO_MANY ) {
+      printf( "%d Semaphores created\n", SemaphoreCount );
+      return;
+    } 
+
+    directive_failed( status, "semaphore create" );
+    SemaphoreCount++;
+  }
+}
+
+void delete_barrier(void)
+{
+  rtems_status_code status;
+  
+  puts( "Deleting a barrier" );
+  status = rtems_barrier_delete( Barriers[BarrierCount] );
+  directive_failed( status, "barrier delete" );
+}
+
+void delete_semaphore(void)
+{
+  rtems_status_code status;
+  
+  puts( "Deleting a semaphore" );
+  status = rtems_semaphore_delete( Semaphores[SemaphoreCount] );
+  directive_failed( status, "semaphore delete" );
+}
+
+void create_fifo(void)
+{
+  int status;
+
+  status = mkfifo("/fifo01", 0777);
+  rtems_test_assert(status == 0);
+}
+
+void open_fifo(int expected)
+{
+  int fd;
+
+  fd = open("/fifo01", O_RDONLY);
+  printf( "status=%d errno=%d/(%s)\n", fd, errno, strerror(errno) );
+  if ( expected ) {
+    rtems_test_assert(fd == -1);
+    rtems_test_assert(errno == expected);
+  } else {
+    rtems_test_assert(fd != -1);
+    close( fd );
+  }
+}
+
+rtems_task Init(
+  rtems_task_argument argument
+)
+{
+  puts( "\n\n*** TEST FIFO 08 ***" );
+
+  puts( "Creating all barriers" );
+  create_all_barriers();
+
+  puts( "Creating all semaphores" );
+  create_all_semaphores();
+
+  puts( "Creating FIFO" );
+  create_fifo();
+  
+  puts( "Opening FIFO.. expect ENOMEM (barrier - case 1)" );
+  open_fifo(ENOMEM);
+
+  delete_barrier();
+  puts( "Opening FIFO.. expect ENOMEM (barrier - case 2)" );
+  open_fifo(ENOMEM);
+
+  delete_barrier();
+  puts( "Opening FIFO.. expect ENOMEM (semaphore - case 1)" );
+
+  open_fifo(0);
+  
+  puts( "*** END OF TEST FIFO 08 ***" );
+
+  rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS             1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 5
+#define CONFIGURE_FIFOS_ENABLED
+#define CONFIGURE_MAXIMUM_FIFOS 1
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */

diff -u /dev/null rtems/testsuites/sptests/spfifo08/spfifo08.doc:1.1
--- /dev/null	Sun Jun 20 15:11:56 2010
+++ rtems/testsuites/sptests/spfifo08/spfifo08.doc	Sun Jun 20 14:48:03 2010
@@ -0,0 +1,24 @@
+#
+#  $Id$
+#
+#  COPYRIGHT (c) 1989-2010.
+#  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:  spfifo08
+
+directives:
+
+   mkfifo()
+   open() - on FIFOs
+
+concepts:
+
++ memory allocation error cases 
++ resource allocation error cases 

diff -u /dev/null rtems/testsuites/sptests/spfifo08/spfifo08.scn:1.1
--- /dev/null	Sun Jun 20 15:11:56 2010
+++ rtems/testsuites/sptests/spfifo08/spfifo08.scn	Sun Jun 20 14:48:03 2010
@@ -0,0 +1 @@
+XXX fill in with test output



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100620/6acb755a/attachment.html>


More information about the vc mailing list