diff options
author | Chris Johns <chrisj@rtems.org> | 2010-05-31 13:56:37 +0000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2010-05-31 13:56:37 +0000 |
commit | 29e92b090c8bc35745aa5c89231ce806bcb11e57 (patch) | |
tree | a253c33b1654609acfbd5216797976dce3b0748f /cpukit/sapi | |
parent | 2010-05-31 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff) | |
download | rtems-29e92b090c8bc35745aa5c89231ce806bcb11e57.tar.bz2 |
2010-05-31 Chris Johns <chrisj@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.
Diffstat (limited to 'cpukit/sapi')
-rw-r--r-- | cpukit/sapi/include/confdefs.h | 258 |
1 files changed, 232 insertions, 26 deletions
diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index 50944b0f49..a65ec590f7 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -174,13 +174,192 @@ rtems_fs_init_functions_t rtems_fs_init_helper = 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; + + /* + * 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 @@ rtems_fs_init_functions_t rtems_fs_init_helper = #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 @@ rtems_fs_init_functions_t rtems_fs_init_helper = #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_fs_init_functions_t rtems_fs_init_helper = *rtems_filesystem_mount_table = &configuration_mount_table; const int rtems_filesystem_mount_table_size = 1; #endif + #endif /* |