<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2010-06-08)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>sh</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-06-08 Sebastian Huber <sebastian.huber@embedded-brains.de>

        * libfs/src/imfs/fifoimfs_init.c: New file.
        * libfs/Makefile.am: Reflect change above.
        * libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_eval.c,
        libfs/src/imfs/imfs_init.c, libfs/src/imfs/imfs_initsupp.c,
        libfs/src/imfs/miniimfs_init.c, libfs/src/pipe/fifo.c,
        libfs/src/pipe/pipe.c, libfs/src/pipe/pipe.h: Pipe support is now
        link-time optional.
        * sapi/include/confdefs.h: Reflect changes above.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2353&r2=text&tr2=1.2354&diff_format=h">M</a></td><td width='1%'>1.2354</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/Makefile.am.diff?r1=text&tr1=1.40&r2=text&tr2=1.41&diff_format=h">M</a></td><td width='1%'>1.41</td><td width='100%'>cpukit/libfs/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/imfs/fifoimfs_init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/libfs/src/imfs/fifoimfs_init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/imfs/imfs.h.diff?r1=text&tr1=1.42&r2=text&tr2=1.43&diff_format=h">M</a></td><td width='1%'>1.43</td><td width='100%'>cpukit/libfs/src/imfs/imfs.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/imfs/imfs_eval.c.diff?r1=text&tr1=1.26&r2=text&tr2=1.27&diff_format=h">M</a></td><td width='1%'>1.27</td><td width='100%'>cpukit/libfs/src/imfs/imfs_eval.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/imfs/imfs_init.c.diff?r1=text&tr1=1.17&r2=text&tr2=1.18&diff_format=h">M</a></td><td width='1%'>1.18</td><td width='100%'>cpukit/libfs/src/imfs/imfs_init.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/imfs/imfs_initsupp.c.diff?r1=text&tr1=1.21&r2=text&tr2=1.22&diff_format=h">M</a></td><td width='1%'>1.22</td><td width='100%'>cpukit/libfs/src/imfs/imfs_initsupp.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/imfs/miniimfs_init.c.diff?r1=text&tr1=1.14&r2=text&tr2=1.15&diff_format=h">M</a></td><td width='1%'>1.15</td><td width='100%'>cpukit/libfs/src/imfs/miniimfs_init.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/pipe/fifo.c.diff?r1=text&tr1=1.4&r2=text&tr2=1.5&diff_format=h">M</a></td><td width='1%'>1.5</td><td width='100%'>cpukit/libfs/src/pipe/fifo.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/pipe/pipe.h.diff?r1=text&tr1=1.3&r2=text&tr2=1.4&diff_format=h">M</a></td><td width='1%'>1.4</td><td width='100%'>cpukit/libfs/src/pipe/pipe.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/pipe/pipe.c.diff?r1=text&tr1=1.4&r2=text&tr2=1.5&diff_format=h">M</a></td><td width='1%'>1.5</td><td width='100%'>cpukit/libfs/src/pipe/pipe.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/sapi/include/confdefs.h.diff?r1=text&tr1=1.136&r2=text&tr2=1.137&diff_format=h">M</a></td><td width='1%'>1.137</td><td width='100%'>cpukit/sapi/include/confdefs.h</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2353 rtems/cpukit/ChangeLog:1.2354
--- rtems/cpukit/ChangeLog:1.2353       Tue Jun  8 03:50:57 2010
+++ rtems/cpukit/ChangeLog      Tue Jun  8 05:25:36 2010
</font><font color='#997700'>@@ -1,5 +1,16 @@
</font> 2010-06-08        Sebastian Huber <sebastian.huber@embedded-brains.de>
 
<font color='#000088'>+   * libfs/src/imfs/fifoimfs_init.c: New file.
+       * libfs/Makefile.am: Reflect change above.
+       * libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_eval.c,
+       libfs/src/imfs/imfs_init.c, libfs/src/imfs/imfs_initsupp.c,
+       libfs/src/imfs/miniimfs_init.c, libfs/src/pipe/fifo.c,
+       libfs/src/pipe/pipe.c, libfs/src/pipe/pipe.h: Pipe support is now
+       link-time optional.
+       * sapi/include/confdefs.h: Reflect changes above.
+
+2010-06-08     Sebastian Huber <sebastian.huber@embedded-brains.de>
+
</font>   * libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_rmnod.c: Added and use
        IMFS_create_orphan() and IMFS_check_node_remove().
        * libfs/src/imfs/deviceio.c, libfs/src/imfs/imfs_directory.c,

<font color='#006600'>diff -u rtems/cpukit/libfs/Makefile.am:1.40 rtems/cpukit/libfs/Makefile.am:1.41
--- rtems/cpukit/libfs/Makefile.am:1.40 Thu Mar  4 00:36:50 2010
+++ rtems/cpukit/libfs/Makefile.am      Tue Jun  8 05:25:45 2010
</font><font color='#997700'>@@ -31,7 +31,7 @@
</font>     src/imfs/imfs_debug.c src/imfs/imfs_rmnod.c src/imfs/imfs_symlink.c \
     src/imfs/imfs_readlink.c src/imfs/imfs_fdatasync.c src/imfs/imfs_fcntl.c \
     src/imfs/ioman.c src/imfs/miniimfs_init.c src/imfs/imfs_load_tar.c \
<font color='#880000'>-    src/imfs/imfs_rename.c src/imfs/imfs.h \
</font><font color='#000088'>+    src/imfs/imfs_rename.c src/imfs/fifoimfs_init.c src/imfs/imfs.h \
</font>     src/imfs/deviceerrno.c \
     src/devfs/devfs_init.c src/devfs/devfs_eval.c src/devfs/devfs_mknod.c \
     src/devfs/devfs_show.c src/devfs/devfs_node_type.c \

<font color='#006600'>diff -u /dev/null rtems/cpukit/libfs/src/imfs/fifoimfs_init.c:1.1
--- /dev/null   Tue Jun  8 06:11:20 2010
+++ rtems/cpukit/libfs/src/imfs/fifoimfs_init.c Tue Jun  8 05:25:40 2010
</font><font color='#997700'>@@ -0,0 +1,61 @@
</font><font color='#000088'>+/**
+ * @file
+ *
+ * @ingroup LibFSIMFS
+ *
+ * @brief IMFS without fifo support initialization.
+ */
+
+/*
+ * Copyright (c) 2010
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * D-82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * 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.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "imfs.h"
+
+static const rtems_filesystem_operations_table fifoIMFS_ops = {
+  .evalpath_h = IMFS_eval_path,
+  .evalformake_h = IMFS_evaluate_for_make,
+  .link_h = IMFS_link,
+  .unlink_h = IMFS_unlink,
+  .node_type_h = IMFS_node_type,
+  .mknod_h = IMFS_mknod,
+  .chown_h = IMFS_chown,
+  .freenod_h = IMFS_freenodinfo,
+  .mount_h = IMFS_mount,
+  .fsmount_me_h = fifoIMFS_initialize,
+  .unmount_h = IMFS_unmount,
+  .fsunmount_me_h = IMFS_fsunmount,
+  .utime_h = IMFS_utime,
+  .eval_link_h = IMFS_evaluate_link,
+  .symlink_h = IMFS_symlink,
+  .readlink_h = IMFS_readlink,
+  .rename_h = IMFS_rename,
+  .statvfs_h = NULL
+};
+
+int fifoIMFS_initialize(
+  rtems_filesystem_mount_table_entry_t *mt_entry,
+  const void *data
+)
+{
+  return IMFS_initialize_support(
+    mt_entry,
+    &fifoIMFS_ops,
+    &IMFS_memfile_handlers,
+    &IMFS_directory_handlers,
+    &IMFS_fifo_handlers
+  );
+}
</font>
<font color='#006600'>diff -u rtems/cpukit/libfs/src/imfs/imfs.h:1.42 rtems/cpukit/libfs/src/imfs/imfs.h:1.43
--- rtems/cpukit/libfs/src/imfs/imfs.h:1.42     Tue Jun  8 03:50:54 2010
+++ rtems/cpukit/libfs/src/imfs/imfs.h  Tue Jun  8 05:25:44 2010
</font><font color='#997700'>@@ -223,6 +223,7 @@
</font>   ino_t                                   ino_count;
   const rtems_filesystem_file_handlers_r *memfile_handlers;
   const rtems_filesystem_file_handlers_r *directory_handlers;
<font color='#000088'>+  const rtems_filesystem_file_handlers_r *fifo_handlers;
</font> } IMFS_fs_info_t;
 
 /*
<font color='#997700'>@@ -247,7 +248,6 @@
</font> extern const rtems_filesystem_file_handlers_r       IMFS_memfile_handlers;
 extern const rtems_filesystem_file_handlers_r       IMFS_fifo_handlers;
 extern const rtems_filesystem_operations_table      IMFS_ops;
<font color='#880000'>-extern const rtems_filesystem_operations_table      miniIMFS_ops;
</font> extern const rtems_filesystem_limits_and_options_t  IMFS_LIMITS_AND_OPTIONS;
 
 /*
<font color='#997700'>@@ -259,6 +259,11 @@
</font>    const void                           *data
 );
 
<font color='#000088'>+extern int fifoIMFS_initialize(
+  rtems_filesystem_mount_table_entry_t  *mt_entry,
+  const void                            *data
+);
+
</font> extern int miniIMFS_initialize(
    rtems_filesystem_mount_table_entry_t *mt_entry,
    const void                           *data
<font color='#997700'>@@ -268,7 +273,8 @@
</font>    rtems_filesystem_mount_table_entry_t       *mt_entry,
    const rtems_filesystem_operations_table    *op_table,
    const rtems_filesystem_file_handlers_r     *memfile_handlers,
<font color='#880000'>-   const rtems_filesystem_file_handlers_r     *directory_handlers
</font><font color='#000088'>+   const rtems_filesystem_file_handlers_r     *directory_handlers,
+   const rtems_filesystem_file_handlers_r     *fifo_handlers
</font> );
 
 extern int IMFS_fsunmount(

<font color='#006600'>diff -u rtems/cpukit/libfs/src/imfs/imfs_eval.c:1.26 rtems/cpukit/libfs/src/imfs/imfs_eval.c:1.27
--- rtems/cpukit/libfs/src/imfs/imfs_eval.c:1.26        Mon May 31 08:56:36 2010
+++ rtems/cpukit/libfs/src/imfs/imfs_eval.c     Tue Jun  8 05:25:44 2010
</font><font color='#997700'>@@ -58,7 +58,7 @@
</font>       loc->handlers = fs_info->memfile_handlers;
       break;
     case IMFS_FIFO:
<font color='#880000'>-      loc->handlers = &IMFS_fifo_handlers;
</font><font color='#000088'>+      loc->handlers = fs_info->fifo_handlers;
</font>       break;
   }
 

<font color='#006600'>diff -u rtems/cpukit/libfs/src/imfs/imfs_init.c:1.17 rtems/cpukit/libfs/src/imfs/imfs_init.c:1.18
--- rtems/cpukit/libfs/src/imfs/imfs_init.c:1.17        Mon May 31 08:56:36 2010
+++ rtems/cpukit/libfs/src/imfs/imfs_init.c     Tue Jun  8 05:25:44 2010
</font><font color='#997700'>@@ -1,6 +1,12 @@
</font><font color='#880000'>-/*
- *  IMFS Initialization
</font><font color='#000088'>+/**
+ * @file
+ *
+ * @ingroup LibFSIMFS
</font>  *
<font color='#000088'>+ * @brief IMFS initialization.
+ */
+
+/*
</font>  *  COPYRIGHT (c) 1989-1999.
  *  On-Line Applications Research Corporation (OAR).
  *
<font color='#997700'>@@ -15,58 +21,41 @@
</font> #include "config.h"
 #endif
 
<font color='#880000'>-#include <sys/types.h>         /* for mkdir */
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-#include <assert.h>
-
-#include "imfs.h"
</font> #include <rtems/libio_.h>
 
<font color='#880000'>-#if defined(IMFS_DEBUG)
-#include <stdio.h>
-#endif
-
-/*
- *  IMFS file system operations table
- */
</font><font color='#000088'>+#include "imfs.h"
</font> 
<font color='#880000'>-const rtems_filesystem_operations_table  IMFS_ops = {
-  IMFS_eval_path,
-  IMFS_evaluate_for_make,
-  IMFS_link,
-  IMFS_unlink,
-  IMFS_node_type,
-  IMFS_mknod,
-  IMFS_chown,
-  IMFS_freenodinfo,
-  IMFS_mount,
-  IMFS_initialize,
-  IMFS_unmount,
-  IMFS_fsunmount,
-  IMFS_utime,
-  IMFS_evaluate_link,
-  IMFS_symlink,
-  IMFS_readlink,
-  IMFS_rename,
-  NULL
</font><font color='#000088'>+const rtems_filesystem_operations_table IMFS_ops = {
+  .evalpath_h = IMFS_eval_path,
+  .evalformake_h = IMFS_evaluate_for_make,
+  .link_h = IMFS_link,
+  .unlink_h = IMFS_unlink,
+  .node_type_h = IMFS_node_type,
+  .mknod_h = IMFS_mknod,
+  .chown_h = IMFS_chown,
+  .freenod_h = IMFS_freenodinfo,
+  .mount_h = IMFS_mount,
+  .fsmount_me_h = IMFS_initialize,
+  .unmount_h = IMFS_unmount,
+  .fsunmount_me_h = IMFS_fsunmount,
+  .utime_h = IMFS_utime,
+  .eval_link_h = IMFS_evaluate_link,
+  .symlink_h = IMFS_symlink,
+  .readlink_h = IMFS_readlink,
+  .rename_h = IMFS_rename,
+  .statvfs_h = NULL
</font> };
 
<font color='#880000'>-/*
- *  IMFS_initialize
- */
-
</font> int IMFS_initialize(
<font color='#880000'>-  rtems_filesystem_mount_table_entry_t *temp_mt_entry,
</font><font color='#000088'>+  rtems_filesystem_mount_table_entry_t *mt_entry,
</font>   const void                           *data
 )
 {
<font color='#880000'>-   return IMFS_initialize_support(
-     temp_mt_entry,
-     &IMFS_ops,
-     &IMFS_memfile_handlers,
-     &IMFS_directory_handlers
-   );
</font><font color='#000088'>+  return IMFS_initialize_support(
+    mt_entry,
+    &IMFS_ops,
+    &IMFS_memfile_handlers,
+    &IMFS_directory_handlers,
+    &rtems_filesystem_null_handlers  /* for fifos */
+  );
</font> }

<font color='#006600'>diff -u rtems/cpukit/libfs/src/imfs/imfs_initsupp.c:1.21 rtems/cpukit/libfs/src/imfs/imfs_initsupp.c:1.22
--- rtems/cpukit/libfs/src/imfs/imfs_initsupp.c:1.21    Sat May 15 01:29:55 2010
+++ rtems/cpukit/libfs/src/imfs/imfs_initsupp.c Tue Jun  8 05:25:45 2010
</font><font color='#997700'>@@ -66,7 +66,8 @@
</font>   rtems_filesystem_mount_table_entry_t        *temp_mt_entry,
    const rtems_filesystem_operations_table    *op_table,
    const rtems_filesystem_file_handlers_r     *memfile_handlers,
<font color='#880000'>-   const rtems_filesystem_file_handlers_r     *directory_handlers
</font><font color='#000088'>+   const rtems_filesystem_file_handlers_r     *directory_handlers,
+   const rtems_filesystem_file_handlers_r     *fifo_handlers
</font> )
 {
   static int                             imfs_instance;
<font color='#997700'>@@ -108,12 +109,10 @@
</font>   fs_info->ino_count             = 1;
   fs_info->memfile_handlers      = memfile_handlers;
   fs_info->directory_handlers    = directory_handlers;
<font color='#000088'>+  fs_info->fifo_handlers         = fifo_handlers;
</font> 
   jnode = temp_mt_entry->mt_fs_root.node_access;
   jnode->st_ino = fs_info->ino_count;
 
<font color='#880000'>-  /* Initialize POSIX FIFO/pipe module */
-  rtems_pipe_initialize();
-
</font>   return 0;
 }

<font color='#006600'>diff -u rtems/cpukit/libfs/src/imfs/miniimfs_init.c:1.14 rtems/cpukit/libfs/src/imfs/miniimfs_init.c:1.15
--- rtems/cpukit/libfs/src/imfs/miniimfs_init.c:1.14    Mon May 31 08:56:36 2010
+++ rtems/cpukit/libfs/src/imfs/miniimfs_init.c Tue Jun  8 05:25:45 2010
</font><font color='#997700'>@@ -1,6 +1,12 @@
</font><font color='#880000'>-/*
- *  Mini-IMFS Initialization
</font><font color='#000088'>+/**
+ * @file
+ *
+ * @ingroup LibFSIMFS
</font>  *
<font color='#000088'>+ * @brief Mini-IMFS initialization.
+ */
+
+/*
</font>  *  COPYRIGHT (c) 1989-1999.
  *  On-Line Applications Research Corporation (OAR).
  *
<font color='#997700'>@@ -15,58 +21,41 @@
</font> #include "config.h"
 #endif
 
<font color='#880000'>-#include <sys/types.h>         /* for mkdir */
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-#include <assert.h>
-
-#include "imfs.h"
</font> #include <rtems/libio_.h>
 
<font color='#880000'>-#if defined(IMFS_DEBUG)
-#include <stdio.h>
-#endif
-
-/*
- *  miniIMFS file system operations table
- */
</font><font color='#000088'>+#include "imfs.h"
</font> 
<font color='#880000'>-const rtems_filesystem_operations_table  miniIMFS_ops = {
-  IMFS_eval_path,
-  IMFS_evaluate_for_make,
-  NULL, /* XXX IMFS_link, */
-  NULL, /* XXX IMFS_unlink, */
-  IMFS_node_type,
-  IMFS_mknod,
-  NULL, /* XXX IMFS_chown, */
-  NULL, /* XXX IMFS_freenodinfo, */
-  NULL, /* XXX IMFS_mount, */
-  miniIMFS_initialize,
-  NULL, /* XXX IMFS_unmount, */
-  NULL, /* XXX IMFS_fsunmount, */
-  NULL, /* XXX IMFS_utime, */
-  NULL, /* XXX IMFS_evaluate_link, */
-  NULL, /* XXX IMFS_symlink, */
-  NULL, /* XXX IMFS_readlink */
-  NULL, /* XXX IMFS_rename */
-  NULL  /* XXX IMFS_statvfs */
</font><font color='#000088'>+static const rtems_filesystem_operations_table miniIMFS_ops = {
+  .evalpath_h = IMFS_eval_path,
+  .evalformake_h = IMFS_evaluate_for_make,
+  .link_h = NULL,
+  .unlink_h = NULL,
+  .node_type_h = IMFS_node_type,
+  .mknod_h = IMFS_mknod,
+  .chown_h = NULL,
+  .freenod_h = NULL,
+  .mount_h = IMFS_mount,
+  .fsmount_me_h = miniIMFS_initialize,
+  .unmount_h = NULL,
+  .fsunmount_me_h = NULL,
+  .utime_h = NULL,
+  .eval_link_h = NULL,
+  .symlink_h = NULL,
+  .readlink_h = NULL,
+  .rename_h = NULL,
+  .statvfs_h = NULL
</font> };
 
<font color='#880000'>-/*
- *  miniIMFS_initialize
- */
-
</font> int miniIMFS_initialize(
<font color='#880000'>-  rtems_filesystem_mount_table_entry_t *temp_mt_entry,
</font><font color='#000088'>+  rtems_filesystem_mount_table_entry_t *mt_entry,
</font>   const void                           *data
 )
 {
<font color='#880000'>-    return IMFS_initialize_support(
-      temp_mt_entry,
-      &miniIMFS_ops,
-      &rtems_filesystem_null_handlers,  /* for memfiles */
-      &rtems_filesystem_null_handlers   /* for directories */
-   );
</font><font color='#000088'>+  return IMFS_initialize_support(
+    mt_entry,
+    &miniIMFS_ops,
+    &rtems_filesystem_null_handlers, /* for memfiles */
+    &rtems_filesystem_null_handlers, /* for directories */
+    &rtems_filesystem_null_handlers  /* for fifos */
+  );
</font> }

<font color='#006600'>diff -u rtems/cpukit/libfs/src/pipe/fifo.c:1.4 rtems/cpukit/libfs/src/pipe/fifo.c:1.5
--- rtems/cpukit/libfs/src/pipe/fifo.c:1.4      Thu Dec 17 14:26:08 2009
+++ rtems/cpukit/libfs/src/pipe/fifo.c  Tue Jun  8 05:25:45 2010
</font><font color='#997700'>@@ -21,6 +21,10 @@
</font> 
 #include <errno.h>
 #include <stdlib.h>
<font color='#000088'>+
+#include <rtems.h>
+#include <rtems/libio_.h>
+
</font> #include "pipe.h"
 
 
<font color='#997700'>@@ -29,9 +33,7 @@
</font> #define LIBIO_ACCMODE(_iop) ((_iop)->flags & LIBIO_FLAGS_READ_WRITE)
 #define LIBIO_NODELAY(_iop) ((_iop)->flags & LIBIO_FLAGS_NO_DELAY)
 
<font color='#880000'>-extern uint16_t rtems_pipe_no;
-static rtems_id rtems_pipe_semaphore = 0;
-extern bool rtems_pipe_configured;
</font><font color='#000088'>+static rtems_id pipe_semaphore = RTEMS_ID_NONE;
</font> 
 
 #define PIPE_EMPTY(_pipe) (_pipe->Length == 0)
<font color='#997700'>@@ -82,7 +84,7 @@
</font> 
 /*
  * Alloc pipe control structure, buffer, and resources.
<font color='#880000'>- * Called with rtems_pipe_semaphore held.
</font><font color='#000088'>+ * Called with pipe_semaphore held.
</font>  */
 static int pipe_alloc(
   pipe_control_t **pipep
<font color='#997700'>@@ -139,7 +141,7 @@
</font>   return err;
 }
 
<font color='#880000'>-/* Called with rtems_pipe_semaphore held. */
</font><font color='#000088'>+/* Called with pipe_semaphore held. */
</font> static inline void pipe_free(
   pipe_control_t *pipe
 )
<font color='#997700'>@@ -151,6 +153,48 @@
</font>   free(pipe);
 }
 
<font color='#000088'>+static rtems_status_code pipe_lock(void)
+{
+  rtems_status_code sc = RTEMS_SUCCESSFUL;
+
+  if (pipe_semaphore == RTEMS_ID_NONE) {
+    rtems_libio_lock();
+
+    if (pipe_semaphore == RTEMS_ID_NONE) {
+      sc = rtems_semaphore_create(
+        rtems_build_name('P', 'I', 'P', 'E'),
+        1,
+        RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
+        RTEMS_NO_PRIORITY,
+        &pipe_semaphore
+      );
+    }
+
+    rtems_libio_unlock();
+  }
+
+  if (sc == RTEMS_SUCCESSFUL) {
+    sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
+  }
+
+  if (sc == RTEMS_SUCCESSFUL) {
+    return 0;
+  } else {
+    return -EINTR;
+  }
+}
+
+static void pipe_unlock(void)
+{
+  rtems_status_code sc = RTEMS_SUCCESSFUL;
+
+  sc = rtems_semaphore_release(pipe_semaphore);
+  if (sc != RTEMS_SUCCESSFUL) {
+    /* FIXME */
+    rtems_fatal_error_occurred(0xdeadbeef);
+  }
+}
+
</font> /*
  * If called with *pipep = NULL, pipe_new will call pipe_alloc to allocate a
  * pipe control structure and set *pipep to its address.
<font color='#997700'>@@ -163,9 +207,9 @@
</font>   pipe_control_t *pipe;
   int err = 0;
 
<font color='#880000'>-  if (rtems_semaphore_obtain(rtems_pipe_semaphore,
-        RTEMS_WAIT, RTEMS_NO_TIMEOUT) != RTEMS_SUCCESSFUL)
-    return -EINTR;
</font><font color='#000088'>+  err = pipe_lock();
+  if (err)
+    return err;
</font> 
   pipe = *pipep;
   if (pipe == NULL) {
<font color='#997700'>@@ -185,7 +229,7 @@
</font>   }
 
 out:
<font color='#880000'>-  rtems_semaphore_release(rtems_pipe_semaphore);
</font><font color='#000088'>+  pipe_unlock();
</font>   return err;
 }
 
<font color='#997700'>@@ -204,11 +248,16 @@
</font>   uint32_t mode;
 
   rtems_status_code sc;
<font color='#880000'>-  sc = rtems_semaphore_obtain(pipe->Semaphore,
-                              RTEMS_WAIT, RTEMS_NO_TIMEOUT);
-  /* WARN pipe not released! */
-  if(sc != RTEMS_SUCCESSFUL)
-    rtems_fatal_error_occurred(sc);
</font><font color='#000088'>+
+  if (pipe_lock())
+    /* WARN pipe not freed and pipep not set to NULL! */
+    /* FIXME */
+    rtems_fatal_error_occurred(0xdeadbeef);
+
+  if (!PIPE_LOCK(pipe))
+    /* WARN pipe not released! */
+    /* FIXME */
+    rtems_fatal_error_occurred(0xdeadbeef);
</font> 
   mode = LIBIO_ACCMODE(iop);
   if (mode & LIBIO_FLAGS_READ)
<font color='#997700'>@@ -216,12 +265,6 @@
</font>   if (mode & LIBIO_FLAGS_WRITE)
      pipe->Writers --;
 
<font color='#880000'>-  sc = rtems_semaphore_obtain(rtems_pipe_semaphore,
-                              RTEMS_WAIT, RTEMS_NO_TIMEOUT);
-  /* WARN pipe not freed and pipep not set to NULL! */
-  if(sc != RTEMS_SUCCESSFUL)
-    rtems_fatal_error_occurred(sc);
-
</font>   PIPE_UNLOCK(pipe);
 
   if (pipe->Readers == 0 && pipe->Writers == 0) {
<font color='#997700'>@@ -239,7 +282,7 @@
</font>   else if (pipe->Writers == 0 && mode != LIBIO_FLAGS_READ)
     PIPE_WAKEUPREADERS(pipe);
 
<font color='#880000'>-  rtems_semaphore_release(rtems_pipe_semaphore);
</font><font color='#000088'>+  pipe_unlock();
</font> 
 #if 0
   if (! delfile)
<font color='#997700'>@@ -539,27 +582,3 @@
</font>   /* Seek on pipe is not supported */
   return -ESPIPE;
 }
<font color='#880000'>-
-/*
- * Initialization of FIFO/pipe module.
- */
-void rtems_pipe_initialize (void)
-{
-  if (!rtems_pipe_configured)
-    return;
-
-  if (rtems_pipe_semaphore)
-    return;
-
-  rtems_status_code sc;
-  sc = rtems_semaphore_create(
-        rtems_build_name ('P', 'I', 'P', 'E'), 1,
-        RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
-        RTEMS_NO_PRIORITY, &rtems_pipe_semaphore);
-  if (sc != RTEMS_SUCCESSFUL)
-    rtems_fatal_error_occurred (sc);
-
-  rtems_interval now;
-  now = rtems_clock_get_ticks_since_boot();
-  rtems_pipe_no = now;
-}
</font>
<font color='#006600'>diff -u rtems/cpukit/libfs/src/pipe/pipe.h:1.3 rtems/cpukit/libfs/src/pipe/pipe.h:1.4
--- rtems/cpukit/libfs/src/pipe/pipe.h:1.3      Sun Nov 29 07:18:56 2009
+++ rtems/cpukit/libfs/src/pipe/pipe.h  Tue Jun  8 05:25:46 2010
</font><font color='#997700'>@@ -109,11 +109,6 @@
</font>   rtems_libio_t  *iop
 );
 
<font color='#880000'>-/*
- * Initialization of FIFO/pipe module.
- */
-extern void rtems_pipe_initialize (void);
-
</font> #ifdef __cplusplus
 }
 #endif

<font color='#006600'>diff -u rtems/cpukit/libfs/src/pipe/pipe.c:1.4 rtems/cpukit/libfs/src/pipe/pipe.c:1.5
--- rtems/cpukit/libfs/src/pipe/pipe.c:1.4      Sat Mar 27 22:14:08 2010
+++ rtems/cpukit/libfs/src/pipe/pipe.c  Tue Jun  8 05:25:46 2010
</font><font color='#997700'>@@ -20,7 +20,8 @@
</font> #include <rtems/seterr.h>
 
 /* Incremental number added to names of anonymous pipe files */
<font color='#880000'>-uint16_t rtems_pipe_no = 0;
</font><font color='#000088'>+/* FIXME: This approach is questionable */
+static uint16_t rtems_pipe_no = 0;
</font> 
 /*
  * Called by pipe() to create an anonymous pipe.
<font color='#997700'>@@ -33,6 +34,7 @@
</font>   rtems_libio_t *iop;
   int err = 0;
   /* Create /tmp if not exists */
<font color='#000088'>+  /* FIXME: We should use a general mkdir function for this */
</font>   if (rtems_filesystem_evaluate_path("/tmp", 3, RTEMS_LIBIO_PERMS_RWX, &loc, TRUE)
       != 0) {
     if (errno != ENOENT)

<font color='#006600'>diff -u rtems/cpukit/sapi/include/confdefs.h:1.136 rtems/cpukit/sapi/include/confdefs.h:1.137
--- rtems/cpukit/sapi/include/confdefs.h:1.136  Mon Jun  7 10:35:24 2010
+++ rtems/cpukit/sapi/include/confdefs.h        Tue Jun  8 05:25:46 2010
</font><font color='#997700'>@@ -293,7 +293,11 @@
</font>  */<span style="background-color: #FF0000"> </span>
 #if !defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS) && \
     defined(CONFIGURE_FILESYSTEM_IMFS)
<font color='#880000'>-#define CONFIGURE_FILESYSTEM_ENTRY_IMFS { "imfs", IMFS_initialize }
</font><font color='#000088'>+  #if defined(CONFIGURE_PIPES_ENABLED)
+    #define CONFIGURE_FILESYSTEM_ENTRY_IMFS { "imfs", fifoIMFS_initialize }
+  #else
+    #define CONFIGURE_FILESYSTEM_ENTRY_IMFS { "imfs", IMFS_initialize }
+  #endif
</font> #endif
 
 /**
<font color='#997700'>@@ -428,20 +432,6 @@
</font>     };
   #endif
 
<font color='#880000'>-  /**
-   *  This disables the inclusion of pipe support in the full IMFS.
-   *
-   *  NOTE: When building for coverage, we need this variable all the time.
-   */
-  #if !defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) || \
-      defined(RTEMS_COVERAGE)
-    #if defined(CONFIGURE_PIPES_ENABLED)
-      bool rtems_pipe_configured = true;
-    #else
-      bool rtems_pipe_configured = false;
-    #endif
-  #endif
-
</font>   #ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE
     const rtems_filesystem_mount_table_t configuration_mount_table = {
       #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>