change log for rtems (2010-05-31)

rtems-vc at rtems.org rtems-vc at rtems.org
Mon May 31 14:11:11 UTC 2010


 *ccj*:
2010-05-31      Chris Johns <chrisj at rtems.org>

        * shared/umon/tfsDriver.c: Updated to the new mount API.

M    1.5  c/src/lib/libbsp/shared/umon/tfsDriver.c

diff -u rtems/c/src/lib/libbsp/shared/umon/tfsDriver.c:1.4 rtems/c/src/lib/libbsp/shared/umon/tfsDriver.c:1.5
--- rtems/c/src/lib/libbsp/shared/umon/tfsDriver.c:1.4	Fri May 28 01:18:27 2010
+++ rtems/c/src/lib/libbsp/shared/umon/tfsDriver.c	Mon May 31 09:01:31 2010
@@ -101,26 +101,27 @@
 };
 
 static int rtems_tfs_mount_me(
-  rtems_filesystem_mount_table_entry_t *temp_mt_entry
+  rtems_filesystem_mount_table_entry_t *mt_entry,
+  const void                           *data
 )
 {
   rtems_status_code  sc;
 
-  temp_mt_entry->mt_fs_root.handlers = &rtems_tfs_handlers;
-  temp_mt_entry->mt_fs_root.ops      = &rtems_tfs_ops;
+  mt_entry->mt_fs_root.handlers = &rtems_tfs_handlers;
+  mt_entry->mt_fs_root.ops      = &rtems_tfs_ops;
 
   /* We have no TFS specific data to maintain.  This filesystem
    * may only be mounted once. And we maintain no real filesystem
    * nodes, so there is no real root.
    */
 
-  temp_mt_entry->fs_info                = NULL;
-  temp_mt_entry->mt_fs_root.node_access = ROOT_NODE_ACCESS;
+  mt_entry->fs_info                = NULL;
+  mt_entry->mt_fs_root.node_access = ROOT_NODE_ACCESS;
 
   /* These need to be looked at for full POSIX semantics.
    */
 
-  temp_mt_entry->pathconf_limits_and_options = rtems_tfs_limits_and_options;
+  mt_entry->pathconf_limits_and_options = rtems_tfs_limits_and_options;
 
 
   /*  Now allocate a semaphore for mutual exclusion.
@@ -150,8 +151,7 @@
   const char *path
 )
 {
-  int                                   status;
-  rtems_filesystem_mount_table_entry_t *entry;
+  int status;
 
   if (!path) {
     printk( "TFS: No mount point specified\n" );
@@ -166,10 +166,12 @@
     return status;
   }
 
-  status = mount( &entry, &rtems_tfs_ops, RTEMS_FILESYSTEM_READ_WRITE,
-            NULL, TFS_PATHNAME_PREFIX);
+  if (rtems_filesystem_register( "tfs", rtems_tfs_mount_me ) < 0)
+    return -1;
+  
+  status = mount( "umon", TFS_PATHNAME_PREFIX, "tfs", RTEMS_FILESYSTEM_READ_WRITE, NULL);
 
-  if (status) {
+  if (status < 0) {
     printk( "TFS: Unable to mount on %s\n", TFS_PATHNAME_PREFIX );
     perror("TFS mount failed");
   }


 *ccj*:
2010-05-31      Chris Johns <chrisj at rtems.org>

        * libcsupport/Makefile.am: Add mount-mgr.c.
        * libcsupport/src/mount-mgr.c: New.
        * include/rtems/fs.h: Added rtems_filesystem_location_mount.
        * libcsupport/include/rtems/libio.h, libcsupport/src/mount.c: New
        mount interface. It is similar to Linux.
        * libcsupport/include/rtems/libio_.h: Remove the
        init_fs_mount_table call.
        * libcsupport/src/base_fs.c: Remove init_fs_mount_table_call. Use
        the new mount call. Remove setting the root node in the global
        pathloc. Mount does this now.
        * libcsupport/src/privateenv.c: Remove the hack to set the root
        mount table entry in the environment.
        * libcsupport/src/unmount.cL Free the target string.
        * libblock/src/bdpart-mount.c: New mount API.

        * libfs/src/devfs/devfs.h, libfs/src/devfs/devfs_init.c,
        libfs/src/dosfs/dosfs.h, libfs/src/dosfs/msdos.h,
        libfs/src/dosfs/msdos_init.c, libfs/src/imfs/imfs.h,
        libfs/src/imfs/imfs_eval.c, libfs/src/imfs/imfs_init.c,
        libfs/src/imfs/miniimfs_init.c,
        libfs/src/nfsclient/src/librtemsNfs.h,
        libfs/src/rfs/rtems-rfs-rtems.c, libfs/src/rfs/rtems-rfs.h,
        libnetworking/lib/ftpfs.c, libnetworking/rtems/ftpfs.h,
        libnetworking/rtems/tftp.h: New mount_h API.

        * libfs/src/devfs/devfs_eval.c: Local include of extern ops.
        * libfs/src/nfsclient/src/nfs.c: New mount API. Removed the mount
        me call and fixed the initialisation to happen when mounting.

        * libmisc/Makefile.am, libmisc/shell/shellconfig.h: Remove mount
        filesystem files.

        * libmisc/fsmount/fsmount.c, libmisc/fsmount/fsmount.h: Updated to
        the new mount table values.

        * libmisc/shell/main_mount_ftp.c,
        libmisc/shell/main_mount_msdos.c, libmisc/shell/main_mount_rfs.c,
        libmisc/shell/main_mount_tftp.c: Removed.

        * libmisc/shell/main_mount.c: Use the new mount API. Also access
        the file system table for the file system types.

        * libnetworking/lib/tftpDriver.c: Updated to the new mount
        API. Fixed to allow mounting from any mount point. Also can now
        have more than file system mounted.

        * sapi/include/confdefs.h: Add file system configuration support.

M 1.2339  cpukit/ChangeLog
M    1.7  cpukit/include/rtems/fs.h
M    1.2  cpukit/libblock/src/bdpart-mount.c
M  1.118  cpukit/libcsupport/Makefile.am
M   1.62  cpukit/libcsupport/include/rtems/libio.h
M   1.34  cpukit/libcsupport/include/rtems/libio_.h
M   1.22  cpukit/libcsupport/src/base_fs.c
A    1.1  cpukit/libcsupport/src/mount-mgr.c
M   1.33  cpukit/libcsupport/src/mount.c
M   1.12  cpukit/libcsupport/src/privateenv.c
M   1.25  cpukit/libcsupport/src/unmount.c
M    1.7  cpukit/libfs/src/devfs/devfs.h
M    1.6  cpukit/libfs/src/devfs/devfs_eval.c
M    1.5  cpukit/libfs/src/devfs/devfs_init.c
M    1.9  cpukit/libfs/src/dosfs/dosfs.h
M   1.24  cpukit/libfs/src/dosfs/msdos.h
M   1.11  cpukit/libfs/src/dosfs/msdos_init.c
M   1.41  cpukit/libfs/src/imfs/imfs.h
M   1.26  cpukit/libfs/src/imfs/imfs_eval.c
M   1.17  cpukit/libfs/src/imfs/imfs_init.c
M   1.14  cpukit/libfs/src/imfs/miniimfs_init.c
M    1.5  cpukit/libfs/src/nfsclient/src/librtemsNfs.h
M   1.21  cpukit/libfs/src/nfsclient/src/nfs.c
M    1.9  cpukit/libfs/src/rfs/rtems-rfs-rtems.c
M    1.2  cpukit/libfs/src/rfs/rtems-rfs.h
M   1.85  cpukit/libmisc/Makefile.am
M    1.7  cpukit/libmisc/fsmount/fsmount.h
M   1.12  cpukit/libmisc/fsmount/fsmount.c
M    1.8  cpukit/libmisc/shell/main_mount.c
R    1.3  cpukit/libmisc/shell/main_mount_ftp.c
R    1.2  cpukit/libmisc/shell/main_mount_msdos.c
R    1.1  cpukit/libmisc/shell/main_mount_rfs.c
R    1.2  cpukit/libmisc/shell/main_mount_tftp.c
M   1.27  cpukit/libmisc/shell/shellconfig.h
M   1.29  cpukit/libnetworking/lib/ftpfs.c
M   1.38  cpukit/libnetworking/lib/tftpDriver.c
M   1.10  cpukit/libnetworking/rtems/ftpfs.h
M    1.7  cpukit/libnetworking/rtems/tftp.h
M  1.133  cpukit/sapi/include/confdefs.h

diff -u rtems/cpukit/ChangeLog:1.2338 rtems/cpukit/ChangeLog:1.2339
--- rtems/cpukit/ChangeLog:1.2338	Sat May 29 00:17:11 2010
+++ rtems/cpukit/ChangeLog	Mon May 31 08:56:35 2010
@@ -1,3 +1,53 @@
+2010-05-31	Chris Johns <chrisj at rtems.org>
+
+	* libcsupport/Makefile.am: Add mount-mgr.c.
+	* libcsupport/src/mount-mgr.c: New.
+	* include/rtems/fs.h: Added rtems_filesystem_location_mount.
+	* libcsupport/include/rtems/libio.h, libcsupport/src/mount.c: New
+	mount interface. It is similar to Linux.
+	* libcsupport/include/rtems/libio_.h: Remove the
+	init_fs_mount_table call.
+	* libcsupport/src/base_fs.c: Remove init_fs_mount_table_call. Use
+	the new mount call. Remove setting the root node in the global
+	pathloc. Mount does this now.
+	* libcsupport/src/privateenv.c: Remove the hack to set the root
+	mount table entry in the environment.
+	* libcsupport/src/unmount.cL Free the target string.
+	* libblock/src/bdpart-mount.c: New mount API.
+	
+	* libfs/src/devfs/devfs.h, libfs/src/devfs/devfs_init.c,
+	libfs/src/dosfs/dosfs.h, libfs/src/dosfs/msdos.h,
+	libfs/src/dosfs/msdos_init.c, libfs/src/imfs/imfs.h,
+	libfs/src/imfs/imfs_eval.c, libfs/src/imfs/imfs_init.c,
+	libfs/src/imfs/miniimfs_init.c,
+	libfs/src/nfsclient/src/librtemsNfs.h,
+	libfs/src/rfs/rtems-rfs-rtems.c, libfs/src/rfs/rtems-rfs.h,
+	libnetworking/lib/ftpfs.c, libnetworking/rtems/ftpfs.h,
+	libnetworking/rtems/tftp.h: New mount_h API.
+	
+	* libfs/src/devfs/devfs_eval.c: Local include of extern ops.
+	* libfs/src/nfsclient/src/nfs.c: New mount API. Removed the mount
+	me call and fixed the initialisation to happen when mounting.
+	
+	* libmisc/Makefile.am, libmisc/shell/shellconfig.h: Remove mount
+	filesystem files.
+
+	* libmisc/fsmount/fsmount.c, libmisc/fsmount/fsmount.h: Updated to
+	the new mount table values.
+	
+	* libmisc/shell/main_mount_ftp.c,
+	libmisc/shell/main_mount_msdos.c, libmisc/shell/main_mount_rfs.c,
+	libmisc/shell/main_mount_tftp.c: Removed.
+
+	* libmisc/shell/main_mount.c: Use the new mount API. Also access
+	the file system table for the file system types.
+
+	* libnetworking/lib/tftpDriver.c: Updated to the new mount
+	API. Fixed to allow mounting from any mount point. Also can now
+	have more than file system mounted.
+	
+	* sapi/include/confdefs.h: Add file system configuration support.
+
 2010-05-29	Ralf Corsépius <ralf.corsepius at rtems.org>
 
 	PR 1531/newlib:

diff -u rtems/cpukit/include/rtems/fs.h:1.6 rtems/cpukit/include/rtems/fs.h:1.7
--- rtems/cpukit/include/rtems/fs.h:1.6	Sun Nov 29 05:52:51 2009
+++ rtems/cpukit/include/rtems/fs.h	Mon May 31 08:56:36 2010
@@ -52,6 +52,11 @@
    rtems_filesystem_mount_table_entry_t    *mt_entry;
 };
 
+/*
+ * Return the mount table entry for a path location.
+ */
+#define rtems_filesystem_location_mount(_pl) ((_pl)->mt_entry)
+
 #ifdef __cplusplus
 }
 #endif

diff -u rtems/cpukit/libblock/src/bdpart-mount.c:1.1 rtems/cpukit/libblock/src/bdpart-mount.c:1.2
--- rtems/cpukit/libblock/src/bdpart-mount.c:1.1	Fri Apr 30 03:42:12 2010
+++ rtems/cpukit/libblock/src/bdpart-mount.c	Mon May 31 08:56:36 2010
@@ -29,7 +29,6 @@
 
 #include <rtems.h>
 #include <rtems/bdpart.h>
-#include <rtems/dosfs.h>
 #include <rtems/fsmount.h>
 
 rtems_status_code rtems_bdpart_mount(
@@ -99,11 +98,11 @@
 
     /* Mount */
     rv = mount(
-      NULL,
-      &msdos_ops,
-      0,
       logical_disk_name,
-      mount_point
+      mount_point,
+      "msdos",
+      0,
+      NULL
     );
     if (rv != 0) {
       rmdir( mount_point);

diff -u rtems/cpukit/libcsupport/Makefile.am:1.117 rtems/cpukit/libcsupport/Makefile.am:1.118
--- rtems/cpukit/libcsupport/Makefile.am:1.117	Fri Apr 30 23:19:00 2010
+++ rtems/cpukit/libcsupport/Makefile.am	Mon May 31 08:56:36 2010
@@ -44,7 +44,7 @@
     src/assocremotebylocal.c src/assocremotebyname.c
 
 BASE_FS_C_FILES = src/base_fs.c src/mount.c src/unmount.c src/libio.c \
-    src/libio_init.c \
+    src/mount-mgr.c src/libio_init.c \
     src/libio_sockets.c src/eval.c src/fs_null_handlers.c src/privateenv.c \
     src/open_dev_console.c src/__usrenv.c
 

diff -u rtems/cpukit/libcsupport/include/rtems/libio.h:1.61 rtems/cpukit/libcsupport/include/rtems/libio.h:1.62
--- rtems/cpukit/libcsupport/include/rtems/libio.h:1.61	Thu May 27 11:30:32 2010
+++ rtems/cpukit/libcsupport/include/rtems/libio.h	Mon May 31 08:56:36 2010
@@ -209,23 +209,24 @@
 );
 
 typedef int (* rtems_filesystem_mount_t ) (
-   rtems_filesystem_mount_table_entry_t *mt_entry     /* in */
+   rtems_filesystem_mount_table_entry_t *mt_entry     /* IN */
 );
 
 typedef int (* rtems_filesystem_fsmount_me_t )(
-   rtems_filesystem_mount_table_entry_t *mt_entry
+  rtems_filesystem_mount_table_entry_t *mt_entry,     /* IN */
+  const void                           *data          /* IN */
 );
 
 typedef int (* rtems_filesystem_unmount_t ) (
-   rtems_filesystem_mount_table_entry_t *mt_entry     /* in */
+  rtems_filesystem_mount_table_entry_t *mt_entry     /* IN */
 );
 
 typedef int (* rtems_filesystem_fsunmount_me_t ) (
-   rtems_filesystem_mount_table_entry_t *mt_entry    /* in */
+   rtems_filesystem_mount_table_entry_t *mt_entry    /* IN */
 );
 
 typedef rtems_filesystem_node_types_t (* rtems_filesystem_node_type_t) (
-  rtems_filesystem_location_info_t    *pathloc      /* in */
+  rtems_filesystem_location_info_t    *pathloc      /* IN */
 );
 
 typedef int (* rtems_filesystem_utime_t)(
@@ -291,6 +292,62 @@
     rtems_filesystem_statvfs_t       statvfs_h;
 };
 
+/*
+ * File system table used by mount to manage file systems.
+ */
+typedef struct _rtems_filesystem_table {
+  const char                    *type;
+  rtems_filesystem_fsmount_me_t  mount_h;
+} rtems_filesystem_table_t;
+
+/*
+ * File system table runtime loaded nodes.
+ */
+typedef struct _rtems_filesystem_table_node {
+  rtems_chain_node         node;
+  rtems_filesystem_table_t entry;
+} rtems_filesystem_table_node_t;
+
+/*
+ * Get the first entry in the filesystem table.
+ */
+const rtems_filesystem_table_t* rtems_filesystem_table_first( void );
+
+/*
+ * Get the next entry in the file system table.
+ */
+const rtems_filesystem_table_t* 
+rtems_filesystem_table_next( rtems_filesystem_table_t *entry );
+
+/*
+ * Get the first entry in the mount table.
+ */
+rtems_filesystem_mount_table_entry_t*
+rtems_filesystem_mounts_first( void );
+
+/*
+ * Get the next entry in the mount table.
+ */
+rtems_filesystem_mount_table_entry_t*
+rtems_filesystem_mounts_next( rtems_filesystem_mount_table_entry_t *entry );
+
+/*
+ * Register a file system.
+ */
+int
+rtems_filesystem_register(
+  const char                    *type,
+  rtems_filesystem_fsmount_me_t  mount_h
+);
+
+/*
+ * Unregister a file system.
+ */
+int
+rtems_filesystem_unregister(
+  const char *type
+);
+
 #if 0
 /* Now in exec/include/rtems/fs.h */
 
@@ -313,21 +370,26 @@
  */
 
 typedef struct {
-  int    link_max;
-  int    max_canon;
-  int    max_input;
-  int    name_max;
-  int    path_max;
-  int    pipe_buf;
-  int    posix_async_io;
-  int    posix_chown_restrictions;
-  int    posix_no_trunc;
-  int    posix_prio_io;
-  int    posix_sync_io;
-  int    posix_vdisable;
+  int    link_max;                 /* count */
+  int    max_canon;                /* max formatted input line size */
+  int    max_input;                /* max input line size */
+  int    name_max;                 /* max name length */
+  int    path_max;                 /* max path */
+  int    pipe_buf;                 /* pipe buffer size */
+  int    posix_async_io;           /* async IO supported on fs, 0=no, 1=yes */
+  int    posix_chown_restrictions; /* can chown: 0=no, 1=yes */
+  int    posix_no_trunc;           /* error on names > max name, 0=no, 1=yes */
+  int    posix_prio_io;            /* priority IO, 0=no, 1=yes */
+  int    posix_sync_io;            /* file can be sync'ed, 0=no, 1=yes */
+  int    posix_vdisable;           /* special char processing, 0=no, 1=yes */
 } rtems_filesystem_limits_and_options_t;
 
 /*
+ * Default pathconf settings. Override in a filesystem.
+ */
+extern const rtems_filesystem_limits_and_options_t rtems_filesystem_default_pathconf;
+
+/*
  * Structure for a mount table entry.
  */
 
@@ -341,6 +403,16 @@
   rtems_filesystem_limits_and_options_t  pathconf_limits_and_options;
 
   /*
+   * The target or mount point of the file system.
+   */
+  const char                            *target;
+
+  /*
+   * The type of filesystem or the name of the filesystem.
+   */
+  const char                            *type;
+
+  /*
    *  When someone adds a mounted filesystem on a real device,
    *  this will need to be used.
    *
@@ -350,6 +422,26 @@
   char                                  *dev;
 };
 
+/**
+ * The pathconf setting for a file system.
+ */
+#define rtems_filesystem_pathconf(_mte) ((_mte)->pathconf_limits_and_options)
+
+/**
+ * The type of file system. Its name.
+ */
+#define rtems_filesystem_type(_mte) ((_mte)->type)
+
+/**
+ * The mount point of a file system.
+ */
+#define rtems_filesystem_mount_point(_mte) ((_mte)->target)
+
+/**
+ * The device entry of a file system.
+ */
+#define rtems_filesystem_mount_device(_mte) ((_mte)->dev)
+
 /*
  *  Valid RTEMS file systems options
  */
@@ -637,11 +729,11 @@
 );
 
 int mount(
-  rtems_filesystem_mount_table_entry_t    **mt_entry,
-  const rtems_filesystem_operations_table  *fs_ops,
-  rtems_filesystem_options_t                fsoptions,
-  const char                               *device,
-  const char                               *mount_point
+  const char                 *source,
+  const char                 *target,
+  const char                 *filesystemtype,
+  rtems_filesystem_options_t options,
+  const void                 *data
 );
 
 /*
@@ -649,7 +741,7 @@
  */
 
 typedef struct {
-  const rtems_filesystem_operations_table *fs_ops;
+  const char                              *type;
   rtems_filesystem_options_t               fsoptions;
   const char                              *device;
   const char                              *mount_point;

diff -u rtems/cpukit/libcsupport/include/rtems/libio_.h:1.33 rtems/cpukit/libcsupport/include/rtems/libio_.h:1.34
--- rtems/cpukit/libcsupport/include/rtems/libio_.h:1.33	Thu May 27 11:29:37 2010
+++ rtems/cpukit/libcsupport/include/rtems/libio_.h	Mon May 31 08:56:36 2010
@@ -271,8 +271,6 @@
 
 void rtems_filesystem_initialize(void);
 
-int init_fs_mount_table(void);
-
 #ifdef __cplusplus
 }
 #endif

diff -u rtems/cpukit/libcsupport/src/base_fs.c:1.21 rtems/cpukit/libcsupport/src/base_fs.c:1.22
--- rtems/cpukit/libcsupport/src/base_fs.c:1.21	Wed Oct 14 11:21:28 2009
+++ rtems/cpukit/libcsupport/src/base_fs.c	Mon May 31 08:56:36 2010
@@ -36,7 +36,6 @@
 void rtems_filesystem_initialize( void )
 {
   int                                   status;
-  rtems_filesystem_mount_table_entry_t *entry;
   const rtems_filesystem_mount_table_t *mt;
   rtems_filesystem_location_info_t      loc;
 
@@ -46,9 +45,6 @@
 
   rtems_filesystem_umask = 022;
 
-
-  init_fs_mount_table();
-
   /*
    *  mount the first filesystem.
    */
@@ -58,8 +54,7 @@
 
   mt = &rtems_filesystem_mount_table[0];
 
-  status = mount(
-     &entry, mt->fs_ops, mt->fsoptions, mt->device, mt->mount_point );
+  status = mount( mt->device, mt->mount_point, mt->type, mt->fsoptions, NULL );
 
   if ( status == -1 )
     rtems_fatal_error_occurred( 0xABCD0002 );
@@ -86,7 +81,6 @@
    *
    *       Till Straumann, 10/25/2002
    */
-  rtems_filesystem_root        = entry->mt_fs_root;
   /* Clone the root pathloc */
   rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0);
   rtems_filesystem_root        = loc;

diff -u /dev/null rtems/cpukit/libcsupport/src/mount-mgr.c:1.1
--- /dev/null	Mon May 31 09:11:08 2010
+++ rtems/cpukit/libcsupport/src/mount-mgr.c	Mon May 31 09:03:41 2010
@@ -0,0 +1,187 @@
+/*
+ *  mount()
+ *
+ *  Mange the mount table. You can iterate on mounts and file systems, as well
+ *  as add and remove file systems not in the file system confiration table.
+ *
+ *  COPYRIGHT (c) Chris Johns <chrisj at rtems.org> 2010.
+ *
+ *  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$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <rtems/chain.h>
+#include <rtems/seterr.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#include <rtems/libio_.h>
+
+/*
+ * External defined by confdefs.h or the user.
+ */
+extern const rtems_filesystem_table_t configuration_filesystem_table[];
+
+/*
+ * Points to a list of filesystems added at runtime.
+ */
+extern rtems_chain_control *rtems_filesystem_table;
+
+/*
+ * Mount table list.
+ */
+extern rtems_chain_control rtems_filesystem_mount_table_control;
+extern bool                rtems_filesystem_mount_table_control_init;
+
+/*
+ * Get the first entry in the filesystem table.
+ */
+const rtems_filesystem_table_t*
+rtems_filesystem_table_first(
+  void
+)
+{
+  /*
+   * We can assume this because it is the root file system.
+   */
+  return &configuration_filesystem_table[0];
+}
+
+/*
+ * Get the next entry in the file system table.
+ */
+const rtems_filesystem_table_t*
+rtems_filesystem_table_next(
+  rtems_filesystem_table_t *entry
+)
+{
+  const rtems_filesystem_table_t* fs;
+
+  fs = rtems_filesystem_table_first( );
+  
+  while ( fs->type && ( fs != entry ) )
+    ++fs;
+  
+  if ( fs->type ) {
+    ++fs;
+    if ( fs->type )
+      return fs;
+  }
+
+  if ( rtems_filesystem_table ) {
+    rtems_chain_node* node;
+    for (node = rtems_chain_first( rtems_filesystem_table );
+         !rtems_chain_is_tail( rtems_filesystem_table, node);
+         node = rtems_chain_next( node )) {
+      rtems_filesystem_table_node_t* tnode;
+      tnode = (rtems_filesystem_table_node_t*) node;
+      if ( entry == &tnode->entry ) {
+        node = rtems_chain_next( node );
+        if ( !rtems_chain_is_tail( rtems_filesystem_table, node ) ) {
+          tnode = (rtems_filesystem_table_node_t*) node;
+          return &tnode->entry;
+        }
+      }
+    }
+  }
+  
+  return NULL;
+}
+
+/*
+ * Get the first entry in the mount table.
+ */
+rtems_filesystem_mount_table_entry_t*
+rtems_filesystem_mounts_first(
+  void
+)
+{
+  rtems_filesystem_mount_table_entry_t* entry = NULL;
+  if ( rtems_filesystem_mount_table_control_init ) {
+    if ( !rtems_chain_is_empty( &rtems_filesystem_mount_table_control ) )
+      entry = (rtems_filesystem_mount_table_entry_t*)
+        rtems_chain_first( &rtems_filesystem_mount_table_control );
+  }
+  return entry;
+}
+
+/*
+ * Get the next entry in the mount table.
+ */
+rtems_filesystem_mount_table_entry_t*
+rtems_filesystem_mounts_next(
+  rtems_filesystem_mount_table_entry_t *entry
+)
+{
+  if ( !rtems_filesystem_mount_table_control_init || !entry )
+    return NULL;
+  return (rtems_filesystem_mount_table_entry_t*) rtems_chain_next( &entry->Node );
+}
+
+/*
+ * Register a file system.
+ */
+int
+rtems_filesystem_register(
+  const char                    *type,
+  rtems_filesystem_fsmount_me_t  mount_h
+)
+{
+  rtems_filesystem_table_node_t *fs;
+  if ( !rtems_filesystem_table ) {
+    rtems_filesystem_table = malloc( sizeof( rtems_chain_control ) );
+    if ( !rtems_filesystem_table )
+      rtems_set_errno_and_return_minus_one( ENOMEM );
+    rtems_chain_initialize_empty ( rtems_filesystem_table );
+  }
+  fs = malloc( sizeof( rtems_filesystem_table_node_t ) );
+  if ( !fs )
+    rtems_set_errno_and_return_minus_one( ENOMEM );
+  fs->entry.type = strdup( type );
+  if ( !fs->entry.type ) {
+    free( fs );
+    rtems_set_errno_and_return_minus_one( ENOMEM );
+  }    
+  fs->entry.mount_h = mount_h;
+  rtems_chain_append( rtems_filesystem_table, &fs->node );
+  return 0;
+}
+
+/*
+ * Unregister a file system.
+ */
+int
+rtems_filesystem_unregister(
+  const char *type
+)
+{
+  if ( rtems_filesystem_table ) {
+    rtems_chain_node *node;
+    for (node = rtems_chain_first( rtems_filesystem_table );
+         !rtems_chain_is_tail( rtems_filesystem_table, node );
+         node = rtems_chain_next( node ) ) {
+      rtems_filesystem_table_node_t *fs;
+      fs = (rtems_filesystem_table_node_t*) node;
+      if ( strcmp( fs->entry.type, type ) == 0 ) {
+        rtems_chain_extract( node );
+        free( (void*) fs->entry.type );
+        free( fs );
+        return 0;
+      }
+    }
+  }
+  rtems_set_errno_and_return_minus_one( ENOENT );
+}

diff -u rtems/cpukit/libcsupport/src/mount.c:1.32 rtems/cpukit/libcsupport/src/mount.c:1.33
--- rtems/cpukit/libcsupport/src/mount.c:1.32	Thu Jun 11 20:53:32 2009
+++ rtems/cpukit/libcsupport/src/mount.c	Mon May 31 08:56:36 2010
@@ -33,24 +33,72 @@
 
 #include <rtems/libio_.h>
 
-rtems_chain_control rtems_filesystem_mount_table_control;
+/*
+ * External defined by confdefs.h or the user.
+ */
+extern const rtems_filesystem_table_t configuration_filesystem_table[];
 
 /*
- *  Prototypes that probably should be somewhere else.
+ * Points to a list of filesystems added at runtime.
  */
+rtems_chain_control *rtems_filesystem_table;
 
-int init_fs_mount_table( void );
-static bool Is_node_fs_root(
-  rtems_filesystem_location_info_t  *loc
-);
+/*
+ * Mount table list.
+ */
+rtems_chain_control rtems_filesystem_mount_table_control;
+bool                rtems_filesystem_mount_table_control_init;
 
+/*
+ * Default pathconfs.
+ */
+const rtems_filesystem_limits_and_options_t rtems_filesystem_default_pathconf = {
+   5,    /* link_max: count */
+   128,  /* max_canon: max formatted input line size */
+   7,    /* max_input: max input line size */
+   255,  /* name_max: max name */
+   255,  /* path_max: max path */
+   1024, /* pipe_buf: pipe buffer size */
+   0,    /* posix_async_io: async IO supported on fs, 0=no, 1=yes */
+   0 ,   /* posix_chown_restrictions: can chown: 0=no, 1=yes */
+   1,    /* posix_no_trunc: error on filenames > max name, 0=no, 1=yes */
+   0,    /* posix_prio_io: priority IO, 0=no, 1=yes */
+   0,    /* posix_sync_io: file can be sync'ed, 0=no, 1=yes */
+   0     /* posix_vdisable: special char processing, 0=no, 1=yes */
+};
 
 /*
- *  XXX
+ *  Is_node_fs_root
+ *
+ *  This routine will run through the entries that currently exist in the
+ *  mount table chain. For each entry in the mount table chain it will
+ *  compare the mount tables root node to the node describing the selected
+ *  mount point. If any match is found true is returned else false is
+ *  returned.
+ *
  */
 
-#define FOUND      0
-#define NOT_FOUND -1
+static bool Is_node_fs_root(
+  rtems_filesystem_location_info_t  *loc
+)
+{
+  rtems_chain_node                     *the_node;
+  rtems_filesystem_mount_table_entry_t *the_mount_entry;
+
+  /*
+   * For each mount table entry
+   */
+  if ( rtems_filesystem_mount_table_control_init ) {
+    for ( the_node = rtems_chain_first( &rtems_filesystem_mount_table_control );
+          !rtems_chain_is_tail( &rtems_filesystem_mount_table_control, the_node );
+          the_node = rtems_chain_next( the_node ) ) {
+      the_mount_entry = (rtems_filesystem_mount_table_entry_t *) the_node;
+      if ( the_mount_entry->mt_fs_root.node_access  == loc->node_access )
+        return true;
+    }
+  }
+  return false;
+}
 
 /*
  *  mount
@@ -68,27 +116,25 @@
  */
 
 int mount(
-  rtems_filesystem_mount_table_entry_t    **mt_entry,
-  const rtems_filesystem_operations_table  *fs_ops,
-  rtems_filesystem_options_t                options,
-  const char                               *device,
-  const char                               *mount_point
-)
+  const char                 *source,
+  const char                 *target,
+  const char                 *filesystemtype,
+  rtems_filesystem_options_t options,
+  const void                 *data
+          )
 {
+  const rtems_filesystem_table_t       *entry;
   rtems_filesystem_location_info_t      loc;
-  rtems_filesystem_mount_table_entry_t *temp_mt_entry = NULL;
+  rtems_filesystem_mount_table_entry_t *mt_entry = NULL;
   rtems_filesystem_location_info_t     *loc_to_free = NULL;
   size_t size;
 
-/* XXX add code to check for required operations */
-
   /*
-   *  Is there a file system operations table?
+   * If mount is ever called we allocate the mount table control structure.
    */
-
-  if ( fs_ops == NULL ) {
-    errno = EINVAL;
-    return -1;
+  if ( !rtems_filesystem_mount_table_control_init ) {
+    rtems_filesystem_mount_table_control_init = true;
+    rtems_chain_initialize_empty ( &rtems_filesystem_mount_table_control );
   }
 
   /*
@@ -101,45 +147,88 @@
     return -1;
   }
 
-  /* Do they support being mounted at all ? */
-  if ( !fs_ops->fsmount_me_h ) {
-    errno = ENOTSUP;
-    goto cleanup_and_bail;
+  /*
+   * Check the type.
+   */
+  if (!filesystemtype) {
+    errno = EINVAL;
+    return -1;
   }
 
+  if (strlen(filesystemtype) >= 128) {
+    errno = EINVAL;
+    return -1;
+  }
+    
+  /*
+   * Check the configuration table filesystems then check any runtime added
+   * file systems.
+   */
+  entry = &configuration_filesystem_table[0];
+  while (entry->type) {
+    if (strcmp (filesystemtype, entry->type) == 0)
+      break;
+    ++entry;
+  }
+  
+  if (!entry->type) {
+    entry = NULL;
+    if (rtems_filesystem_table) {
+      rtems_chain_node *the_node;
+      for (the_node = rtems_chain_first(rtems_filesystem_table);
+           !rtems_chain_is_tail(rtems_filesystem_table, the_node);
+           the_node = rtems_chain_next(the_node)) {
+        entry = &(((rtems_filesystem_table_node_t*) the_node)->entry);
+        if (strcmp (filesystemtype, entry->type) == 0)
+          break;
+        entry = NULL;
+      }
+    }
+  }
 
+  if (!entry)
+  {
+    errno = EINVAL;
+    return -1;
+  }
+  
   /*
    * Allocate a mount table entry
    */
 
-   size = sizeof(rtems_filesystem_mount_table_entry_t);
-   if ( device )
-     size += strlen( device ) + 1;
-   temp_mt_entry = malloc( size );
-
-   if ( !temp_mt_entry ) {
-     errno = ENOMEM;
-     return -1;
-   }
-
-   temp_mt_entry->mt_fs_root.mt_entry = temp_mt_entry;
-   temp_mt_entry->options = options;
-   if ( device ) {
-     temp_mt_entry->dev =
-       (char *)temp_mt_entry + sizeof( rtems_filesystem_mount_table_entry_t );
-     strcpy( temp_mt_entry->dev, device );
-   } else
-     temp_mt_entry->dev = 0;
+  size = sizeof(rtems_filesystem_mount_table_entry_t);
+  if ( source )
+    size += strlen( source ) + 1;
+   
+  mt_entry = malloc( size );
+  if ( !mt_entry ) {
+    errno = ENOMEM;
+    return -1;
+  }
+
+  memset( mt_entry, 0, size );
+   
+  mt_entry->mt_fs_root.mt_entry = mt_entry;
+  mt_entry->type = entry->type;
+  mt_entry->options = options;
+  mt_entry->pathconf_limits_and_options = rtems_filesystem_default_pathconf;
+   
+  if ( source ) {
+    mt_entry->dev =
+      (char *)mt_entry + sizeof( rtems_filesystem_mount_table_entry_t );
+    strcpy( mt_entry->dev, source );
+  } else
+    mt_entry->dev = 0;
 
   /*
    *  The mount_point should be a directory with read/write/execute
    *  permissions in the existing tree.
    */
 
-  if ( mount_point ) {
+  if ( target ) {
 
     if ( rtems_filesystem_evaluate_path(
-           mount_point, strlen( mount_point ), RTEMS_LIBIO_PERMS_RWX, &loc, true ) == -1 )
+           target, strlen( target ), RTEMS_LIBIO_PERMS_RWX, &loc, true ) == -1 )
       goto cleanup_and_bail;
 
     loc_to_free = &loc;
@@ -179,11 +268,11 @@
      *  traverse the tree.
      */
 
-    temp_mt_entry->mt_point_node.node_access = loc.node_access;
-    temp_mt_entry->mt_point_node.handlers = loc.handlers;
-    temp_mt_entry->mt_point_node.ops = loc.ops;
-    temp_mt_entry->mt_point_node.mt_entry = loc.mt_entry;
-
+    mt_entry->mt_point_node.node_access = loc.node_access;
+    mt_entry->mt_point_node.handlers = loc.handlers;
+    mt_entry->mt_point_node.ops = loc.ops;
+    mt_entry->mt_point_node.mt_entry = loc.mt_entry;
+      
     /*
      *  This link to the parent is only done when we are dealing with system
      *  below the base file system
@@ -194,31 +283,45 @@
       goto cleanup_and_bail;
     }
 
-    if ( loc.ops->mount_h( temp_mt_entry ) ) {
+    if ( loc.ops->mount_h( mt_entry ) ) {
       goto cleanup_and_bail;
     }
+
+    mt_entry->target = strdup( target );
   } else {
 
     /*
+     * Do we already have a base file system ?
+     */
+    if ( !rtems_chain_is_empty( &rtems_filesystem_mount_table_control ) ) {
+      errno = EINVAL;
+      goto cleanup_and_bail;
+    }
+    
+    /*
      *  This is a mount of the base file system --> The
      *  mt_point_node.node_access will be set to null to indicate that this
      *  is the root of the entire file system.
      */
 
-    temp_mt_entry->mt_fs_root.node_access = NULL;
-    temp_mt_entry->mt_fs_root.handlers = NULL;
-    temp_mt_entry->mt_fs_root.ops = NULL;
-
-    temp_mt_entry->mt_point_node.node_access = NULL;
-    temp_mt_entry->mt_point_node.handlers = NULL;
-    temp_mt_entry->mt_point_node.ops = NULL;
-    temp_mt_entry->mt_point_node.mt_entry = NULL;
+    mt_entry->mt_fs_root.node_access = NULL;
+    mt_entry->mt_fs_root.handlers = NULL;
+    mt_entry->mt_fs_root.ops = NULL;
+
+    mt_entry->mt_point_node.node_access = NULL;
+    mt_entry->mt_point_node.handlers = NULL;
+    mt_entry->mt_point_node.ops = NULL;
+    mt_entry->mt_point_node.mt_entry = NULL;
+
+    mt_entry->target = "/";
   }
 
-  if ( fs_ops->fsmount_me_h( temp_mt_entry ) ) {
-	/* try to undo the mount operation */
-	if ( loc.ops->unmount_h ) {
-		loc.ops->unmount_h( temp_mt_entry );
+  if ( entry->mount_h( mt_entry, data ) ) {
+    /*
+     * Try to undo the mount operation
+     */
+    if ( loc.ops->unmount_h ) {
+      loc.ops->unmount_h( mt_entry );
     }
     goto cleanup_and_bail;
   }
@@ -226,18 +329,18 @@
   /*
    *  Add the mount table entry to the mount table chain
    */
-
   rtems_chain_append( &rtems_filesystem_mount_table_control,
-                      &temp_mt_entry->Node );
+                      &mt_entry->Node );
 
-  if ( mt_entry )
-    *mt_entry = temp_mt_entry;
+  if ( !target )
+    rtems_filesystem_root = mt_entry->mt_fs_root;
 
   return 0;
 
 cleanup_and_bail:
 
-  free( temp_mt_entry );
+  free( (void*) mt_entry->target );
+  free( mt_entry );
 
   if ( loc_to_free )
     rtems_filesystem_freenode( loc_to_free );
@@ -245,49 +348,3 @@
   return -1;
 }
 
-
-
-/*
- *  init_fs_mount_table
- *
- *  This routine will initialize the chain control element that manages the
- *  mount table chain.
- */
-
-int init_fs_mount_table(void)
-{
-  rtems_chain_initialize_empty ( &rtems_filesystem_mount_table_control );
-  return 0;
-}
-
-/*
- *  Is_node_fs_root
- *
- *  This routine will run through the entries that currently exist in the
- *  mount table chain. For each entry in the mount table chain it will
- *  compare the mount tables root node to the node describing the selected
- *  mount point. If any match is found true is returned else false is
- *  returned.
- *
- */
-
-static bool Is_node_fs_root(
-  rtems_filesystem_location_info_t  *loc
-)
-{
-  rtems_chain_node                     *the_node;
-  rtems_filesystem_mount_table_entry_t *the_mount_entry;
-
-  /*
-   * For each mount table entry
-   */
-
-  for ( the_node = rtems_filesystem_mount_table_control.first;
-        !rtems_chain_is_tail( &rtems_filesystem_mount_table_control, the_node );
-        the_node = the_node->next ) {
-     the_mount_entry = (rtems_filesystem_mount_table_entry_t *) the_node;
-     if ( the_mount_entry->mt_fs_root.node_access  == loc->node_access )
-        return true;
-  }
-  return false;
-}

diff -u rtems/cpukit/libcsupport/src/privateenv.c:1.11 rtems/cpukit/libcsupport/src/privateenv.c:1.12
--- rtems/cpukit/libcsupport/src/privateenv.c:1.11	Thu Jun 11 20:53:32 2009
+++ rtems/cpukit/libcsupport/src/privateenv.c	Mon May 31 08:56:36 2010
@@ -1,5 +1,5 @@
 /*
- *  Instantatiate a private user environment for the calling thread.
+ *  Instantiate a private user environment for the calling thread.
  *
  *  Submitted by: fernando.ruiz at ctv.es (correo at fernando-ruiz.com)
  *
@@ -24,12 +24,6 @@
 #include <rtems/libio.h>
 #include <rtems/libio_.h>
 
-extern rtems_chain_control rtems_filesystem_mount_table_control;
-
-#define THE_ROOT_FS_LOC \
-	(((rtems_filesystem_mount_table_entry_t*)\
-	   rtems_filesystem_mount_table_control.first)->mt_fs_root)
-
 /* cleanup a user environment
  * NOTE: this must be called with
  *       thread dispatching disabled!
@@ -82,13 +76,11 @@
   *rtems_current_user_env = rtems_global_user_env; /* get the global values*/
   rtems_current_user_env->task_id=task_id;         /* mark the local values*/
 
-  /* get a clean root */
-  rtems_filesystem_root    = THE_ROOT_FS_LOC;
-
   /* Clone the pathlocs. In contrast to most other
    * code we must _not_ free the original locs because
    * what we are trying to do here is forking off
-   * clones.
+   * clones. The reason is a pathloc can be allocated by the
+   * file system and needs to be freed when deleting the environment.
    */
 
   rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0);

diff -u rtems/cpukit/libcsupport/src/unmount.c:1.24 rtems/cpukit/libcsupport/src/unmount.c:1.25
--- rtems/cpukit/libcsupport/src/unmount.c:1.24	Tue Sep 15 04:42:46 2009
+++ rtems/cpukit/libcsupport/src/unmount.c	Mon May 31 08:56:36 2010
@@ -213,6 +213,7 @@
    */
 
   rtems_filesystem_freenode( fs_mount_loc );
+  free( (void*) mt_entry->target );
   free( mt_entry );
 
   return 0;

diff -u rtems/cpukit/libfs/src/devfs/devfs.h:1.6 rtems/cpukit/libfs/src/devfs/devfs.h:1.7
--- rtems/cpukit/libfs/src/devfs/devfs.h:1.6	Thu May 27 11:20:44 2010
+++ rtems/cpukit/libfs/src/devfs/devfs.h	Mon May 31 08:56:36 2010
@@ -50,22 +50,6 @@
 
 extern uint32_t rtems_device_table_size;
 
-
-/**
- *  The following defines the device-only filesystem operating
- *  handlers.
- */
-
-extern rtems_filesystem_operations_table devFS_ops;
-
-/**
- *  The following defines the device-only filesystem operating
- *  handlers.
- */
-
-extern rtems_filesystem_file_handlers_r  devFS_file_handlers;
-
-
 /**
  *  This handler maps open operation to rtems_io_open.
  *  @param iop This is the RTEMS's internal representation of file.
@@ -257,14 +241,16 @@
  *  initializing it to a known state, and set device file operation
  *  handlers. After this, the device-only filesytem is ready for use
  *
- *  @param  temp_mt_entry
+ *  @param  mt_entry The filesystem mount table entry.
+ *  @param  data Filesystem specific data.
  *  @retval upon success, this routine returns 0; otherwise it returns
  *  -1 and errno is set to proper value. The only error is when malloc
  *  failed, and errno is set to NOMEM.
  */
 
 extern int devFS_initialize(
-  rtems_filesystem_mount_table_entry_t *temp_mt_entry
+  rtems_filesystem_mount_table_entry_t *mt_entry,
+  const void                           *data
 );
 
 

diff -u rtems/cpukit/libfs/src/devfs/devfs_eval.c:1.5 rtems/cpukit/libfs/src/devfs/devfs_eval.c:1.6
--- rtems/cpukit/libfs/src/devfs/devfs_eval.c:1.5	Thu May 27 11:20:44 2010
+++ rtems/cpukit/libfs/src/devfs/devfs_eval.c	Mon May 31 08:56:36 2010
@@ -15,6 +15,20 @@
 #include <assert.h>
 #include "devfs.h"
 
+/**
+ *  The following defines the device-only filesystem operating
+ *  handlers.
+ */
+
+extern rtems_filesystem_operations_table devFS_ops;
+
+/**
+ *  The following defines the device-only filesystem operating
+ *  handlers.
+ */
+
+extern rtems_filesystem_file_handlers_r  devFS_file_handlers;
+
 int devFS_evaluate_path(
   const char                        *pathname,
   size_t                             pathnamelen,

diff -u rtems/cpukit/libfs/src/devfs/devfs_init.c:1.4 rtems/cpukit/libfs/src/devfs/devfs_init.c:1.5
--- rtems/cpukit/libfs/src/devfs/devfs_init.c:1.4	Sun Nov 29 07:18:56 2009
+++ rtems/cpukit/libfs/src/devfs/devfs_init.c	Mon May 31 08:56:36 2010
@@ -59,7 +59,8 @@
 
 
 int devFS_initialize(
-  rtems_filesystem_mount_table_entry_t *temp_mt_entry
+  rtems_filesystem_mount_table_entry_t *temp_mt_entry,
+  const void                           *data
 )
 {
   rtems_device_name_t  *device_name_table;

diff -u rtems/cpukit/libfs/src/dosfs/dosfs.h:1.8 rtems/cpukit/libfs/src/dosfs/dosfs.h:1.9
--- rtems/cpukit/libfs/src/dosfs/dosfs.h:1.8	Sun Nov 29 07:18:56 2009
+++ rtems/cpukit/libfs/src/dosfs/dosfs.h	Mon May 31 08:56:36 2010
@@ -25,7 +25,8 @@
 extern "C" {
 #endif
 
-extern rtems_filesystem_operations_table  msdos_ops;
+int rtems_dosfs_initialize(rtems_filesystem_mount_table_entry_t *mt_entry,
+                           const void                           *data);
 
 #define MSDOS_FMT_FATANY 0
 #define MSDOS_FMT_FAT12  1

diff -u rtems/cpukit/libfs/src/dosfs/msdos.h:1.23 rtems/cpukit/libfs/src/dosfs/msdos.h:1.24
--- rtems/cpukit/libfs/src/dosfs/msdos.h:1.23	Thu May 27 11:23:04 2010
+++ rtems/cpukit/libfs/src/dosfs/msdos.h	Mon May 31 08:56:36 2010
@@ -223,8 +223,6 @@
 #define MSDOS_DPS512_NUM    16
 
 /* Prototypes */
-int msdos_initialize(rtems_filesystem_mount_table_entry_t *temp_mt_entry);
-
 int msdos_shut_down(rtems_filesystem_mount_table_entry_t *temp_mt_entry);
 
 int msdos_eval_path(

diff -u rtems/cpukit/libfs/src/dosfs/msdos_init.c:1.10 rtems/cpukit/libfs/src/dosfs/msdos_init.c:1.11
--- rtems/cpukit/libfs/src/dosfs/msdos_init.c:1.10	Thu Mar  4 00:36:51 2010
+++ rtems/cpukit/libfs/src/dosfs/msdos_init.c	Mon May 31 08:56:36 2010
@@ -16,6 +16,7 @@
 #endif
 
 #include <rtems/libio_.h>
+#include "dosfs.h"
 #include "msdos.h"
 
 const rtems_filesystem_operations_table  msdos_ops = {
@@ -28,7 +29,7 @@
   .chown_h        =  NULL,
   .freenod_h      =  msdos_free_node_info,
   .mount_h        =  NULL,
-  .fsmount_me_h   =  msdos_initialize,
+  .fsmount_me_h   =  rtems_dosfs_initialize,
   .unmount_h      =  NULL,
   .fsunmount_me_h =  msdos_shut_down,
   .utime_h        =  NULL,
@@ -50,11 +51,12 @@
  *     RC_OK on success, or -1 if error occured (errno set apropriately).
  *
  */
-int msdos_initialize(rtems_filesystem_mount_table_entry_t *temp_mt_entry)
+int rtems_dosfs_initialize(rtems_filesystem_mount_table_entry_t *mt_entry,
+                           const void                           *data)
 {
     int rc;
 
-    rc = msdos_initialize_support(temp_mt_entry,
+    rc = msdos_initialize_support(mt_entry,
                                   &msdos_ops,
                                   &msdos_file_handlers,
                                   &msdos_dir_handlers);

diff -u rtems/cpukit/libfs/src/imfs/imfs.h:1.40 rtems/cpukit/libfs/src/imfs/imfs.h:1.41
--- rtems/cpukit/libfs/src/imfs/imfs.h:1.40	Thu May 27 11:24:47 2010
+++ rtems/cpukit/libfs/src/imfs/imfs.h	Mon May 31 08:56:36 2010
@@ -255,11 +255,13 @@
  */
 
 extern int IMFS_initialize(
-   rtems_filesystem_mount_table_entry_t *mt_entry
+   rtems_filesystem_mount_table_entry_t *mt_entry,
+   const void                           *data
 );
 
 extern int miniIMFS_initialize(
-   rtems_filesystem_mount_table_entry_t *mt_entry
+   rtems_filesystem_mount_table_entry_t *mt_entry,
+   const void                           *data
 );
 
 extern int IMFS_initialize_support(

diff -u rtems/cpukit/libfs/src/imfs/imfs_eval.c:1.25 rtems/cpukit/libfs/src/imfs/imfs_eval.c:1.26
--- rtems/cpukit/libfs/src/imfs/imfs_eval.c:1.25	Thu May 27 11:24:47 2010
+++ rtems/cpukit/libfs/src/imfs/imfs_eval.c	Mon May 31 08:56:36 2010
@@ -490,7 +490,7 @@
   size_t                             pathnamelen,  /* IN     */
   int                                flags,        /* IN     */
   rtems_filesystem_location_info_t  *pathloc       /* IN/OUT */
-)
+                   )
 {
   int                                 i = 0;
   int                                 len;
@@ -531,40 +531,40 @@
     if ( type != IMFS_NO_MORE_PATH )
       if ( node->type == IMFS_DIRECTORY )
         if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )
-           rtems_set_errno_and_return_minus_one( EACCES );
+          rtems_set_errno_and_return_minus_one( EACCES );
 
     node = pathloc->node_access;
 
     switch( type ) {
       case IMFS_UP_DIR:
-       /*
-        *  Am I at the root of all filesystems? (chroot'ed?)
-	*/
-
-       if ( pathloc->node_access == rtems_filesystem_root.node_access )
-         break;       /* Throw out the .. in this case */
-
-	/*
-	 *  Am I at the root of this mounted filesystem?
-	 */
+        /*
+         *  Am I at the root of all filesystems? (chroot'ed?)
+         */
+
+        if ( pathloc->node_access == rtems_filesystem_root.node_access )
+          break;       /* Throw out the .. in this case */
+
+        /*
+         *  Am I at the root of this mounted filesystem?
+         */
 
         if (pathloc->node_access ==
             pathloc->mt_entry->mt_fs_root.node_access) {
 
           /*
-	   *  Am I at the root of all filesystems?
-	   */
+           *  Am I at the root of all filesystems?
+           */
 
           if ( pathloc->node_access == rtems_filesystem_root.node_access ) {
             break;       /* Throw out the .. in this case */
-	  } else {
+          } else {
             newloc = pathloc->mt_entry->mt_point_node;
             *pathloc = newloc;
             return (*pathloc->ops->evalpath_h)(&(pathname[i-len]),
                                                pathnamelen+len,
                                                flags,pathloc);
-	  }
-	} else {
+          }
+        } else {
 
           if ( !node->Parent )
             rtems_set_errno_and_return_minus_one( ENOENT );
@@ -572,17 +572,17 @@
           node = node->Parent;
           pathloc->node_access = node;
 
-	}
+        }
 
         pathloc->node_access = node;
         break;
 
       case IMFS_NAME:
-	/*
-	 *  If we are at a link follow it.
-	 */
+        /*
+         *  If we are at a link follow it.
+         */
 
-	if ( node->type == IMFS_HARD_LINK ) {
+        if ( node->type == IMFS_HARD_LINK ) {
 
           IMFS_evaluate_hard_link( pathloc, 0 );
 
@@ -590,26 +590,26 @@
           if ( !node )
             rtems_set_errno_and_return_minus_one( ENOTDIR );
 
-	} else if ( node->type == IMFS_SYM_LINK ) {
+        } else if ( node->type == IMFS_SYM_LINK ) {
 
           result = IMFS_evaluate_sym_link( pathloc, 0 );
 
           node = pathloc->node_access;
           if ( result == -1 )
             return -1;
-	}
+        }
 
-       /*
-        *  Only a directory can be decended into.
-        */
+        /*
+         *  Only a directory can be decended into.
+         */
 
-       if ( node->type != IMFS_DIRECTORY )
+        if ( node->type != IMFS_DIRECTORY )
           rtems_set_errno_and_return_minus_one( ENOTDIR );
 
-	/*
-	 *  If we are at a node that is a mount point. Set loc to the
-	 *  new fs root node and let them finish evaluating the path.
-	 */
+        /*
+         *  If we are at a node that is a mount point. Set loc to the
+         *  new fs root node and let them finish evaluating the path.
+         */
 
         if ( node->info.directory.mt_fs != NULL ) {
           newloc   = node->info.directory.mt_fs->mt_fs_root;
@@ -617,19 +617,19 @@
           return (*pathloc->ops->evalpath_h)( &pathname[i-len],
                                               pathnamelen+len,
                                               flags, pathloc );
-	}
+        }
 
-	/*
-	 *  Otherwise find the token name in the present location.
-	 */
+        /*
+         *  Otherwise find the token name in the present location.
+         */
 
         node = IMFS_find_match_in_dir( node, token );
         if ( !node )
           rtems_set_errno_and_return_minus_one( ENOENT );
 
-	/*
-	 *  Set the node access to the point we have found.
-	 */
+        /*
+         *  Set the node access to the point we have found.
+         */
 
         pathloc->node_access = node;
         break;

diff -u rtems/cpukit/libfs/src/imfs/imfs_init.c:1.16 rtems/cpukit/libfs/src/imfs/imfs_init.c:1.17
--- rtems/cpukit/libfs/src/imfs/imfs_init.c:1.16	Thu Mar  4 00:36:51 2010
+++ rtems/cpukit/libfs/src/imfs/imfs_init.c	Mon May 31 08:56:36 2010
@@ -59,7 +59,8 @@
  */
 
 int IMFS_initialize(
-  rtems_filesystem_mount_table_entry_t *temp_mt_entry
+  rtems_filesystem_mount_table_entry_t *temp_mt_entry,
+  const void                           *data
 )
 {
    return IMFS_initialize_support(

diff -u rtems/cpukit/libfs/src/imfs/miniimfs_init.c:1.13 rtems/cpukit/libfs/src/imfs/miniimfs_init.c:1.14
--- rtems/cpukit/libfs/src/imfs/miniimfs_init.c:1.13	Thu Mar  4 00:36:51 2010
+++ rtems/cpukit/libfs/src/imfs/miniimfs_init.c	Mon May 31 08:56:36 2010
@@ -59,7 +59,8 @@
  */
 
 int miniIMFS_initialize(
-  rtems_filesystem_mount_table_entry_t *temp_mt_entry
+  rtems_filesystem_mount_table_entry_t *temp_mt_entry,
+  const void                           *data
 )
 {
     return IMFS_initialize_support(

diff -u rtems/cpukit/libfs/src/nfsclient/src/librtemsNfs.h:1.4 rtems/cpukit/libfs/src/nfsclient/src/librtemsNfs.h:1.5
--- rtems/cpukit/libfs/src/nfsclient/src/librtemsNfs.h:1.4	Sun Nov 29 07:18:56 2009
+++ rtems/cpukit/libfs/src/nfsclient/src/librtemsNfs.h	Mon May 31 08:56:36 2010
@@ -70,6 +70,10 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* RPCIO driver interface.
  * If you need RPCIO for other purposes than NFS
  * you may want to include <rpcio.h>
@@ -82,7 +86,9 @@
  */
 extern rtems_task_priority rpciodPriority;
 
-/* Initialize the driver
+/* Initialize the driver.
+ *
+ * Note, called in nfsfs initialise when mount is called.
  *
  * RETURNS: 0 on success, -1 on failure
  */
@@ -103,6 +109,8 @@
  * NOTE: The RPCIO driver must have been initialized prior to
  *       calling this.
  *
+ * Note, called in nfsfs initialise when mount is called with defaults.
+ *
  * ARGS:	depth of the small and big
  * 			transaction pools, i.e. how
  * 			many transactions (buffers)
@@ -131,22 +139,12 @@
 int
 nfsMountsShow(FILE *f);
 
-/* convenience wrapper
- *
- * NOTE: this routine calls NON-REENTRANT
- *       gethostbyname() if the host is
- *       not in 'dot' notation.
+/*
+ * Filesystem mount table mount handler. Do not call, use the mount call.
  */
-int
-nfsMount(char *uidhost, char *path, char *mntpoint);
-
-/* Alternatively, a pointer to the filesystem operations
- * table can be supplied to the native RTEMS (NON-POSIX!)
- * 'mount()' call.
- * Supply a "<host.in.ip.dot.notation>:<path>" string
- * for 'device' argument to 'mount()'.
- */
-extern struct _rtems_filesystem_operations_table nfs_fs_ops;
+int 
+rtems_nfsfs_initialize(rtems_filesystem_mount_table_entry_t *mt_entry,
+                       const void                           *data);
 
 /* A utility routine to find the path leading to a
  * rtems_filesystem_location_info_t node.
@@ -174,4 +172,9 @@
 /* Read current timeout (in milliseconds) */
 uint32_t
 nfsGetTimeout(void);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif

diff -u rtems/cpukit/libfs/src/nfsclient/src/nfs.c:1.20 rtems/cpukit/libfs/src/nfsclient/src/nfs.c:1.21
--- rtems/cpukit/libfs/src/nfsclient/src/nfs.c:1.20	Thu May 27 11:17:44 2010
+++ rtems/cpukit/libfs/src/nfsclient/src/nfs.c	Mon May 31 08:56:37 2010
@@ -4,6 +4,8 @@
 
 /* Author: Till Straumann <strauman at slac.stanford.edu> 2002 */
 
+/* Hacked on by others. */
+
 /*
  * Authorship
  * ----------
@@ -1193,8 +1195,7 @@
 }
 
 /*
- * IP address helper. Note that we avoid
- * gethostbyname() since it's not reentrant.
+ * IP address helper.
  *
  * initialize a sockaddr_in from a
  * [<uid>'.'<gid>'@']<host>':'<path>" string and let
@@ -1211,7 +1212,8 @@
 			char **pHost, struct sockaddr_in *psa,
 			char **pPath)
 {
-char	host[30];
+struct hostent *h;
+char	host[64];
 char	*chpt = *pPath;
 char	*path;
 int		len;
@@ -1238,7 +1240,7 @@
 
 	/* split the device name which is in the form
 	 *
-	 * <host_ip> ':' <path>
+	 * <host> ':' <path>
 	 *
 	 * into its components using a local buffer
 	 */
@@ -1254,11 +1256,19 @@
 	strncpy(host, chpt, len);
 	host[len]=0;
 
-	if ( ! inet_pton(AF_INET, host, &psa->sin_addr) ) {
-		errno = ENXIO;
+  /* BEGIN OF NON-THREAD SAFE REGION */
+
+	h = gethostbyname(host);
+
+	if ( !h ) {
+		errno = EINVAL;
 		return -1;
 	}
 
+	memcpy(&psa->sin_addr, h->h_addr, sizeof (struct in_addr));
+  
+  /* END OF NON-THREAD SAFE REGION */
+
 	psa->sin_family = AF_INET;
 	psa->sin_port   = 0;
 	*pPath          = path;
@@ -1898,9 +1908,9 @@
 #endif
 
 
-/* This op is called as the last step of mounting this FS */
-STATIC int nfs_fsmount_me(
-	rtems_filesystem_mount_table_entry_t *mt_entry
+int rtems_nfsfs_initialize(
+	rtems_filesystem_mount_table_entry_t *mt_entry,
+  const void                           *data
 )
 {
 char				*host;
@@ -1917,11 +1927,20 @@
 int					e         = -1;
 char				*path     = mt_entry->dev;
 
+  if (rpcUdpInit () < 0) {
+    fprintf (stderr, "error: initialising RPC\n");
+    return -1;
+  }
+  
+	nfsInit(0, 0);
 
+#if 0
+	printf("Trying to mount %s on %s\n",path,mntpoint);
+#endif
+  
 	if ( buildIpAddr(&uid, &gid, &host, &saddr, &path) )
 		return -1;
 
-
 #ifdef NFS_V2_PORT
 	/* if the portmapper fails, retry a fixed port */
 	for (retry = 1, saddr.sin_port = 0, stat = RPC_FAILED;
@@ -2460,7 +2479,7 @@
 		nfs_chown,			/* OPTIONAL; may be NULL */
 		nfs_freenode,		/* OPTIONAL; may be NULL; (release node_access) */
 		nfs_mount,			/* OPTIONAL; may be NULL */
-		nfs_fsmount_me,		/* OPTIONAL; may be NULL -- but this makes NO SENSE */
+		rtems_nfsfs_initialize,		/* OPTIONAL; may be NULL -- not used anymore */
 		nfs_unmount,		/* OPTIONAL; may be NULL */
 		nfs_fsunmount_me,	/* OPTIONAL; may be NULL */
 		nfs_utime,			/* OPTIONAL; may be NULL */
@@ -3228,6 +3247,8 @@
 	return 0;
 }
 
+#if 0
+CCJ_REMOVE_MOUNT
 /* convenience wrapper
  *
  * NOTE: this routine calls NON-REENTRANT
@@ -3237,7 +3258,6 @@
 int
 nfsMount(char *uidhost, char *path, char *mntpoint)
 {
-rtems_filesystem_mount_table_entry_t	*mtab;
 struct stat								st;
 int										devl;
 char									*host;
@@ -3310,11 +3330,11 @@
 
 	printf("Trying to mount %s on %s\n",dev,mntpoint);
 
-	if (mount(&mtab,
-			  &nfs_fs_ops,
-			  RTEMS_FILESYSTEM_READ_WRITE,
-			  dev,
-			  mntpoint)) {
+	if (mount(dev,
+			  mntpoint,
+			  "nfs",
+ 			  RTEMS_FILESYSTEM_READ_WRITE,
+ 			  NULL)) {
 		perror("nfsMount - mount");
 		goto cleanup;
 	}
@@ -3325,6 +3345,7 @@
 	free(dev);
 	return rval;
 }
+#endif
 
 /* HERE COMES A REALLY UGLY HACK */
 

diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems.c:1.8 rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems.c:1.9
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems.c:1.8	Fri May 28 10:16:39 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems.c	Mon May 31 08:56:37 2010
@@ -120,7 +120,7 @@
     node_len = 0;
     while (!rtems_filesystem_is_separator (*path) &&
            (*path != '\0') && pathlen &&
-           (node_len + 1 < rtems_rfs_fs_max_name (fs)))
+           ((node_len + 1) < rtems_rfs_fs_max_name (fs)))
     {
       path++;
       pathlen--;
@@ -1214,7 +1214,8 @@
  * Forward decl for the ops table.
  */
 
-int rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t *mt_entry);
+int rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t *mt_entry,
+                                const void                           *data);
 int rtems_rfs_rtems_shutdown (rtems_filesystem_mount_table_entry_t *mt_entry);
 
 /**
@@ -1247,7 +1248,8 @@
  */
 
 int
-rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t* mt_entry)
+rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t* mt_entry,
+                            const void*                           data)
 {
   rtems_rfs_rtems_private* rtems;
   rtems_rfs_file_system*   fs;

diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs.h:1.1 rtems/cpukit/libfs/src/rfs/rtems-rfs.h:1.2
--- rtems/cpukit/libfs/src/rfs/rtems-rfs.h:1.1	Wed Feb 17 18:24:25 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs.h	Mon May 31 08:56:37 2010
@@ -23,13 +23,8 @@
 #include <rtems/fs.h>
 
 /**
- * File ops table for the RFS file system.
- */
-const rtems_filesystem_operations_table rtems_rfs_ops;
-
-/**
  * Initialise the RFS File system.
  */
-int rtems_rfs_initialise (rtems_filesystem_mount_table_entry_t *mt_entry);
+int rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t *mt_entry);
 
 #endif

diff -u rtems/cpukit/libmisc/Makefile.am:1.84 rtems/cpukit/libmisc/Makefile.am:1.85
--- rtems/cpukit/libmisc/Makefile.am:1.84	Sat Mar 27 22:25:06 2010
+++ rtems/cpukit/libmisc/Makefile.am	Mon May 31 08:56:37 2010
@@ -76,7 +76,7 @@
     shell/main_id.c shell/main_logoff.c shell/main_ln.c shell/main_ls.c \
     shell/main_mallocinfo.c shell/main_mdump.c shell/main_medit.c \
     shell/main_mfill.c shell/main_mkdir.c shell/main_mount.c \
-    shell/main_mount_msdos.c shell/main_mmove.c shell/main_msdosfmt.c \
+    shell/main_mmove.c shell/main_msdosfmt.c \
     shell/main_mv.c shell/main_mwdump.c shell/main_perioduse.c \
     shell/main_pwd.c shell/main_rm.c shell/main_rmdir.c shell/main_sleep.c \
     shell/main_stackuse.c shell/main_tty.c shell/main_umask.c \
@@ -95,14 +95,13 @@
     shell/dd-misc.c shell/dd-position.c \
     shell/main_hexdump.c shell/hexdump-conv.c shell/hexdump-display.c \
     shell/hexdump-odsyntax.c shell/hexdump-parse.c shell/hexsyntax.c \
-    shell/main_time.c shell/main_mknod.c  shell/main_mount_rfs.c \
+    shell/main_time.c shell/main_mknod.c \
     shell/main_setenv.c shell/main_getenv.c shell/main_unsetenv.c \
     shell/main_mkrfs.c shell/main_debugrfs.c
 
 if LIBNETWORKING
-libshell_a_SOURCES += shell/main_mount_ftp.c shell/main_mount_tftp.c \
-    shell/main_ifconfig.c shell/main_route.c shell/main_netstats.c \
-    shell/main_mount_nfs.c
+libshell_a_SOURCES += \
+    shell/main_ifconfig.c shell/main_route.c shell/main_netstats.c
 endif
 endif
 

diff -u rtems/cpukit/libmisc/fsmount/fsmount.h:1.6 rtems/cpukit/libmisc/fsmount/fsmount.h:1.7
--- rtems/cpukit/libmisc/fsmount/fsmount.h:1.6	Tue May  5 07:57:16 2009
+++ rtems/cpukit/libmisc/fsmount/fsmount.h	Mon May 31 08:56:37 2010
@@ -90,24 +90,24 @@
  */
 typedef struct {
   /**
-   * Device file path.
+   * Source for the mount.
    */
-  const char *dev;
+  const char *source;
 
   /**
-   * Mount point path.
+   * Target for the mount.
    */
-  const char *mount_point;
+  const char *target;
 
   /**
    * File system operations.
    */
-  const rtems_filesystem_operations_table *fs_ops;
+  const char *type;
 
   /**
    * File system mount options.
    */
-  rtems_filesystem_options_t mount_options;
+  rtems_filesystem_options_t options;
 
   /**
    * Report @ref rtems_fstab_conditions "condition flags".
@@ -128,7 +128,7 @@
  *
  * @see rtems_fsmount().
  */
-int rtems_fsmount_create_mount_point( const char *mount_point);
+int rtems_fsmount_create_mount_point(const char *mount_point);
 
 /**
  * Mounts the file systems listed in the file system mount table @a fstab of
@@ -160,23 +160,22 @@
  *
  * #include <rtems.h>
  * #include <rtems/bdpart.h>
- * #include <rtems/dosfs.h>
  * #include <rtems/error.h>
  * #include <rtems/fsmount.h>
  *
  * static const rtems_fstab_entry fstab [] = {
  *   {
- *     .dev = "/dev/sd-card-a",
- *     .mount_point = "/mnt",
- *     .fs_ops = &msdos_ops,
- *     .mount_options = RTEMS_FILESYSTEM_READ_WRITE,
+ *     .source = "/dev/sd-card-a",
+ *     .target = "/mnt",
+ *     .type = "dosfs",
+ *     .options = RTEMS_FILESYSTEM_READ_WRITE,
  *     .report_reasons = RTEMS_FSTAB_ANY,
  *     .abort_reasons = RTEMS_FSTAB_OK
  *   }, {
- *     .dev = "/dev/sd-card-a1",
- *     .mount_point = "/mnt",
- *     .fs_ops = &msdos_ops,
- *     .mount_options = RTEMS_FILESYSTEM_READ_WRITE,
+ *     .source = "/dev/sd-card-a1",
+ *     .target = "/mnt",
+ *     .type = "dosfs",
+ *     .options = RTEMS_FILESYSTEM_READ_WRITE,
  *     .report_reasons = RTEMS_FSTAB_ANY,
  *     .abort_reasons = RTEMS_FSTAB_NONE
  *   }

diff -u rtems/cpukit/libmisc/fsmount/fsmount.c:1.11 rtems/cpukit/libmisc/fsmount/fsmount.c:1.12
--- rtems/cpukit/libmisc/fsmount/fsmount.c:1.11	Wed Jan 20 10:24:11 2010
+++ rtems/cpukit/libmisc/fsmount/fsmount.c	Mon May 31 08:56:37 2010
@@ -118,82 +118,81 @@
 int rtems_fsmount
 (
 /*-------------------------------------------------------------------------*\
-| Purpose:                                                                  |
-|  This function will create the mount points listed and mount the file     |
-|   systems listed in the calling parameters                                |
-+---------------------------------------------------------------------------+
-| Input Parameters:                                                         |
-\*-------------------------------------------------------------------------*/
- const rtems_fstab_entry *fstab_ptr,
- size_t fstab_count,
- size_t *fail_idx
+  | Purpose:                                                                  |
+  |  This function will create the mount points listed and mount the file     |
+  |   systems listed in the calling parameters                                |
+  +---------------------------------------------------------------------------+
+  | Input Parameters:                                                         |
+  \*-------------------------------------------------------------------------*/
+  const rtems_fstab_entry *fstab_ptr,
+  size_t fstab_count,
+  size_t *fail_idx
  )
 /*-------------------------------------------------------------------------*\
-| Return Value:                                                             |
-|    0, if success, -1 and errno if failed                                  |
-\*=========================================================================*/
+  | Return Value:                                                             |
+  |    0, if success, -1 and errno if failed                                  |
+  \*=========================================================================*/
 {
   int rc = 0;
   int tmp_rc;
   size_t fstab_idx = 0;
-  rtems_filesystem_mount_table_entry_t *tmp_mt_entry;
   bool terminate = false;
 
   /*
    * scan through all fstab entries;
    */
   while (!terminate &&
-	 (fstab_idx < fstab_count)) {
+         (fstab_idx < fstab_count)) {
     tmp_rc = 0;
     /*
      * create mount point
      */
     if (tmp_rc == 0) {
-      tmp_rc = rtems_fsmount_create_mount_point(fstab_ptr->mount_point);
+      tmp_rc = rtems_fsmount_create_mount_point(fstab_ptr->target);
       if (tmp_rc != 0) {
-	if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNTPNT_CRTERR)) {
-	  fprintf(stdout,"fsmount: creation of mount point \"%s\" failed: %s\n",
-		 fstab_ptr->mount_point,
-		 strerror(errno));
-	}
-	if (0 != (fstab_ptr->abort_reasons & FSMOUNT_MNTPNT_CRTERR)) {
-	  terminate = true;
-	  rc = tmp_rc;
-	}
+        if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNTPNT_CRTERR)) {
+          fprintf(stdout,"fsmount: creation of mount point \"%s\" failed: %s\n",
+                  fstab_ptr->target,
+                  strerror(errno));
+        }
+        if (0 != (fstab_ptr->abort_reasons & FSMOUNT_MNTPNT_CRTERR)) {
+          terminate = true;
+          rc = tmp_rc;
+        }
       }
     }
     /*
      * mount device to given mount point
      */
     if (tmp_rc == 0) {
-      tmp_rc = mount(&tmp_mt_entry,
-		     fstab_ptr->fs_ops,
-		     fstab_ptr->mount_options,
-		     fstab_ptr->dev,
-		     fstab_ptr->mount_point);
+      tmp_rc = mount(fstab_ptr->source,
+                     fstab_ptr->target,
+                     fstab_ptr->type,
+                     fstab_ptr->options,
+                     NULL);
       if (tmp_rc != 0) {
-	if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNT_FAILED)) {
-	  fprintf(stdout,"fsmount: mounting of \"%s\" to"
-		 " \"%s\" failed: %s\n",
-		 fstab_ptr->dev,
-		 fstab_ptr->mount_point,
-		 strerror(errno));
-	}
-	if (0 != (fstab_ptr->abort_reasons & FSMOUNT_MNT_FAILED)) {
-	  terminate = true;
-	  rc = tmp_rc;
-	}
+        if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNT_FAILED)) {
+          fprintf(stdout,"fsmount: mounting of \"%s\" to"
+                  " \"%s\" failed: %s\n",
+                  fstab_ptr->source,
+                  fstab_ptr->target,
+                  strerror(errno));
+        }
+        if (0 != (fstab_ptr->abort_reasons & FSMOUNT_MNT_FAILED)) {
+          terminate = true;
+          rc = tmp_rc;
+        }
       }
       else {
-	if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNT_OK)) {
-	  fprintf(stdout,"fsmount: mounting of \"%s\" to"
-		 " \"%s\" succeeded\n",
-		 fstab_ptr->dev,
-		 fstab_ptr->mount_point);
-	}
-	if (0 != (fstab_ptr->abort_reasons & FSMOUNT_MNT_OK)) {
-	  terminate = true;
-	}
+        if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNT_OK)) {
+          fprintf(stdout,"fsmount: mounting of \"%s\" to"
+                  " \"%s\" succeeded\n",
+                  fstab_ptr->source,
+                  fstab_ptr->target);
+        }
+        if (0 != (fstab_ptr->abort_reasons & FSMOUNT_MNT_OK)) {
+          terminate = true;
+        }
       }
     }
     /*

diff -u rtems/cpukit/libmisc/shell/main_mount.c:1.7 rtems/cpukit/libmisc/shell/main_mount.c:1.8
--- rtems/cpukit/libmisc/shell/main_mount.c:1.7	Sun Nov 29 06:12:39 2009
+++ rtems/cpukit/libmisc/shell/main_mount.c	Mon May 31 08:56:37 2010
@@ -24,74 +24,24 @@
 #include <rtems.h>
 #include <rtems/shell.h>
 #include <rtems/shellconfig.h>
-#include <rtems/dosfs.h>
-#include <rtems/fsmount.h>
+#include <rtems/libio.h>
 #include "internal.h"
 
-static rtems_chain_control filesystems;
-static bool                fs_init;
-
-static void rtems_shell_mount_fsys_init(void)
-{
-  if (!fs_init)
-  {
-    rtems_chain_initialize_empty (&filesystems);
-    fs_init = true;
-  }
-}
-
-void rtems_shell_mount_add_fsys(rtems_shell_filesystems_t* fs)
-{
-  rtems_shell_mount_fsys_init();
-  rtems_chain_append (&filesystems, &fs->link);
-}
-
-void rtems_shell_mount_del_fsys(rtems_shell_filesystems_t* fs)
-{
-  if (fs_init)
-    rtems_chain_extract (&fs->link);
-}
-
-int rtems_shell_libc_mounter(
-  const char*                driver,
-  const char*                path,
-  rtems_shell_filesystems_t* fs,
-  rtems_filesystem_options_t options)
-{
-  rtems_filesystem_mount_table_entry_t* mt_entry;
-  /*
-   * Mount the disk.
-   */
-
-  if (mount (&mt_entry, fs->fs_ops, options, (char*) driver, (char*) path) < 0)
-  {
-    fprintf (stderr, "mount: mount failed: %s\n", strerror (errno));
-    return 1;
-  }
-
-  return 0;
-}
-
-#define NUMOF(_i) (sizeof (_i) / sizeof (_i[0]))
-
 int rtems_shell_main_mount(
   int   argc,
   char *argv[]
 )
 {
   rtems_filesystem_options_t options = RTEMS_FILESYSTEM_READ_WRITE;
-  rtems_shell_filesystems_t* fs = NULL;
-  char*                      driver = NULL;
-  char*                      mount_point = NULL;
+  char*                      type = NULL;
+  char*                      source = NULL;
+  char*                      target = NULL;
+  char*                      fsoptions = NULL;
   int                        arg;
 
-  rtems_shell_mount_fsys_init();
-
   for (arg = 1; arg < argc; arg++) {
     if (argv[arg][0] == '-') {
       if (argv[arg][1] == 't') {
-        rtems_shell_filesystems_t** a;
-
         arg++;
         if (arg == argc) {
           fprintf(
@@ -101,71 +51,58 @@
           );
           return 1;
         }
-
-        for (a = rtems_shell_Mount_filesystems; *a; a++) {
-          if (strcmp (argv[arg], (*a)->name) == 0) {
-            fs = *a;
-            break;
-          }
-        }
-
-        if (!fs && !rtems_chain_is_empty(&filesystems)) {
-          rtems_chain_node* node = filesystems.first;
-          while (!rtems_chain_is_tail (&filesystems, node)) {
-            rtems_shell_filesystems_t* f = (rtems_shell_filesystems_t*)node;
-            if (strcmp (argv[arg], f->name) == 0) {
-              fs = f;
-              break;
-            }
-            node = node->next;
-          }
-        }
+        type = argv[arg];
       } else if (argv[arg][1] == 'r') {
         options = RTEMS_FILESYSTEM_READ_ONLY;
       } else if (argv[arg][1] == 'L') {
-        rtems_shell_filesystems_t** a;
-        fprintf (stderr, "File systems: ");
-        for (a = rtems_shell_Mount_filesystems; *a; a++)
-          if (*a)
-            fprintf (stderr, "%s ", (*a)->name);
-        if (!rtems_chain_is_empty(&filesystems)) {
-          rtems_chain_node* node = filesystems.first;
-          while (!rtems_chain_is_tail (&filesystems, node)) {
-            rtems_shell_filesystems_t* f = (rtems_shell_filesystems_t*)node;
-            fprintf (stderr, "%s ", f->name);
-            node = node->next;
-          }
+        const rtems_filesystem_table_t* fs;
+        fs = rtems_filesystem_table_first();
+        printf ("File systems: ");
+        while (fs) {
+          printf ("%s ", fs->type);
+          fs = rtems_filesystem_table_next(fs);
         }
-        fprintf (stderr, "\n");
-        return 1;
+        printf ("\n");
+        return 0;
+      } else if (argv[arg][1] == 'o') {
+        arg++;
+        if (arg == argc) {
+          fprintf(
+            stderr,
+            "%s: -o needs a list if filesystem options.\n",
+            argv[0]
+          );
+          return 1;
+        }
+        fsoptions = argv[arg];
       } else {
         fprintf (stderr, "unknown option: %s\n", argv[arg]);
         return 1;
       }
     } else {
-      if (!driver)
-        driver = argv[arg];
-      else if (!mount_point)
-        mount_point = argv[arg];
+      if (!source)
+        source = argv[arg];
+      else if (!target)
+        target = argv[arg];
       else {
         fprintf (
-          stderr, "mount: driver and mount only require: %s\n", argv[arg]);
+          stderr, "mount: source and mount only require: %s\n", argv[arg]);
         return 1;
       }
     }
   }
 
-  if (fs == NULL) {
+  if (!type) {
     fprintf (stderr, "mount: no file-system; see the -L option\n");
     return 1;
   }
 
-  if (fs->driver_needed && !driver) {
-    fprintf (stderr, "mount: no driver\n");
+  if (!source) {
+    fprintf (stderr, "mount: no source\n");
     return 1;
   }
 
-  if (!mount_point) {
+  if (!target) {
     fprintf (stderr, "mount: no mount point\n");
     return 1;
   }
@@ -174,19 +111,21 @@
    * Mount the disk.
    */
 
-  if (fs->mounter (driver, mount_point, fs, options))
+  if (mount (source, target, type, options, fsoptions) < 0) {
+    fprintf (stderr, "error: %s\n", strerror(errno));
     return 1;
+  }
 
-  printf ("mounted %s -> %s\n", driver, mount_point);
+  printf ("mounted %s -> %s\n", source, target);
 
   return 0;
 }
 
 rtems_shell_cmd_t rtems_shell_MOUNT_Command = {
-  "mount",                                                /* name */
-  "mount [-t fstype] [-r] [-L] device path # mount disk", /* usage */
-  "files",                                                /* topic */
-  rtems_shell_main_mount,                                 /* command */
-  NULL,                                                   /* alias */
-  NULL                                                    /* next */
+  "mount",                                     /* name */
+  "mount [-t type] [-r] [-L] source target",   /* usage */
+  "files",                                     /* topic */
+  rtems_shell_main_mount,                      /* command */
+  NULL,                                        /* alias */
+  NULL                                         /* next */
 };

diff -u rtems/cpukit/libmisc/shell/shellconfig.h:1.26 rtems/cpukit/libmisc/shell/shellconfig.h:1.27
--- rtems/cpukit/libmisc/shell/shellconfig.h:1.26	Wed Feb 24 03:30:40 2010
+++ rtems/cpukit/libmisc/shell/shellconfig.h	Mon May 31 08:56:37 2010
@@ -92,17 +92,6 @@
 extern rtems_shell_alias_t *rtems_shell_Initial_aliases[];
 
 /*
- *  Externs for mount command helpers
- */
-extern rtems_shell_filesystems_t rtems_shell_Mount_RFS;
-extern rtems_shell_filesystems_t rtems_shell_Mount_MSDOS;
-extern rtems_shell_filesystems_t rtems_shell_Mount_TFTP;
-extern rtems_shell_filesystems_t rtems_shell_Mount_FTP;
-extern rtems_shell_filesystems_t rtems_shell_Mount_NFS;
-
-extern rtems_shell_filesystems_t *rtems_shell_Mount_filesystems[];
-
-/*
  *  If we are configured to alias a command, then make sure the underlying
  *  command is configured.
  */
@@ -444,34 +433,6 @@
     NULL
   };
 
-  /*
-   * The mount command's support file system types.
-   */
-  #if (defined(CONFIGURE_SHELL_COMMANDS_ALL) && \
-       !defined(CONFIGURE_SHELL_COMMAND_NO_MOUNT)) || \
-       defined(CONFIGURE_SHELL_COMMAND_MOUNT)
-    rtems_shell_filesystems_t *rtems_shell_Mount_filesystems[] = {
-      #if defined(CONFIGURE_SHELL_MOUNT_RFS)
-        &rtems_shell_Mount_RFS,
-      #endif
-      #if defined(CONFIGURE_SHELL_MOUNT_MSDOS)
-        &rtems_shell_Mount_MSDOS,
-      #endif
-      #if RTEMS_NETWORKING
-        #if defined(CONFIGURE_SHELL_MOUNT_TFTP)
-          &rtems_shell_Mount_TFTP,
-        #endif
-        #if defined(CONFIGURE_SHELL_MOUNT_FTP)
-          &rtems_shell_Mount_FTP,
-        #endif
-        #if defined(CONFIGURE_SHELL_MOUNT_NFS)
-          &rtems_shell_Mount_NFS,
-        #endif
-      #endif
-      NULL
-    };
-  #endif
-
 #endif
 
 #endif

diff -u rtems/cpukit/libnetworking/lib/ftpfs.c:1.28 rtems/cpukit/libnetworking/lib/ftpfs.c:1.29
--- rtems/cpukit/libnetworking/lib/ftpfs.c:1.28	Thu May 27 11:36:02 2010
+++ rtems/cpukit/libnetworking/lib/ftpfs.c	Mon May 31 08:56:37 2010
@@ -130,6 +130,8 @@
   return 0;
 }
 
+#if 0
+CCJ_REMOVE_MOUNT
 rtems_status_code rtems_ftpfs_mount(const char *mount_point)
 {
   int rv = 0;
@@ -156,6 +158,7 @@
 
   return RTEMS_SUCCESSFUL;
 }
+#endif
 
 static rtems_status_code rtems_ftpfs_do_ioctl(
   const char *mount_point,
@@ -234,19 +237,6 @@
   );
 }
 
-int rtems_bsdnet_initialize_ftp_filesystem(void)
-{
-  rtems_status_code sc = RTEMS_SUCCESSFUL;
-
-  sc = rtems_ftpfs_mount(NULL);
-
-  if (sc == RTEMS_SUCCESSFUL) {
-    return 0;
-  } else {
-    return -1;
-  }
-}
-
 typedef void (*rtems_ftpfs_reply_parser)(
   const char * /* reply fragment */,
   size_t /* reply fragment length */,
@@ -1232,8 +1222,9 @@
   return RTEMS_FILESYSTEM_MEMORY_FILE;
 }
 
-static int rtems_ftpfs_mount_me(
-  rtems_filesystem_mount_table_entry_t *e
+int rtems_ftpfs_initialize(
+  rtems_filesystem_mount_table_entry_t *e,
+  const void                           *d
 )
 {
   rtems_ftpfs_mount_entry *me = malloc(sizeof(rtems_ftpfs_mount_entry));
@@ -1337,7 +1328,7 @@
   .chown_h = NULL,
   .freenod_h = rtems_ftpfs_free_node,
   .mount_h = NULL,
-  .fsmount_me_h = rtems_ftpfs_mount_me,
+  .fsmount_me_h = rtems_ftpfs_initialize,
   .unmount_h = NULL,
   .fsunmount_me_h = rtems_ftpfs_unmount_me,
   .utime_h = NULL,

diff -u rtems/cpukit/libnetworking/lib/tftpDriver.c:1.37 rtems/cpukit/libnetworking/lib/tftpDriver.c:1.38
--- rtems/cpukit/libnetworking/lib/tftpDriver.c:1.37	Thu May 27 11:36:02 2010
+++ rtems/cpukit/libnetworking/lib/tftpDriver.c	Mon May 31 08:56:37 2010
@@ -33,6 +33,7 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#include <netdb.h>
 
 #ifdef RTEMS_TFTP_DRIVER_DEBUG
 int rtems_tftp_driver_debug = 1;
@@ -44,18 +45,6 @@
 #define UDP_PORT_BASE        3180
 
 /*
- * Pathname prefix
- */
-#define TFTP_PATHNAME_PREFIX "/TFTP/"
-
-/*
- * Root node_access value
- * By using the address of a local static variable
- * we ensure a unique value for this identifier.
- */
-#define ROOT_NODE_ACCESS    (&tftp_mutex)
-
-/*
  * Default limits
  */
 #define PACKET_FIRST_TIMEOUT_MILLISECONDS  400L
@@ -152,43 +141,49 @@
 };
 
 /*
- * Number of streams open at the same time
+ * Flags for filesystem info.
  */
-static rtems_id tftp_mutex;
-static int nStreams;
-static struct tftpStream ** volatile tftpStreams;
+#define TFTPFS_VERBOSE (1 << 0)
 
-typedef const char *tftp_node;
-extern rtems_filesystem_operations_table  rtems_tftp_ops;
-extern rtems_filesystem_file_handlers_r   rtems_tftp_handlers;
+/*
+ * Root node_access value
+ * By using the address of the file system 
+ * we ensure a unique value for this identifier.
+ */
+#define ROOT_NODE_ACCESS(_fs) (_fs)
 
 /*
- *  Direct copy from the IMFS.  Look at this.
+ * TFTP File system info.
  */
+typedef struct tftpfs_info_s {
+  uint32_t flags;
+  rtems_id tftp_mutex;
+  int nStreams;
+  struct tftpStream ** volatile tftpStreams;
+} tftpfs_info_t;
 
-rtems_filesystem_limits_and_options_t rtems_tftp_limits_and_options = {
-   5,   /* link_max */
-   6,   /* max_canon */
-   7,   /* max_input */
-   255, /* name_max */
-   255, /* path_max */
-   2,   /* pipe_buf */
-   1,   /* posix_async_io */
-   2,   /* posix_chown_restrictions */
-   3,   /* posix_no_trunc */
-   4,   /* posix_prio_io */
-   5,   /* posix_sync_io */
-   6    /* posix_vdisable */
-};
+#define tftpfs_info_mount_table(_mt) ((tftpfs_info_t*) ((_mt)->fs_info))
+#define tftpfs_info_pathloc(_pl)     ((tftpfs_info_t*) ((_pl)->mt_entry->fs_info))
+#define tftpfs_info_iop(_iop)        (tftpfs_info_pathloc (&((_iop)->pathinfo)))
+
+/*
+ * Number of streams open at the same time
+ */
+
+typedef const char *tftp_node;
+extern rtems_filesystem_operations_table  rtems_tftp_ops;
+extern rtems_filesystem_file_handlers_r   rtems_tftp_handlers;
 
-static int rtems_tftp_mount_me(
-  rtems_filesystem_mount_table_entry_t *temp_mt_entry
+int rtems_tftpfs_initialize(
+  rtems_filesystem_mount_table_entry_t *mt_entry,
+  const void                           *data
 )
 {
+  tftpfs_info_t     *fs;
   rtems_status_code  sc;
 
-  temp_mt_entry->mt_fs_root.handlers = &rtems_tftp_handlers;
-  temp_mt_entry->mt_fs_root.ops      = &rtems_tftp_ops;
+  mt_entry->mt_fs_root.handlers = &rtems_tftp_handlers;
+  mt_entry->mt_fs_root.ops      = &rtems_tftp_ops;
 
   /*
    *   We have no tftp filesystem specific data to maintain.  This
@@ -197,16 +192,18 @@
    *   And we maintain no real filesystem nodes, so there is no real root.
    */
 
-  temp_mt_entry->fs_info                = NULL;
-  temp_mt_entry->mt_fs_root.node_access = ROOT_NODE_ACCESS;
-
-  /*
-   *  These need to be looked at for full POSIX semantics.
-   */
-
-  temp_mt_entry->pathconf_limits_and_options = rtems_tftp_limits_and_options;
-
-
+  fs = malloc (sizeof (tftpfs_info_t));
+  if (!fs)
+      rtems_set_errno_and_return_minus_one (ENOMEM);
+
+  fs->flags = 0;
+  fs->nStreams = 0;
+  fs->tftpStreams = 0;
+  
+  mt_entry->fs_info                  = fs;
+  mt_entry->mt_fs_root.node_access   = ROOT_NODE_ACCESS (fs);
+  mt_entry->mt_fs_root.node_access_2 = NULL;
+  
   /*
    *  Now allocate a semaphore for mutual exclusion.
    *
@@ -222,40 +219,51 @@
     RTEMS_NO_PRIORITY_CEILING |
     RTEMS_LOCAL,
     0,
-    &tftp_mutex
+    &fs->tftp_mutex
   );
 
   if (sc != RTEMS_SUCCESSFUL)
-    rtems_set_errno_and_return_minus_one( ENOMEM );
+      rtems_set_errno_and_return_minus_one (ENOMEM);
 
+  if (data) {
+      char* config = (char*) data;
+      char* token;
+      char* saveptr;
+      token = strtok_r (config, " ", &saveptr);
+      while (token) {
+          if (strcmp (token, "verbose") == 0)
+              fs->flags |= TFTPFS_VERBOSE;
+          token = strtok_r (NULL, " ", &saveptr);
+      }
+  }
+  
   return 0;
 }
 
 /*
- * Initialize the TFTP driver
+ * Release a stream and clear the pointer to it
  */
-
-int rtems_bsdnet_initialize_tftp_filesystem (void)
+static void
+releaseStream (tftpfs_info_t *fs, int s)
 {
-    int                                   status;
-    rtems_filesystem_mount_table_entry_t *entry;
-
-    status = mkdir( TFTP_PATHNAME_PREFIX, S_IRWXU | S_IRWXG | S_IRWXO );
-    if ( status == -1 )
-        return status;
-
-    status = mount(
-            &entry,
-            &rtems_tftp_ops,
-            RTEMS_FILESYSTEM_READ_WRITE,
-            NULL,
-            TFTP_PATHNAME_PREFIX
-    );
-
-    if ( status )
-        perror( "TFTP mount failed" );
+    if (fs->tftpStreams[s] && (fs->tftpStreams[s]->socket >= 0))
+        close (fs->tftpStreams[s]->socket);
+    rtems_semaphore_obtain (fs->tftp_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
+    free (fs->tftpStreams[s]);
+    fs->tftpStreams[s] = NULL;
+    rtems_semaphore_release (fs->tftp_mutex);
+}
 
-    return status;
+static int
+rtems_tftpfs_shutdown (rtems_filesystem_mount_table_entry_t* mt_entry)
+{
+  tftpfs_info_t *fs = tftpfs_info_mount_table (mt_entry);
+  int            s;
+  for (s = 0; s < fs->nStreams; s++)
+      releaseStream (fs, s);
+  rtems_semaphore_delete (fs->tftp_mutex);
+  free (fs);
+  return 0;
 }
 
 /*
@@ -335,8 +343,8 @@
         } from;
         socklen_t fromlen = sizeof from;
         len = recvfrom (tp->socket, &tp->pkbuf,
-                                                    sizeof tp->pkbuf, 0,
-                                                    &from.s, &fromlen);
+                        sizeof tp->pkbuf, 0,
+                        &from.s, &fromlen);
         if (len < 0)
             break;
         if (from.i.sin_addr.s_addr == tp->farAddress.sin_addr.s_addr) {
@@ -410,18 +418,6 @@
     return 0;
 }
 
-/*
- * Release a stream and clear the pointer to it
- */
-static void
-releaseStream (int s)
-{
-    rtems_semaphore_obtain (tftp_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
-    free (tftpStreams[s]);
-    tftpStreams[s] = NULL;
-    rtems_semaphore_release (tftp_mutex);
-}
-
 static int rtems_tftp_evaluate_for_make(
    const char                         *path __attribute__((unused)),       /* IN     */
    rtems_filesystem_location_info_t   *pathloc,    /* IN/OUT */
@@ -429,7 +425,8 @@
 )
 {
   pathloc->node_access = NULL;
-  rtems_set_errno_and_return_minus_one( EIO );
+  pathloc->node_access_2 = NULL;
+  rtems_set_errno_and_return_minus_one (EIO);
 }
 
 /*
@@ -493,46 +490,54 @@
   rtems_filesystem_location_info_t  *pathloc       /* IN/OUT */
 )
 {
-    pathloc->handlers    = &rtems_tftp_handlers;
+    tftpfs_info_t *fs;
+    char          *cp;
+
+    /*
+     * Get the file system info.
+     */
+    fs = tftpfs_info_pathloc (pathloc);
+
+    pathloc->handlers = &rtems_tftp_handlers;
 
     /*
      * Hack to provide the illusion of directories inside the TFTP file system.
      * Paths ending in a / are assumed to be directories.
      */
     if (pathname[strlen(pathname)-1] == '/') {
-        int isRelative = (pathloc->node_access != ROOT_NODE_ACCESS);
-        char *cp;
+        int nal = 0;
+        if (pathloc->node_access != ROOT_NODE_ACCESS (fs))
+            nal = strlen(pathloc->node_access);
+        cp = malloc(nal + pathnamelen + 1);
+        if (cp == NULL)
+            rtems_set_errno_and_return_minus_one(ENOMEM);
+        if (nal)
+            memcpy (cp, pathloc->node_access, nal);
+        memcpy(cp + nal, pathname, pathnamelen);
+        cp[nal + pathnamelen] = '\0';
+        fixPath (cp);
+        pathloc->node_access = cp;
+    }
+    else {
+        if (pathnamelen) {
+            /*
+             * Reject it if it's not read-only or write-only.
+             */
+            flags &= RTEMS_LIBIO_PERMS_READ | RTEMS_LIBIO_PERMS_WRITE;
+            if ((flags != RTEMS_LIBIO_PERMS_READ)   \
+                && (flags != RTEMS_LIBIO_PERMS_WRITE))
+                rtems_set_errno_and_return_minus_one(EINVAL);
 
-        /*
-         * Reject attempts to open() directories
-         */
-        if (flags & RTEMS_LIBIO_PERMS_RDWR)
-            rtems_set_errno_and_return_minus_one( EISDIR );
-        if (isRelative) {
-            cp = malloc (strlen(pathloc->node_access)+strlen(pathname)+1);
-            if (cp == NULL)
-                rtems_set_errno_and_return_minus_one( ENOMEM );
-            strcpy (cp, pathloc->node_access);
-            strcat (cp, pathname);
-        }
-        else {
-            cp = strdup (pathname);
+            cp = malloc(pathnamelen + 1);
             if (cp == NULL)
-                rtems_set_errno_and_return_minus_one( ENOMEM );
+                rtems_set_errno_and_return_minus_one(ENOMEM);
+            memcpy(cp, pathname, pathnamelen);
+            cp[pathnamelen] = '\0';
+            fixPath (cp);
+            pathloc->node_access_2 = cp;
         }
-        fixPath (cp);
-        pathloc->node_access = cp;
-        return 0;
     }
-    if (pathloc->node_access != ROOT_NODE_ACCESS)
-        pathloc->node_access = 0;
 
-    /*
-     * Reject it if it's not read-only or write-only.
-     */
-    flags &= RTEMS_LIBIO_PERMS_READ | RTEMS_LIBIO_PERMS_WRITE;
-    if ((flags != RTEMS_LIBIO_PERMS_READ) && (flags != RTEMS_LIBIO_PERMS_WRITE) )
-        rtems_set_errno_and_return_minus_one( EINVAL );
     return 0;
 }
 
@@ -546,6 +551,7 @@
     uint32_t       mode __attribute__((unused))
 )
 {
+    tftpfs_info_t        *fs;
     struct tftpStream    *tp;
     int                  retryCount;
     struct in_addr       farAddress;
@@ -559,71 +565,74 @@
     char                 *hostname;
 
     /*
+     * Get the file system info.
+     */
+    fs = tftpfs_info_iop (iop);
+    
+    /*
      * Extract the host name component
      */
-    cp2 = full_path_name;
-    while (*cp2 == '/')
-        cp2++;
-    hostname = cp2;
-    while (*cp2 != '/') {
-        if (*cp2 == '\0')
-            return ENOENT;
-        cp2++;
+    hostname = full_path_name;
+    cp1 = strchr (full_path_name, ':');
+    if (!cp1)
+        hostname = "BOOTP_HOST";
+    else {
+        *cp1 = '\0';
+        ++cp1;
     }
-    *cp2++ = '\0';
 
     /*
      * Convert hostname to Internet address
      */
     if (strcmp (hostname, "BOOTP_HOST") == 0)
         farAddress = rtems_bsdnet_bootp_server_address;
-    else
-        farAddress.s_addr = inet_addr (hostname);
-    if ((farAddress.s_addr == INADDR_ANY) || (farAddress.s_addr == INADDR_BROADCAST))
+    else if (inet_aton (hostname, &farAddress) == 0) {
+        struct hostent *he = gethostbyname(hostname);
+        if (he == NULL)
+            return ENOENT;
+        memcpy (&farAddress, he->h_addr, sizeof (farAddress));
+    } else {
         return ENOENT;
-
+    }
+    
     /*
      * Extract file pathname component
      */
-    while (*cp2 == '/')
-        cp2++;
-    if (strcmp (cp2, "BOOTP_FILE") == 0) {
-        cp2 = rtems_bsdnet_bootp_boot_file_name;
-        while (*cp2 == '/')
-            cp2++;
+    if (strcmp (cp1, "BOOTP_FILE") == 0) {
+        cp1 = rtems_bsdnet_bootp_boot_file_name;
     }
-    if (*cp2 == '\0')
+    if (*cp1 == '\0')
         return ENOENT;
-    remoteFilename = cp2;
+    remoteFilename = cp1;
     if (strlen (remoteFilename) > (TFTP_BUFSIZE - 10))
         return ENOENT;
 
     /*
      * Find a free stream
      */
-    sc = rtems_semaphore_obtain (tftp_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
+    sc = rtems_semaphore_obtain (fs->tftp_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
     if (sc != RTEMS_SUCCESSFUL)
         return EBUSY;
-    for (s = 0 ; s < nStreams ; s++) {
-        if (tftpStreams[s] == NULL)
+    for (s = 0 ; s < fs->nStreams ; s++) {
+        if (fs->tftpStreams[s] == NULL)
         break;
     }
-    if (s == nStreams) {
+    if (s == fs->nStreams) {
         /*
          * Reallocate stream pointers
          * Guard against the case where realloc() returns NULL.
          */
         struct tftpStream **np;
 
-        np = realloc (tftpStreams, ++nStreams * sizeof *tftpStreams);
+        np = realloc (fs->tftpStreams, ++fs->nStreams * sizeof *fs->tftpStreams);
         if (np == NULL) {
-            rtems_semaphore_release (tftp_mutex);
+            rtems_semaphore_release (fs->tftp_mutex);
             return ENOMEM;
         }
-        tftpStreams = np;
+        fs->tftpStreams = np;
     }
-    tp = tftpStreams[s] = malloc (sizeof (struct tftpStream));
-    rtems_semaphore_release (tftp_mutex);
+    tp = fs->tftpStreams[s] = malloc (sizeof (struct tftpStream));
+    rtems_semaphore_release (fs->tftp_mutex);
     if (tp == NULL)
         return ENOMEM;
     iop->data0 = s;
@@ -633,7 +642,7 @@
      * Create the socket
      */
     if ((tp->socket = socket (AF_INET, SOCK_DGRAM, 0)) < 0) {
-        releaseStream (s);
+        releaseStream (fs, s);
         return ENOMEM;
     }
 
@@ -646,13 +655,12 @@
         int try = (now + retryCount) % 10;
 
         tp->myAddress.sin_family = AF_INET;
-        tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try + s);
+        tp->myAddress.sin_port = htons (UDP_PORT_BASE + fs->nStreams * try + s);
         tp->myAddress.sin_addr.s_addr = htonl (INADDR_ANY);
         if (bind (tp->socket, (struct sockaddr *)&tp->myAddress, sizeof tp->myAddress) >= 0)
             break;
         if (++retryCount == 10) {
-            close (tp->socket);
-            releaseStream (s);
+            releaseStream (fs, s);
             return EBUSY;
         }
     }
@@ -697,8 +705,7 @@
         if (sendto (tp->socket, (char *)&tp->pkbuf, len, 0,
                     (struct sockaddr *)&tp->farAddress,
                     sizeof tp->farAddress) < 0) {
-            close (tp->socket);
-            releaseStream (s);
+            releaseStream (fs, s);
             return EIO;
         }
 
@@ -716,8 +723,7 @@
                 tp->nleft = len - 2 * sizeof (uint16_t  );
                 tp->eof = (tp->nleft < TFTP_BUFSIZE);
                 if (sendAck (tp) != 0) {
-                    close (tp->socket);
-                    releaseStream (s);
+                    releaseStream (fs, s);
                     return EIO;
                 }
                 break;
@@ -731,8 +737,7 @@
             }
             if (opcode == TFTP_OPCODE_ERROR) {
                 int e = tftpErrno (tp);
-                close (tp->socket);
-                releaseStream (s);
+                releaseStream (fs, s);
                 return e;
             }
         }
@@ -741,8 +746,7 @@
          * Keep trying
          */
         if (++retryCount >= OPEN_RETRY_LIMIT) {
-            close (tp->socket);
-            releaseStream (s);
+            releaseStream (fs, s);
             return EIO;
         }
     }
@@ -759,36 +763,81 @@
     uint32_t       mode
 )
 {
-    char *full_path_name;
-    char *s1;
-    int err;
-
-    /*
-     * Tack the `current directory' on to relative paths.
-     * We know that the current directory ends in a / character.
-     */
-    if (*new_name == '/') {
-        /*
-         * Skip the TFTP filesystem prefix.
-         */
-        int len = strlen (TFTP_PATHNAME_PREFIX);
-        if (strncmp (new_name, TFTP_PATHNAME_PREFIX, len))
-            return ENOENT;
-        new_name += len;
-        s1 = "";
-    }
+    tftpfs_info_t *fs;
+    const char    *device;
+    char          *full_path_name;
+    char          *na;
+    char          *na2;
+    int           dlen;
+    int           nalen;
+    int           na2len;
+    int           sep1;
+    int           err;
+
+    /*
+     * Get the file system info.
+     */
+    fs = tftpfs_info_iop (iop);
+    
+    /*
+     * Tack the prefix directory if one exists from the device name.
+     */
+    device =
+      rtems_filesystem_mount_device (rtems_filesystem_location_mount (&iop->pathinfo));
+    dlen = strlen (device);
+    if (dlen == 0)
+        rtems_set_errno_and_return_minus_one (ENOENT);
+
+    if (iop->pathinfo.node_access_2 == NULL)
+        rtems_set_errno_and_return_minus_one (ENOENT);
+
+    if (iop->pathinfo.node_access != ROOT_NODE_ACCESS (fs)) {
+        na = iop->pathinfo.node_access;
+        nalen = strlen (na);
+    }     
     else {
-        s1 = rtems_filesystem_current.node_access;
+        na = NULL;
+        nalen = 0;
+    }
+
+    na2 = iop->pathinfo.node_access_2;
+    
+    na2len = strlen (na2);
+
+    if (nalen) {
+      sep1 = 1;
+        if (na[nalen] == '/') {
+            sep1 = 0;
+            if (na2[0] == '/')
+                ++na2;
+        }
+        else {
+            if (na2[0] == '/')
+                sep1 = 0;
+            else
+                sep1 = 1;
+        }
     }
-    full_path_name = malloc (strlen (s1) + strlen (new_name) + 1);
+    else
+      sep1 = 0;
+
+    full_path_name = malloc (dlen + nalen + sep1 + na2len + 1);
     if (full_path_name == NULL)
-        return ENOMEM;
-    strcpy (full_path_name, s1);
-    strcat (full_path_name, new_name);
+        rtems_set_errno_and_return_minus_one(ENOMEM);
+    strcpy (full_path_name, device);
+    if (nalen)
+      strcat (full_path_name, na);
+    if (sep1)
+        strcat (full_path_name, "/");
+    strcat (full_path_name, na2);
     fixPath (full_path_name);
+
+    if (fs->flags & TFTPFS_VERBOSE)
+      printf ("TFTPFS: %s %s %s -> %s\n", device, na, na2, full_path_name);
+
     err = rtems_tftp_open_worker (iop, full_path_name, flags, mode);
     free (full_path_name);
-    return err;
+    rtems_set_errno_and_return_minus_one(err);
 }
 
 /*
@@ -805,7 +854,9 @@
     int               retryCount;
     int               nwant;
 
-
+    if (!tp)
+        rtems_set_errno_and_return_minus_one( EIO );
+    
     /*
      * Read till user request is satisfied or EOF is reached
      */
@@ -841,24 +892,24 @@
                 if ((opcode == TFTP_OPCODE_DATA)
                  && (ntohs (tp->pkbuf.tftpDATA.blocknum) == nextBlock)) {
                     tp->nused = 0;
-                    tp->nleft = len - 2 * sizeof (uint16_t  );
+                    tp->nleft = len - 2 * sizeof (uint16_t);
                     tp->eof = (tp->nleft < TFTP_BUFSIZE);
                     tp->blocknum++;
                     if (sendAck (tp) != 0)
-                        rtems_set_errno_and_return_minus_one( EIO );
+                        rtems_set_errno_and_return_minus_one (EIO);
                     break;
                 }
                 if (opcode == TFTP_OPCODE_ERROR)
-                        rtems_set_errno_and_return_minus_one( tftpErrno (tp) );
+                    rtems_set_errno_and_return_minus_one (tftpErrno (tp));
             }
 
             /*
              * Keep trying?
              */
             if (++retryCount == IO_RETRY_LIMIT)
-                rtems_set_errno_and_return_minus_one( EIO );
+                rtems_set_errno_and_return_minus_one (EIO);
             if (sendAck (tp) != 0)
-                rtems_set_errno_and_return_minus_one( EIO );
+                rtems_set_errno_and_return_minus_one (EIO);
         }
     }
     return count - nwant;
@@ -867,7 +918,7 @@
 /*
  * Flush a write buffer and wait for acknowledgement
  */
-static int rtems_tftp_flush ( struct tftpStream *tp )
+static int rtems_tftp_flush (struct tftpStream *tp)
 {
     int wlen, rlen;
     int retryCount = 0;
@@ -917,10 +968,20 @@
     rtems_libio_t *iop
 )
 {
-    struct tftpStream *tp = iop->data1;;
-
+    tftpfs_info_t     *fs;
+    struct tftpStream *tp = iop->data1;
+    int                e = 0;
+    
+    /*
+     * Get the file system info.
+     */
+    fs = tftpfs_info_iop (iop);
+    
+    if (!tp) 
+        rtems_set_errno_and_return_minus_one (EIO);
+    
     if (tp->writing)
-        rtems_tftp_flush (tp);
+        e = rtems_tftp_flush (tp);
     if (!tp->eof && !tp->firstReply) {
         /*
          * Tell the other end to stop
@@ -930,9 +991,8 @@
         ticksPerSecond = rtems_clock_get_ticks_per_second();
         rtems_task_wake_after (1 + ticksPerSecond / 10);
     }
-    close (tp->socket);
-    releaseStream (iop->data0);
-    return RTEMS_SUCCESSFUL;
+    releaseStream (fs, iop->data0);
+    rtems_set_errno_and_return_minus_one (e);
 }
 
 static ssize_t rtems_tftp_write(
@@ -949,8 +1009,7 @@
      * Bail out if an error has occurred
      */
     if (!tp->writing)
-        return EIO;
-
+        rtems_set_errno_and_return_minus_one (EIO);
 
     /*
      * Write till user request is satisfied
@@ -997,8 +1056,10 @@
      rtems_filesystem_location_info_t        *pathloc                 /* IN */
 )
 {
+    tftpfs_info_t *fs = tftpfs_info_pathloc (pathloc);
     if ((pathloc->node_access == NULL)
-     || (pathloc->node_access == ROOT_NODE_ACCESS))
+     || (pathloc->node_access_2 != NULL)
+        || (pathloc->node_access == ROOT_NODE_ACCESS (fs)))
         return RTEMS_FILESYSTEM_MEMORY_FILE;
     return RTEMS_FILESYSTEM_DIRECTORY;
 }
@@ -1007,10 +1068,16 @@
      rtems_filesystem_location_info_t        *pathloc                 /* IN */
 )
 {
-    if (pathloc->node_access && (pathloc->node_access != ROOT_NODE_ACCESS)) {
+    tftpfs_info_t *fs = tftpfs_info_pathloc (pathloc);
+    if (pathloc->node_access && \
+        (pathloc->node_access != ROOT_NODE_ACCESS (fs))) {
         free (pathloc->node_access);
         pathloc->node_access = NULL;
     }
+    if (pathloc->node_access_2) {
+        free (pathloc->node_access_2);
+        pathloc->node_access_2 = NULL;
+    }
     return 0;
 }
 
@@ -1025,9 +1092,9 @@
     NULL,                            /* chown */
     rtems_tftp_free_node_info,       /* freenodinfo */
     NULL,                            /* mount */
-    rtems_tftp_mount_me,             /* initialize */
+    rtems_tftpfs_initialize,         /* initialize */
     NULL,                            /* unmount */
-    NULL,                            /* fsunmount */
+    rtems_tftpfs_shutdown,           /* fsunmount */
     NULL,                            /* utime, */
     NULL,                            /* evaluate_link */
     NULL,                            /* symlink */
@@ -1035,18 +1102,18 @@
 };
 
 rtems_filesystem_file_handlers_r rtems_tftp_handlers = {
-    rtems_tftp_open,   /* open */
-    rtems_tftp_close,  /* close */
-    rtems_tftp_read,   /* read */
-    rtems_tftp_write,  /* write */
-    NULL,              /* ioctl */
-    NULL,              /* lseek */
-    NULL,              /* fstat */
-    NULL,              /* fchmod */
+    rtems_tftp_open,      /* open */
+    rtems_tftp_close,     /* close */
+    rtems_tftp_read,      /* read */
+    rtems_tftp_write,     /* write */
+    NULL,                 /* ioctl */
+    NULL,                 /* lseek */
+    NULL,                 /* fstat */
+    NULL,                 /* fchmod */
     rtems_tftp_ftruncate, /* ftruncate */
-    NULL,              /* fpathconf */
-    NULL,              /* fsync */
-    NULL,              /* fdatasync */
-    NULL,              /* fcntl */
-    NULL               /* rmnod */
+    NULL,                 /* fpathconf */
+    NULL,                 /* fsync */
+    NULL,                 /* fdatasync */
+    NULL,                 /* fcntl */
+    NULL                  /* rmnod */
 };

diff -u rtems/cpukit/libnetworking/rtems/ftpfs.h:1.9 rtems/cpukit/libnetworking/rtems/ftpfs.h:1.10
--- rtems/cpukit/libnetworking/rtems/ftpfs.h:1.9	Thu May  7 09:40:55 2009
+++ rtems/cpukit/libnetworking/rtems/ftpfs.h	Mon May 31 08:56:37 2010
@@ -99,16 +99,6 @@
 extern const rtems_filesystem_operations_table rtems_ftpfs_ops;
 
 /**
- * Creates the mount point @a mount_point and mounts the FTP file system.
- *
- * If @a mount_point is @c NULL the default mount point
- * @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT will be used.
- *
- * It is mounted with read and write access.
- */
-rtems_status_code rtems_ftpfs_mount( const char *mount_point);
-
-/**
  * Returns in @a verbose if the verbose mode is enabled or disabled for the
  * file system at @a mount_point.
  *
@@ -160,15 +150,12 @@
 
 /**
  * Creates the default mount point @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT and
- * mounts the FTP file system.
+ * mounts the FTP file system. Do not call directly, use mount.xs
  *
  * It is mounted with read and write access.
- *
- * On success, zero is returned.  On error, -1 is returned.
- *
- * @deprecated Use rtems_ftpfs_mount() instead.
  */
-int rtems_bsdnet_initialize_ftp_filesystem( void);
+int rtems_ftpfs_initialize(rtems_filesystem_mount_table_entry_t *e,
+                           const void                           *d);
 
 #ifdef __cplusplus
 }

diff -u rtems/cpukit/libnetworking/rtems/tftp.h:1.6 rtems/cpukit/libnetworking/rtems/tftp.h:1.7
--- rtems/cpukit/libnetworking/rtems/tftp.h:1.6	Sun Dec 16 18:12:01 2007
+++ rtems/cpukit/libnetworking/rtems/tftp.h	Mon May 31 08:56:37 2010
@@ -20,7 +20,8 @@
  * To open `/bootfiles/image' on `hostname' for reading:
  *         fd = open ("/TFTP/hostname/bootfiles/image", O_RDONLY);
  *
- * The `hostname' must be four dot-separated decimal values.
+ * The 'TFTP' is the mount path and the `hostname' must be four dot-separated
+ * decimal values.
  */
 
 #ifndef _RTEMS_TFTP_H
@@ -33,6 +34,11 @@
 #include <rtems/libio.h>
 
 /*
+ * Filesystem Mount table entry.
+ */
+int rtems_tftpfs_initialize(rtems_filesystem_mount_table_entry_t *temp_mt_entry);
+
+/*
  * Filesystem initialization routine
  */
 

diff -u rtems/cpukit/sapi/include/confdefs.h:1.132 rtems/cpukit/sapi/include/confdefs.h:1.133
--- rtems/cpukit/sapi/include/confdefs.h:1.132	Mon May  3 04:13:36 2010
+++ rtems/cpukit/sapi/include/confdefs.h	Mon May 31 08:56:37 2010
@@ -174,13 +174,192 @@
   extern int rtems_telnetd_maximum_ptys;
 #endif
 
+/*
+ *  Filesystems and Mount Table Configuration.
+ *
+ *  Defines to control the file system:
+ *
+ *   CONFIGURE_APPLICATION_DISABLE_FILESYSTEM:
+ *     Disable the RTEMS filesystems. You get an empty DEVFS.
+ *
+ *   CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM:
+ *     Use the DEVFS as the root file system. Limited functions are
+ *     provided when this is used.
+ *
+ *   CONFIGURE_FILESYSTEM_ALL:
+ *     Add file filesystems to the default filesystem table.
+ *
+ *   List of available file systems. You can define as many as you like:
+ *     CONFIGURE_FILESYSTEM_miniIMFS - MiniIMFS, use DEVFS now
+ *     CONFIGURE_FILESYSTEM_IMFS     - In Memory File System (IMFS)
+ *     CONFIGURE_FILESYSTEM_DEVFS    - Device File System (DSVFS)
+ *     CONFIGURE_FILESYSTEM_TFTPFS   - TFTP File System, networking enabled
+ *     CONFIGURE_FILESYSTEM_FTPFS    - FTP File System, networking enabled
+ *     CONFIGURE_FILESYSTEM_NFSFS    - Network File System, networking enabled
+ *     CONFIGURE_FILESYSTEM_DOSFS    - DOS File System, uses libblock
+ *     CONFIGURE_FILESYSTEM_RFS      - RTEMS File System (RFS), uses libblock
+ *
+ *   Combinations:
+ *
+ *    - If nothing is defined the base file system is the IMFS.
+ *
+ *    - If CONFIGURE_APPLICATION_DISABLE_FILESYSTEM is defined all filesystem
+ *      are disabled by force and an empty DEVFS is created.
+ *
+ *    - If CONFIGURE_USE_DEV_AS_BASE_FILESYSTEM is defined all filesystem
+ *      are disabled by force and DEVFS is defined.
+ */
+
 #ifdef CONFIGURE_INIT
-  #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
-    #if defined(RTEMS_COVERAGE)
-      uint32_t rtems_device_table_size = 0;
-    #endif
+
+  /*
+   * Include all file systems. Do this before checking if the filesystem has
+   * been disabled.
+   */
+  #ifdef CONFIGURE_FILESYSTEM_ALL
+    #define CONFIGURE_FILESYSTEM_miniIMFS
+    #define CONFIGURE_FILESYSTEM_IMFS
+    #define CONFIGURE_FILESYSTEM_DEVFS
+    #define CONFIGURE_FILESYSTEM_TFTPFS
+    #define CONFIGURE_FILESYSTEM_FTPFS
+    #define CONFIGURE_FILESYSTEM_NFSFS
+    #define CONFIGURE_FILESYSTEM_DOSFS
+    #define CONFIGURE_FILESYSTEM_RFS
+  #endif
+
+  /*
+   * If disabling the file system undef everything. If DEVFS as the base
+   * filesystem undefine all other filesystems because you cannot mount other
+   * filesystems.
+   */
+  #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) || \
+      defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
+    #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM)
+      #undef CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
+    #endif
+    #undef CONFIGURE_FILESYSTEM_miniIMFS
+    #undef CONFIGURE_FILESYSTEM_IMFS
+    #undef CONFIGURE_FILESYSTEM_DEVFS
+    #undef CONFIGURE_FILESYSTEM_TFTPFS
+    #undef CONFIGURE_FILESYSTEM_FTPFS
+    #undef CONFIGURE_FILESYSTEM_NFSFS
+    #undef CONFIGURE_FILESYSTEM_DOSFS
+    #undef CONFIGURE_FILESYSTEM_RFS
+  #endif
+
+  /*
+   * If the base filesystem is DEVFS define it else define IMFS.
+   * We will have either DEVFS or IMFS defined after this.
+   */
+  #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) && \
+      !defined(CONFIGURE_FILESYSTEM_DEVFS)
+    #define CONFIGURE_FILESYSTEM_DEVFS
+  #elif !defined(CONFIGURE_FILESYSTEM_IMFS)
+    #define CONFIGURE_FILESYSTEM_IMFS
+  #endif
+
+#endif
+
+/**
+ * IMFS
+ */
+#include <rtems/imfs.h>
+
+/**
+ *  This specifies the number of bytes per block for files within the IMFS.
+ *  There are a maximum number of blocks per file so this dictates the maximum
+ *  size of a file.  This has to be balanced with the unused portion of each
+ *  block that might be wasted.
+ */
+#ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK
+  #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \
+                    IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK
+#endif
+
+#ifdef CONFIGURE_INIT
+  int imfs_rq_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK;
+#endif /* CONFIGURE_INIT */
+
+/**
+ *  This defines the miniIMFS file system table entry.
+ */ 
+#if !defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS) && \
+    defined(CONFIGURE_FILESYSTEM_miniIMFS)
+#define CONFIGURE_FILESYSTEM_ENTRY_miniIMFS { "mimfs", miniIMFS_initialize }
+#endif
+
+/**
+ *  This defines the IMFS file system table entry.
+ */ 
+#if !defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS) && \
+    defined(CONFIGURE_FILESYSTEM_IMFS)
+#define CONFIGURE_FILESYSTEM_ENTRY_IMFS { "imfs", IMFS_initialize }
+#endif
+
+/**
+ * DEVFS
+ */ 
+#if !defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS) && \
+    defined(CONFIGURE_FILESYSTEM_DEVFS)
+#include <rtems/devfs.h>
+#define CONFIGURE_FILESYSTEM_ENTRY_DEVFS { "devfs", devFS_initialize }
+#endif
+
+#ifdef RTEMS_NETWORKING
+  /**
+   * FTPFS
+   */ 
+  #if !defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS) && \
+      defined(CONFIGURE_FILESYSTEM_FTPFS) 
+    #include <rtems/ftpfs.h>
+    #define CONFIGURE_FILESYSTEM_ENTRY_FTPFS { "ftpfs", rtems_ftpfs_initialize }
+  #endif
+
+  /**
+   * TFTPFS
+   */ 
+  #if !defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS) && \
+      defined(CONFIGURE_FILESYSTEM_TFTPFS)
+    #include <rtems/tftp.h>
+    #define CONFIGURE_FILESYSTEM_ENTRY_TFTPFS { "tftpfs", rtems_tftpfs_initialize }
+  #endif
+
+  /**
+   * NFSFS
+   */ 
+  #if !defined(CONFIGURE_FILESYSTEM_ENTRY_NFSFS) && \
+      defined(CONFIGURE_FILESYSTEM_NFSFS)
+    #include <librtemsNfs.h>
+    #define CONFIGURE_FILESYSTEM_ENTRY_NFSFS { "nfs", rtems_nfsfs_initialize }
+  #endif
+#endif
+
+/**
+ * DOSFS
+ */ 
+#if !defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS) && \
+    defined(CONFIGURE_FILESYSTEM_DOSFS)
+  #include <rtems/dosfs.h>
+  #define CONFIGURE_FILESYSTEM_ENTRY_DOSFS { "dosfs", rtems_dosfs_initialize }
+#endif
+
+/**
+ * RFS
+ */ 
+#if !defined(CONFIGURE_FILESYSTEM_ENTRY_RFS) && \
+    defined(CONFIGURE_FILESYSTEM_RFS)
+  #include <rtems/rtems-rfs.h>
+  #define CONFIGURE_FILESYSTEM_ENTRY_RFS { "rfs", rtems_rfs_rtems_initialise }
+#endif
+
+#ifdef CONFIGURE_INIT
+
+  /*
+   *  DEVFS variables.
+   */
+  #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) && !defined(RTEMS_COVERAGE)
     #define CONFIGURE_MEMORY_FOR_DEVFS  0
-  #elif defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
+  #elif defined(CONFIGURE_FILESYSTEM_DEVFS)
     #ifndef CONFIGURE_MAXIMUM_DEVICES
       #define CONFIGURE_MAXIMUM_DEVICES 4
     #endif
@@ -195,28 +374,54 @@
   #else
     #define CONFIGURE_MEMORY_FOR_DEVFS  0
   #endif
-#endif
 
-/*
- *  Mount Table Configuration
- */
-#include <rtems/imfs.h>
+  /**
+   * Table termination record.
+   */
+  #define CONFIGURE_FILESYSTEM_NULL { NULL, NULL }
 
-/**
- *  This specifies the number of bytes per block for files within
- *  the IMFS.  There are a maximum number of blocks per file so
- *  this dictates the maximum size of a file.  This has to be balanced
- *  with the unused portion of each block that might be wasted.
- */
-#ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK
-  #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \
-                    IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK
-#endif
-#ifdef CONFIGURE_INIT
-  int imfs_rq_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK;
-#endif /* CONFIGURE_INIT */
+  /**
+   * The default file system table. Must be terminated with the NULL entry if
+   * you provide your own.
+   */
+  #ifndef CONFIGURE_HAS_OWN_FILESYSTEM_TABLE
+    const rtems_filesystem_table_t configuration_filesystem_table[] = {
+      #if defined(CONFIGURE_FILESYSTEM_miniIMFS) && \
+          defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS)
+        CONFIGURE_FILESYSTEM_ENTRY_miniIMFS,
+      #endif
+      #if defined(CONFIGURE_FILESYSTEM_IMFS) && \
+          defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS)
+        CONFIGURE_FILESYSTEM_ENTRY_IMFS,
+      #endif
+      #if defined(CONFIGURE_FILESYSTEM_DEVFS) && \
+          defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS)
+        CONFIGURE_FILESYSTEM_ENTRY_DEVFS,
+      #endif
+      #if defined(CONFIGURE_FILESYSTEM_TFTPFS) && \
+          defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS)
+        CONFIGURE_FILESYSTEM_ENTRY_TFTPFS,
+      #endif
+      #if defined(CONFIGURE_FILESYSTEM_FTPFS) && \
+          defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS)
+        CONFIGURE_FILESYSTEM_ENTRY_FTPFS,
+      #endif
+      #if defined(CONFIGURE_FILESYSTEM_NFSFS) && \
+          defined(CONFIGURE_FILESYSTEM_ENTRY_NFSFS)
+        CONFIGURE_FILESYSTEM_ENTRY_NFSFS,
+      #endif
+      #if defined(CONFIGURE_FILESYSTEM_DOSFS) && \
+          defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS)
+        CONFIGURE_FILESYSTEM_ENTRY_DOSFS,
+      #endif
+      #if defined(CONFIGURE_FILESYSTEM_RFS) && \
+          defined(CONFIGURE_FILESYSTEM_ENTRY_RFS)
+        CONFIGURE_FILESYSTEM_ENTRY_RFS,
+      #endif
+      CONFIGURE_FILESYSTEM_NULL
+    };
+  #endif
 
-#ifdef CONFIGURE_INIT
   /**
    *  This disables the inclusion of pipe support in the full IMFS.
    *
@@ -234,11 +439,11 @@
   #ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE
     const rtems_filesystem_mount_table_t configuration_mount_table = {
       #ifdef CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
-        &IMFS_ops,
+        "imfs",
       #elif defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
-        &devFS_ops,
+        "devfs",
       #else  /* using miniIMFS as base filesystem */
-        &miniIMFS_ops,
+        "mimfs",
       #endif
       RTEMS_FILESYSTEM_READ_WRITE,
       NULL,
@@ -249,6 +454,7 @@
         *rtems_filesystem_mount_table = &configuration_mount_table;
     const int rtems_filesystem_mount_table_size = 1;
   #endif
+
 #endif
 
 /*


 *joel*:
2010-05-31	Joel Sherrill <joel.sherrilL at OARcorp.com>

	* start/start.S: Pass 0/NULL for argc/argv.

M    1.9  c/src/lib/libbsp/m32r/m32rsim/ChangeLog
M    1.4  c/src/lib/libbsp/m32r/m32rsim/start/start.S

diff -u rtems/c/src/lib/libbsp/m32r/m32rsim/ChangeLog:1.8 rtems/c/src/lib/libbsp/m32r/m32rsim/ChangeLog:1.9
--- rtems/c/src/lib/libbsp/m32r/m32rsim/ChangeLog:1.8	Wed Oct 21 05:46:51 2009
+++ rtems/c/src/lib/libbsp/m32r/m32rsim/ChangeLog	Mon May 31 08:52:07 2010
@@ -1,3 +1,7 @@
+2010-05-31	Joel Sherrill <joel.sherrilL at OARcorp.com>
+
+	* start/start.S: Pass 0/NULL for argc/argv.
+
 2009-10-21	Ralf Corsépius <ralf.corsepius at rtems.org>
 
 	* make/custom/m32rsim.cfg: Remove RTEMS_BSP_FAMILY.

diff -u rtems/c/src/lib/libbsp/m32r/m32rsim/start/start.S:1.3 rtems/c/src/lib/libbsp/m32r/m32rsim/start/start.S:1.4
--- rtems/c/src/lib/libbsp/m32r/m32rsim/start/start.S:1.3	Sun Nov 29 22:56:52 2009
+++ rtems/c/src/lib/libbsp/m32r/m32rsim/start/start.S	Mon May 31 08:52:07 2010
@@ -4,11 +4,6 @@
  *  $Id$
  */
 
-#warning Call to boot_card has changed and needs checking.
-#warning The call is "void boot_card(const char* cmdline);"
-#warning You need to pass a NULL.
-#warning Please check and remove these warnings.
-
 	.text
 	.balign 4
 	.global	_start
@@ -54,6 +49,8 @@
 
 # Call main, then exit.
 
+	ldi	r1, #0           ; r1 = argv
+	ldi	r0, #0           ; r0 = argc
 	bl	boot_card
 	bl	sys_exit
 


 *ralf*:
2010-05-31	Ralf Corsépius <ralf.corsepius at rtems.org>

	* libchip/network/greth.c: Misc. hacks to allow compilation on
	16bit targets.

M  1.518  c/src/ChangeLog
M   1.10  c/src/libchip/network/greth.c

diff -u rtems/c/src/ChangeLog:1.517 rtems/c/src/ChangeLog:1.518
--- rtems/c/src/ChangeLog:1.517	Mon May 31 07:22:38 2010
+++ rtems/c/src/ChangeLog	Mon May 31 08:27:07 2010
@@ -1,5 +1,10 @@
 2010-05-31	Ralf Corsépius <ralf.corsepius at rtems.org>
 
+	* libchip/network/greth.c: Misc. hacks to allow compilation on 
+	16bit targets.
+
+2010-05-31	Ralf Corsépius <ralf.corsepius at rtems.org>
+
 	PR 1531/newlib
 	* libchip/network/i82586.c:
 	Add local copy of ALIGN().

diff -u rtems/c/src/libchip/network/greth.c:1.9 rtems/c/src/libchip/network/greth.c:1.10
--- rtems/c/src/libchip/network/greth.c:1.9	Thu Dec 17 14:35:40 2009
+++ rtems/c/src/libchip/network/greth.c	Mon May 31 08:27:07 2010
@@ -169,7 +169,7 @@
 {
         char *tmp;
         tmp = calloc(1,2*sz);
-        tmp = (char *) (((int)tmp+sz) & ~(sz -1));
+        tmp = (char *) (((uintptr_t)tmp+sz) & ~(sz -1));
         return(tmp);
 }
 
@@ -416,8 +416,8 @@
     sc->tx_dptr = 0;
     sc->tx_cnt = 0;
     sc->rx_ptr = 0;
-    regs->txdesc = (int) sc->txdesc;
-    regs->rxdesc = (int) sc->rxdesc;
+    regs->txdesc = (uintptr_t) sc->txdesc;
+    regs->rxdesc = (uintptr_t) sc->rxdesc;
 
     sc->rxmbuf = calloc(sc->rxbufs, sizeof(*sc->rxmbuf));
     sc->txmbuf = calloc(sc->txbufs, sizeof(*sc->txmbuf));
@@ -452,9 +452,16 @@
     /* set ethernet address.  */
     regs->mac_addr_msb =
       sc->arpcom.ac_enaddr[0] << 8 | sc->arpcom.ac_enaddr[1];
-    regs->mac_addr_lsb =
-      sc->arpcom.ac_enaddr[2] << 24 | sc->arpcom.ac_enaddr[3] << 16 |
-      sc->arpcom.ac_enaddr[4] << 8 | sc->arpcom.ac_enaddr[5];
+
+    uint32_t mac_addr_lsb;
+    mac_addr_lsb = sc->arpcom.ac_enaddr[2];
+    mac_addr_lsb <<= 8;
+    mac_addr_lsb |= sc->arpcom.ac_enaddr[3];
+    mac_addr_lsb <<= 8;
+    mac_addr_lsb |= sc->arpcom.ac_enaddr[4];
+    mac_addr_lsb <<= 8;
+    mac_addr_lsb |= sc->arpcom.ac_enaddr[5];
+    regs->mac_addr_lsb = mac_addr_lsb;
 
     /* install interrupt vector */
     set_vector(greth_interrupt_handler, sc->vector, 1);



--

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/20100531/48ddaaee/attachment-0001.html>


More information about the vc mailing list