summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/imfs
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libfs/src/imfs')
-rw-r--r--cpukit/libfs/src/imfs/deviceio.c12
-rw-r--r--cpukit/libfs/src/imfs/imfs.h243
-rw-r--r--cpukit/libfs/src/imfs/imfs_chown.c12
-rw-r--r--cpukit/libfs/src/imfs/imfs_config.c7
-rw-r--r--cpukit/libfs/src/imfs/imfs_creat.c14
-rw-r--r--cpukit/libfs/src/imfs/imfs_debug.c26
-rw-r--r--cpukit/libfs/src/imfs/imfs_directory.c24
-rw-r--r--cpukit/libfs/src/imfs/imfs_eval.c9
-rw-r--r--cpukit/libfs/src/imfs/imfs_fchmod.c9
-rw-r--r--cpukit/libfs/src/imfs/imfs_fifo.c9
-rw-r--r--cpukit/libfs/src/imfs/imfs_fsunmount.c13
-rw-r--r--cpukit/libfs/src/imfs/imfs_handlers_device.c9
-rw-r--r--cpukit/libfs/src/imfs/imfs_handlers_directory.c9
-rw-r--r--cpukit/libfs/src/imfs/imfs_handlers_link.c9
-rw-r--r--cpukit/libfs/src/imfs/imfs_handlers_memfile.c9
-rw-r--r--cpukit/libfs/src/imfs/imfs_initsupp.c9
-rw-r--r--cpukit/libfs/src/imfs/imfs_link.c13
-rw-r--r--cpukit/libfs/src/imfs/imfs_load_tar.c57
-rw-r--r--cpukit/libfs/src/imfs/imfs_make_generic_node.c7
-rw-r--r--cpukit/libfs/src/imfs/imfs_mknod.c11
-rw-r--r--cpukit/libfs/src/imfs/imfs_mount.c9
-rw-r--r--cpukit/libfs/src/imfs/imfs_ntype.c12
-rw-r--r--cpukit/libfs/src/imfs/imfs_readlink.c12
-rw-r--r--cpukit/libfs/src/imfs/imfs_rename.c12
-rw-r--r--cpukit/libfs/src/imfs/imfs_rmnod.c12
-rw-r--r--cpukit/libfs/src/imfs/imfs_stat.c11
-rw-r--r--cpukit/libfs/src/imfs/imfs_symlink.c13
-rw-r--r--cpukit/libfs/src/imfs/imfs_unmount.c9
-rw-r--r--cpukit/libfs/src/imfs/imfs_utime.c12
-rw-r--r--cpukit/libfs/src/imfs/ioman.c16
-rw-r--r--cpukit/libfs/src/imfs/memfile.c36
31 files changed, 448 insertions, 217 deletions
diff --git a/cpukit/libfs/src/imfs/deviceio.c b/cpukit/libfs/src/imfs/deviceio.c
index 679f94559c..094e92d2ef 100644
--- a/cpukit/libfs/src/imfs/deviceio.c
+++ b/cpukit/libfs/src/imfs/deviceio.c
@@ -1,9 +1,11 @@
-/*
- * IMFS Device Node Handlers
- *
- * This file contains the set of handlers used to map operations on
- * IMFS device nodes onto calls to the RTEMS Classic API IO Manager.
+/**
+ * @file
*
+ * @brief IMFS Device Node Handlers
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-2012.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs.h b/cpukit/libfs/src/imfs/imfs.h
index aed00778e7..646e988ca2 100644
--- a/cpukit/libfs/src/imfs/imfs.h
+++ b/cpukit/libfs/src/imfs/imfs.h
@@ -1,7 +1,7 @@
/**
* @file rtems/imfs.h
*
- * Header file for the In-Memory File System
+ * @brief Header file for the In-Memory File System
*/
/*
@@ -21,6 +21,12 @@
#include <rtems/libio_.h>
#include <rtems/pipe.h>
+/**
+ * @defgroup IMFS POSIX In-Memory File System Support
+ *
+ * @brief In-Memory File System Support
+ */
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -158,6 +164,9 @@ typedef IMFS_jnode_t *(*IMFS_node_control_initialize)(
const IMFS_types_union *info
);
+/**
+ * @brief Initialize Default IMFS Node
+ */
IMFS_jnode_t *IMFS_node_initialize_default(
IMFS_jnode_t *node,
const IMFS_types_union *info
@@ -172,12 +181,18 @@ typedef IMFS_jnode_t *(*IMFS_node_control_remove)(
IMFS_jnode_t *node
);
+/**
+ * @brief Remove Default IMFS Node
+ */
IMFS_jnode_t *IMFS_node_remove_default(
IMFS_jnode_t *node
);
typedef IMFS_jnode_t *(*IMFS_node_control_destroy)( IMFS_jnode_t *node );
+/**
+ * @brief Destroy Default IMFS Node
+ */
IMFS_jnode_t *IMFS_node_destroy_default( IMFS_jnode_t *node );
typedef struct {
@@ -298,49 +313,141 @@ extern int miniIMFS_initialize(
const void *data
);
+/**
+ * @brief IMFS Initialization Support
+ */
extern int IMFS_initialize_support(
rtems_filesystem_mount_table_entry_t *mt_entry,
const rtems_filesystem_operations_table *op_table,
const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT]
);
-
+/**
+ * @brief Unmount this Instance of IMFS
+ */
extern void IMFS_fsunmount(
rtems_filesystem_mount_table_entry_t *mt_entry
);
+/**
+ * @brief RTEMS Load Tarfs
+ *
+ * This file implements the "mount" procedure for tar-based IMFS
+ * extensions. The TAR is not actually mounted under the IMFS.
+ * Directories from the TAR file are created as usual in the IMFS.
+ * File entries are created as IMFS_LINEAR_FILE nodes with their nods
+ * pointing to addresses in the TAR image.
+ *
+ * Here we create the mountpoint directory and load the tarfs at
+ * that node. Once the IMFS has been mounted, we work through the
+ * tar image and perform as follows:
+ * - For directories, simply call mkdir(). The IMFS creates nodes as
+ * needed.
+ * - For files, we make our own calls to IMFS eval_for_make and
+ * create_node.
+ *
+ * TAR file format:
+ *
+ * Offset Length Contents
+ * 0 100 bytes File name ('\0' terminated, 99 maxmum length)
+ * 100 8 bytes File mode (in octal ascii)
+ * 108 8 bytes User ID (in octal ascii)
+ * 116 8 bytes Group ID (in octal ascii)
+ * 124 12 bytes File size (s) (in octal ascii)
+ * 136 12 bytes Modify time (in octal ascii)
+ * 148 8 bytes Header checksum (in octal ascii)
+ * 156 1 bytes Link flag
+ * 157 100 bytes Linkname ('\0' terminated, 99 maxmum length)
+ * 257 8 bytes Magic PAX ("ustar\0" + 2 bytes padding)
+ * 257 8 bytes Magic GNU tar ("ustar \0")
+ * 265 32 bytes User name ('\0' terminated, 31 maxmum length)
+ * 297 32 bytes Group name ('\0' terminated, 31 maxmum length)
+ * 329 8 bytes Major device ID (in octal ascii)
+ * 337 8 bytes Minor device ID (in octal ascii)
+ * 345 167 bytes Padding
+ * 512 (s+p)bytes File contents (s+p) := (((s) + 511) & ~511),
+ * round up to 512 bytes
+ *
+ * Checksum:
+ * int i, sum;
+ * char* header = tar_header_pointer;
+ * sum = 0;
+ * for(i = 0; i < 512; i++)
+ * sum += 0xFF & header[i];
+ */
extern int rtems_tarfs_load(
const char *mountpoint,
uint8_t *tar_image,
size_t tar_size
);
+/**
+ * @brief IMFS Dump
+ *
+ * This routine dumps the entire IMFS that is mounted at the root
+ * directory.
+ *
+ * NOTE: Assuming the "/" directory is bad.
+ * Not checking that the starting directory is in an IMFS is bad.
+ */
extern void IMFS_dump( void );
-/*
+/**
+ * @brief IMFS Memory File Maximum Size
+ *
* Return the size of the largest file which can be created
* using the IMFS memory file type.
*/
extern int IMFS_memfile_maximum_size( void );
+/**
+ * @brief Destroy IMFS Node
+ */
extern void IMFS_node_destroy( IMFS_jnode_t *node );
+/**
+ * @brief Clone IMFS Node
+ */
extern int IMFS_node_clone( rtems_filesystem_location_info_t *loc );
+/**
+ * @brief Free IMFS Node
+ */
extern void IMFS_node_free( const rtems_filesystem_location_info_t *loc );
+/**
+ * @brief IMFS Node Type
+ *
+ * The following verifies that returns the type of node that the
+ * loc refers to.
+ */
extern rtems_filesystem_node_types_t IMFS_node_type(
const rtems_filesystem_location_info_t *loc
);
+/**
+ * @brief IMFS Stat
+ *
+ * This routine provides a stat for the IMFS file system.
+ */
extern int IMFS_stat(
const rtems_filesystem_location_info_t *loc,
struct stat *buf
);
+/**
+ * @brief Evaluation IMFS Node Support
+ */
extern void IMFS_eval_path(
rtems_filesystem_eval_path_context_t *ctx
);
+/**
+ * @brief IMFS Create a New Link Node
+ *
+ * The following rouine creates a new link node under parent with the
+ * name given in name. The link node is set to point to the node at
+ * to_loc.
+ */
extern int IMFS_link(
const rtems_filesystem_location_info_t *parentloc,
const rtems_filesystem_location_info_t *targetloc,
@@ -348,12 +455,23 @@ extern int IMFS_link(
size_t namelen
);
+/**
+ * @brief IMFS Change Owner
+ *
+ * This routine is the implementation of the chown() system
+ * call for the IMFS.
+ */
extern int IMFS_chown(
const rtems_filesystem_location_info_t *loc,
uid_t owner,
gid_t group
);
+/**
+ * @brief Create a IMFS Node
+ *
+ * Routine to create a node in the IMFS file system.
+ */
extern int IMFS_mknod(
const rtems_filesystem_location_info_t *parentloc,
const char *name,
@@ -362,6 +480,11 @@ extern int IMFS_mknod(
dev_t dev
);
+/**
+ * @brief Create a New IMFS Node
+ *
+ * Routine to create a new in memory file system node.
+ */
extern IMFS_jnode_t *IMFS_allocate_node(
IMFS_fs_info_t *fs_info,
const IMFS_node_control *node_control,
@@ -371,6 +494,12 @@ extern IMFS_jnode_t *IMFS_allocate_node(
const IMFS_types_union *info
);
+/**
+ * @brief Create an IMFS Node
+ *
+ * Create an IMFS filesystem node of an arbitrary type that is NOT
+ * the root directory node.
+ */
extern IMFS_jnode_t *IMFS_create_node_with_control(
const rtems_filesystem_location_info_t *parentloc,
const IMFS_node_control *node_control,
@@ -384,6 +513,9 @@ extern bool IMFS_is_imfs_instance(
const rtems_filesystem_location_info_t *loc
);
+/**
+ * @brief IMFS Make a Generic Node
+ */
extern int IMFS_make_generic_node(
const char *path,
mode_t mode,
@@ -391,10 +523,16 @@ extern int IMFS_make_generic_node(
void *context
);
+/**
+ * @brief Mount an IMFS
+ */
extern int IMFS_mount(
rtems_filesystem_mount_table_entry_t *mt_entry /* IN */
);
+/**
+ * @brief Unmount an IMFS
+ */
extern int IMFS_unmount(
rtems_filesystem_mount_table_entry_t *mt_entry /* IN */
);
@@ -403,17 +541,54 @@ extern IMFS_jnode_t *IMFS_memfile_remove(
IMFS_jnode_t *the_jnode /* IN/OUT */
);
+/**
+ * @brief Truncate a Memory File
+ *
+ * This routine processes the ftruncate() system call.
+ */
extern int memfile_ftruncate(
rtems_libio_t *iop, /* IN */
off_t length /* IN */
);
+/**
+ * @brief IMFS Read Next Directory
+ *
+ * This routine will read the next directory entry based on the directory
+ * offset. The offset should be equal to -n- time the size of an individual
+ * dirent structure. If n is not an integer multiple of the sizeof a
+ * dirent structure, an integer division will be performed to determine
+ * directory entry that will be returned in the buffer. Count should reflect
+ * -m- times the sizeof dirent bytes to be placed in the buffer.
+ * If there are not -m- dirent elements from the current directory position
+ * to the end of the exisiting file, the remaining entries will be placed in
+ * the buffer and the returned value will be equal to -m actual- times the
+ * size of a directory entry.
+ */
extern ssize_t imfs_dir_read(
rtems_libio_t *iop, /* IN */
void *buffer, /* IN */
size_t count /* IN */
);
+/**
+ * @name IMFS Memory File Handlers
+ *
+ * This section contains the set of handlers used to process operations on
+ * IMFS memory file nodes. The memory files are created in memory using
+ * malloc'ed memory. Thus any data stored in one of these files is lost
+ * at system shutdown unless special arrangements to copy the data to
+ * some type of non-volailte storage are made by the application.
+ *
+ * @{
+ */
+
+/**
+ * @brief Open a Memory File
+ *
+ * This routine processes the open() system call. Note that there is
+ * nothing special to be done at open() time.
+ */
extern int memfile_open(
rtems_libio_t *iop, /* IN */
const char *pathname, /* IN */
@@ -421,18 +596,41 @@ extern int memfile_open(
mode_t mode /* IN */
);
+/**
+ * @brief Read a Memory File
+ *
+ * This routine processes the read() system call.
+ */
extern ssize_t memfile_read(
rtems_libio_t *iop, /* IN */
void *buffer, /* IN */
size_t count /* IN */
);
+/**
+ * @brief Write a Memory File
+ *
+ * This routine processes the write() system call.
+ */
extern ssize_t memfile_write(
rtems_libio_t *iop, /* IN */
const void *buffer, /* IN */
size_t count /* IN */
);
+/** @} */
+
+
+/**
+ * @name IMFS Device Node Handlers
+ *
+ * This section contains the set of handlers used to map operations on
+ * IMFS device nodes onto calls to the RTEMS Classic API IO Manager.
+ *
+ * @{
+ */
+
+
extern int device_open(
rtems_libio_t *iop, /* IN */
const char *pathname, /* IN */
@@ -467,17 +665,36 @@ extern int device_ftruncate(
off_t length /* IN */
);
+/** @} */
+
+/**
+ * @brief Set IMFS File Access and Modification Times
+ *
+ *
+ * This routine is the implementation of the utime() system
+ * call for the IMFS.
+ */
extern int IMFS_utime(
const rtems_filesystem_location_info_t *loc,
time_t actime,
time_t modtime
);
+/**
+ * @brief Change IMFS File Mode
+ */
extern int IMFS_fchmod(
const rtems_filesystem_location_info_t *loc,
mode_t mode
);
+/**
+ * @brief IMFS Create a New Symbolic Link Node
+ *
+ * The following rouine creates a new symbolic link node under parent
+ * with the name given in name. The node is set to point to the node at
+ * to_loc.
+ */
extern int IMFS_symlink(
const rtems_filesystem_location_info_t *parentloc,
const char *name,
@@ -485,12 +702,25 @@ extern int IMFS_symlink(
const char *target
);
+/**
+ * @brief IMFS Put Symbolic Link into Buffer
+ *
+ * The following rouine puts the symblic links destination name into
+ * buff.
+ *
+ */
extern ssize_t IMFS_readlink(
const rtems_filesystem_location_info_t *loc,
char *buf,
size_t bufsize
);
+/**
+ * @brief IMFS Rename
+ *
+ * The following rouine creates a new link node under parent with the
+ * name given in name and removes the old.
+ */
extern int IMFS_rename(
const rtems_filesystem_location_info_t *oldparentloc,
const rtems_filesystem_location_info_t *oldloc,
@@ -498,7 +728,12 @@ extern int IMFS_rename(
const char *name,
size_t namelen
);
-
+/**
+ * @brief IMFS Node Removal Handler
+ *
+ * This file contains the handler used to remove a node when a file type
+ * does not require special actions.
+ */
extern int IMFS_rmnod(
const rtems_filesystem_location_info_t *parentloc,
const rtems_filesystem_location_info_t *loc
diff --git a/cpukit/libfs/src/imfs/imfs_chown.c b/cpukit/libfs/src/imfs/imfs_chown.c
index 63f860c318..ccfc5a5ce0 100644
--- a/cpukit/libfs/src/imfs/imfs_chown.c
+++ b/cpukit/libfs/src/imfs/imfs_chown.c
@@ -1,9 +1,11 @@
-/*
- * IMFS_chown
- *
- * This routine is the implementation of the chown() system
- * call for the IMFS.
+/**
+ * @file
*
+ * @brief IMFS Change Owner
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_config.c b/cpukit/libfs/src/imfs/imfs_config.c
index 92e7846265..ddb02b77dc 100644
--- a/cpukit/libfs/src/imfs/imfs_config.c
+++ b/cpukit/libfs/src/imfs/imfs_config.c
@@ -1,3 +1,10 @@
+/**
+ * @file
+ *
+ * @brief IMFS Limits and Options
+ * @ingroup IMFS
+ */
+
/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
diff --git a/cpukit/libfs/src/imfs/imfs_creat.c b/cpukit/libfs/src/imfs/imfs_creat.c
index 3950dba70b..830480b83e 100644
--- a/cpukit/libfs/src/imfs/imfs_creat.c
+++ b/cpukit/libfs/src/imfs/imfs_creat.c
@@ -1,8 +1,10 @@
-/*
- * IMFS_create_node()
- *
- * Routine to create a new in memory file system node.
+/**
+ * @file
*
+ * @brief Create an IMFS Node
+ * @ingroup IMFS
+ */
+/*
* COPYRIGHT (c) 1989-2010.
* On-Line Applications Research Corporation (OAR).
*
@@ -83,10 +85,6 @@ IMFS_jnode_t *IMFS_allocate_node(
return (*node->control->node_initialize)( node, info );
}
-/*
- * Create an IMFS filesystem node of an arbitrary type that is NOT
- * the root directory node.
- */
IMFS_jnode_t *IMFS_create_node_with_control(
const rtems_filesystem_location_info_t *parentloc,
const IMFS_node_control *node_control,
diff --git a/cpukit/libfs/src/imfs/imfs_debug.c b/cpukit/libfs/src/imfs/imfs_debug.c
index 1bc280cdb2..1198ec9b82 100644
--- a/cpukit/libfs/src/imfs/imfs_debug.c
+++ b/cpukit/libfs/src/imfs/imfs_debug.c
@@ -1,6 +1,11 @@
-/*
- * IMFS debug support routines
+/**
+ * @file
*
+ * @brief IMFS Debug Support
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
@@ -119,16 +124,6 @@ static void IMFS_dump_directory(
}
}
-/*
- * IMFS_dump
- *
- * This routine dumps the entire IMFS that is mounted at the root
- * directory.
- *
- * NOTE: Assuming the "/" directory is bad.
- * Not checking that the starting directory is in an IMFS is bad.
- */
-
void IMFS_dump( void )
{
fprintf(stdout, "*************** Dump of Entire IMFS ***************\n" );
@@ -137,13 +132,6 @@ void IMFS_dump( void )
fprintf(stdout, "*************** End of Dump ***************\n" );
}
-/*
- * IMFS_memfile_maximum_size()
- *
- * This routine returns the size of the largest file which can be created
- * using the IMFS memory file type.
- *
- */
int IMFS_memfile_maximum_size( void )
{
return IMFS_MEMFILE_MAXIMUM_SIZE;
diff --git a/cpukit/libfs/src/imfs/imfs_directory.c b/cpukit/libfs/src/imfs/imfs_directory.c
index 99d990d24f..c344af4cd7 100644
--- a/cpukit/libfs/src/imfs/imfs_directory.c
+++ b/cpukit/libfs/src/imfs/imfs_directory.c
@@ -1,6 +1,11 @@
-/*
- * IMFS Directory Access Routines
+/**
+ * @file
*
+ * @brief IMFS Read Next Directory
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
@@ -18,21 +23,6 @@
#include <string.h>
#include <dirent.h>
-/*
- * imfs_dir_read
- *
- * This routine will read the next directory entry based on the directory
- * offset. The offset should be equal to -n- time the size of an individual
- * dirent structure. If n is not an integer multiple of the sizeof a
- * dirent structure, an integer division will be performed to determine
- * directory entry that will be returned in the buffer. Count should reflect
- * -m- times the sizeof dirent bytes to be placed in the buffer.
- * If there are not -m- dirent elements from the current directory position
- * to the end of the exisiting file, the remaining entries will be placed in
- * the buffer and the returned value will be equal to -m actual- times the
- * size of a directory entry.
- */
-
ssize_t imfs_dir_read(
rtems_libio_t *iop,
void *buffer,
diff --git a/cpukit/libfs/src/imfs/imfs_eval.c b/cpukit/libfs/src/imfs/imfs_eval.c
index 4fcfd67ee9..5abb2473b3 100644
--- a/cpukit/libfs/src/imfs/imfs_eval.c
+++ b/cpukit/libfs/src/imfs/imfs_eval.c
@@ -1,6 +1,11 @@
-/*
- * Evaluation IMFS Node Support Routines
+/**
+ * @file
*
+ * @brief Evaluation IMFS Node Support
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_fchmod.c b/cpukit/libfs/src/imfs/imfs_fchmod.c
index dfd6eaf3bc..ccb344629e 100644
--- a/cpukit/libfs/src/imfs/imfs_fchmod.c
+++ b/cpukit/libfs/src/imfs/imfs_fchmod.c
@@ -1,6 +1,11 @@
-/*
- * IMFS file change mode routine.
+/**
+ * @file
*
+ * @brief Change IMFS File Mode
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_fifo.c b/cpukit/libfs/src/imfs/imfs_fifo.c
index 8601ef7b62..03e69368eb 100644
--- a/cpukit/libfs/src/imfs/imfs_fifo.c
+++ b/cpukit/libfs/src/imfs/imfs_fifo.c
@@ -1,6 +1,11 @@
-/*
- * imfs_fifo.c: FIFO support for IMFS
+/**
+ * @file
*
+ * @brief FIFO Support
+ * @ingroup IMFS
+ */
+
+/*
* Author: Wei Shen <cquark@gmail.com>
*
* The license and distribution terms for this file may be
diff --git a/cpukit/libfs/src/imfs/imfs_fsunmount.c b/cpukit/libfs/src/imfs/imfs_fsunmount.c
index eb3d22d13e..ae6f39a385 100644
--- a/cpukit/libfs/src/imfs/imfs_fsunmount.c
+++ b/cpukit/libfs/src/imfs/imfs_fsunmount.c
@@ -1,6 +1,11 @@
-/*
- * IMFS Initialization
+/**
+ * @file
*
+ * @brief Unmount this Instance of IMFS
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
@@ -15,10 +20,6 @@
#include "imfs.h"
-/*
- * IMFS_fsunmount
- */
-
#define jnode_get_control( jnode ) \
(&jnode->info.directory.Entries)
diff --git a/cpukit/libfs/src/imfs/imfs_handlers_device.c b/cpukit/libfs/src/imfs/imfs_handlers_device.c
index a7f32f7906..899b3dcf63 100644
--- a/cpukit/libfs/src/imfs/imfs_handlers_device.c
+++ b/cpukit/libfs/src/imfs/imfs_handlers_device.c
@@ -1,6 +1,11 @@
-/*
- * Device Operations Table for the IMFS
+/**
+ * @file
*
+ * @brief Device Operations Table
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_handlers_directory.c b/cpukit/libfs/src/imfs/imfs_handlers_directory.c
index 9dcdcf2a90..61ca5527e1 100644
--- a/cpukit/libfs/src/imfs/imfs_handlers_directory.c
+++ b/cpukit/libfs/src/imfs/imfs_handlers_directory.c
@@ -1,6 +1,11 @@
-/*
- * Operations Table for Directories for the IMFS
+/**
+ * @file
*
+ * @brief Operations Table for Directories
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_handlers_link.c b/cpukit/libfs/src/imfs/imfs_handlers_link.c
index 2c4ad3f66f..5118eb5c83 100644
--- a/cpukit/libfs/src/imfs/imfs_handlers_link.c
+++ b/cpukit/libfs/src/imfs/imfs_handlers_link.c
@@ -1,6 +1,11 @@
-/*
- * Link Operations Table for the IMFS
+/**
+ * @file
*
+ * @brief Link Operations Table for the IMFS
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_handlers_memfile.c b/cpukit/libfs/src/imfs/imfs_handlers_memfile.c
index 6953319861..d0c5912eb3 100644
--- a/cpukit/libfs/src/imfs/imfs_handlers_memfile.c
+++ b/cpukit/libfs/src/imfs/imfs_handlers_memfile.c
@@ -1,6 +1,11 @@
-/*
- * Memfile Operations Tables for the IMFS
+/**
+ * @file
*
+ * @brief Memfile Operations Tables
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_initsupp.c b/cpukit/libfs/src/imfs/imfs_initsupp.c
index 3bb8a979fc..a68fff178f 100644
--- a/cpukit/libfs/src/imfs/imfs_initsupp.c
+++ b/cpukit/libfs/src/imfs/imfs_initsupp.c
@@ -1,6 +1,11 @@
-/*
- * IMFS Initialization
+/**
+ * @file
*
+ * @brief IMFS Node Support
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-2010.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_link.c b/cpukit/libfs/src/imfs/imfs_link.c
index 35c38636e7..fdfbd334e4 100644
--- a/cpukit/libfs/src/imfs/imfs_link.c
+++ b/cpukit/libfs/src/imfs/imfs_link.c
@@ -1,10 +1,11 @@
-/*
- * IMFS_link
- *
- * The following rouine creates a new link node under parent with the
- * name given in name. The link node is set to point to the node at
- * to_loc.
+/**
+ * @file
*
+ * @brief IMFS Create a New Link Node
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-2010.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_load_tar.c b/cpukit/libfs/src/imfs/imfs_load_tar.c
index e51194fa8c..723699bdcc 100644
--- a/cpukit/libfs/src/imfs/imfs_load_tar.c
+++ b/cpukit/libfs/src/imfs/imfs_load_tar.c
@@ -1,3 +1,10 @@
+/**
+ * @file
+ *
+ * @brief RTEMS Load Tarfs
+ * @ingroup IMFS
+ */
+
/*
* COPYRIGHT (c) 1989-2010.
* On-Line Applications Research Corporation (OAR).
@@ -11,14 +18,6 @@
#include "config.h"
#endif
-/*
- * This file implements the "mount" procedure for tar-based IMFS
- * extensions. The TAR is not actually mounted under the IMFS.
- * Directories from the TAR file are created as usual in the IMFS.
- * File entries are created as IMFS_LINEAR_FILE nodes with their nods
- * pointing to addresses in the TAR image.
- */
-
#include "imfs.h"
#include <sys/stat.h>
@@ -27,52 +26,10 @@
#include <rtems/untar.h>
-/*
- * TAR file format:
- *
- * Offset Length Contents
- * 0 100 bytes File name ('\0' terminated, 99 maxmum length)
- * 100 8 bytes File mode (in octal ascii)
- * 108 8 bytes User ID (in octal ascii)
- * 116 8 bytes Group ID (in octal ascii)
- * 124 12 bytes File size (s) (in octal ascii)
- * 136 12 bytes Modify time (in octal ascii)
- * 148 8 bytes Header checksum (in octal ascii)
- * 156 1 bytes Link flag
- * 157 100 bytes Linkname ('\0' terminated, 99 maxmum length)
- * 257 8 bytes Magic PAX ("ustar\0" + 2 bytes padding)
- * 257 8 bytes Magic GNU tar ("ustar \0")
- * 265 32 bytes User name ('\0' terminated, 31 maxmum length)
- * 297 32 bytes Group name ('\0' terminated, 31 maxmum length)
- * 329 8 bytes Major device ID (in octal ascii)
- * 337 8 bytes Minor device ID (in octal ascii)
- * 345 167 bytes Padding
- * 512 (s+p)bytes File contents (s+p) := (((s) + 511) & ~511),
- * round up to 512 bytes
- *
- * Checksum:
- * int i, sum;
- * char* header = tar_header_pointer;
- * sum = 0;
- * for(i = 0; i < 512; i++)
- * sum += 0xFF & header[i];
- */
-
#define MAX_NAME_FIELD_SIZE 99
#define MIN(a,b) ((a)>(b)?(b):(a))
-/*
- * rtems_tarfs_load
- *
- * Here we create the mountpoint directory and load the tarfs at
- * that node. Once the IMFS has been mounted, we work through the
- * tar image and perform as follows:
- * - For directories, simply call mkdir(). The IMFS creates nodes as
- * needed.
- * - For files, we make our own calls to IMFS eval_for_make and
- * create_node.
- */
int rtems_tarfs_load(
const char *mountpoint,
uint8_t *tar_image,
diff --git a/cpukit/libfs/src/imfs/imfs_make_generic_node.c b/cpukit/libfs/src/imfs/imfs_make_generic_node.c
index 5b7a7d9cec..f9e03b6487 100644
--- a/cpukit/libfs/src/imfs/imfs_make_generic_node.c
+++ b/cpukit/libfs/src/imfs/imfs_make_generic_node.c
@@ -1,3 +1,10 @@
+/**
+ * @file
+ *
+ * @brief IMFS Make a Generic Node
+ * @ingroup IMFS
+ */
+
/*
* Copyright (c) 2012 embedded brains GmbH. All rights reserved.
*
diff --git a/cpukit/libfs/src/imfs/imfs_mknod.c b/cpukit/libfs/src/imfs/imfs_mknod.c
index 2447f74a28..0344ad5684 100644
--- a/cpukit/libfs/src/imfs/imfs_mknod.c
+++ b/cpukit/libfs/src/imfs/imfs_mknod.c
@@ -1,8 +1,11 @@
-/*
- * IMFS_mknod
- *
- * Routine to create a node in the IMFS file system.
+/**
+ * @file
*
+ * @brief Create a IMFS Node
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-2010.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_mount.c b/cpukit/libfs/src/imfs/imfs_mount.c
index f8e9d72f5a..49c3cae45c 100644
--- a/cpukit/libfs/src/imfs/imfs_mount.c
+++ b/cpukit/libfs/src/imfs/imfs_mount.c
@@ -1,6 +1,11 @@
-/*
- * IMFS_mount
+/**
+ * @file
*
+ * @brief Mount an IMFS
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_ntype.c b/cpukit/libfs/src/imfs/imfs_ntype.c
index e955606fe2..fd9056279d 100644
--- a/cpukit/libfs/src/imfs/imfs_ntype.c
+++ b/cpukit/libfs/src/imfs/imfs_ntype.c
@@ -1,9 +1,11 @@
-/*
- * IMFS_node_type
- *
- * The following verifies that returns the type of node that the
- * loc refers to.
+/**
+ * @file
*
+ * @brief IMFS Node Type
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_readlink.c b/cpukit/libfs/src/imfs/imfs_readlink.c
index e20003a703..7cbbe5e17d 100644
--- a/cpukit/libfs/src/imfs/imfs_readlink.c
+++ b/cpukit/libfs/src/imfs/imfs_readlink.c
@@ -1,9 +1,11 @@
-/*
- * IMFS_readlink
- *
- * The following rouine puts the symblic links destination name into
- * buff.
+/**
+ * @file
*
+ * @brief IMFS Put Symbolic Link into Buffer
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_rename.c b/cpukit/libfs/src/imfs/imfs_rename.c
index e283b9dff1..8c642638b3 100644
--- a/cpukit/libfs/src/imfs/imfs_rename.c
+++ b/cpukit/libfs/src/imfs/imfs_rename.c
@@ -1,9 +1,11 @@
-/*
- * IMFS_rename
- *
- * The following rouine creates a new link node under parent with the
- * name given in name and removes the old.
+/**
+ * @file
*
+ * @brief IMFS Rename
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-2010.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_rmnod.c b/cpukit/libfs/src/imfs/imfs_rmnod.c
index 90e61d9ee9..90a551b743 100644
--- a/cpukit/libfs/src/imfs/imfs_rmnod.c
+++ b/cpukit/libfs/src/imfs/imfs_rmnod.c
@@ -1,9 +1,11 @@
-/*
- * IMFS Node Removal Handler
- *
- * This file contains the handler used to remove a node when a file type
- * does not require special actions.
+/**
+ * @file
*
+ * @brief IMFS Node Removal Handler
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_stat.c b/cpukit/libfs/src/imfs/imfs_stat.c
index 8f373c6287..87f03551ad 100644
--- a/cpukit/libfs/src/imfs/imfs_stat.c
+++ b/cpukit/libfs/src/imfs/imfs_stat.c
@@ -1,8 +1,11 @@
-/*
- * IMFS_stat
- *
- * This routine provides a stat for the IMFS file system.
+/**
+ * @file
*
+ * @brief IMFS Stat
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_symlink.c b/cpukit/libfs/src/imfs/imfs_symlink.c
index 00a7f970a5..546ad2694a 100644
--- a/cpukit/libfs/src/imfs/imfs_symlink.c
+++ b/cpukit/libfs/src/imfs/imfs_symlink.c
@@ -1,10 +1,11 @@
-/*
- * IMFS_symlink
- *
- * The following rouine creates a new symbolic link node under parent
- * with the name given in name. The node is set to point to the node at
- * to_loc.
+/**
+ * @file
*
+ * @brief IMFS Create a New Symbolic Link Node
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_unmount.c b/cpukit/libfs/src/imfs/imfs_unmount.c
index e7b42676b2..590439d0a6 100644
--- a/cpukit/libfs/src/imfs/imfs_unmount.c
+++ b/cpukit/libfs/src/imfs/imfs_unmount.c
@@ -1,6 +1,11 @@
-/*
- * IMFS_unmount
+/**
+ * @file
*
+ * @brief Unmount an IMFS
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/imfs_utime.c b/cpukit/libfs/src/imfs/imfs_utime.c
index 5eee799d7e..aa7d455c3a 100644
--- a/cpukit/libfs/src/imfs/imfs_utime.c
+++ b/cpukit/libfs/src/imfs/imfs_utime.c
@@ -1,9 +1,11 @@
-/*
- * IMFS_utime
- *
- * This routine is the implementation of the utime() system
- * call for the IMFS.
+/**
+ * @file
*
+ * @brief Set IMFS File Access and Modification Times
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
diff --git a/cpukit/libfs/src/imfs/ioman.c b/cpukit/libfs/src/imfs/ioman.c
index 8b434e7e8c..27ec89ad21 100644
--- a/cpukit/libfs/src/imfs/ioman.c
+++ b/cpukit/libfs/src/imfs/ioman.c
@@ -1,7 +1,11 @@
-/*
- * This file emulates the old Classic RTEMS IO manager directives
- * which register and lookup names using the in-memory filesystem.
+/**
+ * @file
*
+ * @brief RTMES Register IO Name
+ * @ingroup ClassicIO
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
@@ -22,12 +26,6 @@
#include <rtems/libio_.h>
-/*
- * rtems_io_register_name
- *
- * This assumes that all registered devices are character devices.
- */
-
rtems_status_code rtems_io_register_name(
const char *device_name,
rtems_device_major_number major,
diff --git a/cpukit/libfs/src/imfs/memfile.c b/cpukit/libfs/src/imfs/memfile.c
index 2eb7949275..901ebc6e2a 100644
--- a/cpukit/libfs/src/imfs/memfile.c
+++ b/cpukit/libfs/src/imfs/memfile.c
@@ -1,12 +1,11 @@
-/*
- * IMFS Device Node Handlers
- *
- * This file contains the set of handlers used to process operations on
- * IMFS memory file nodes. The memory files are created in memory using
- * malloc'ed memory. Thus any data stored in one of these files is lost
- * at system shutdown unless special arrangements to copy the data to
- * some type of non-volailte storage are made by the application.
+/**
+ * @file
*
+ * @brief IMFS Memory File Handlers
+ * @ingroup IMFS
+ */
+
+/*
* COPYRIGHT (c) 1989-2010.
* On-Line Applications Research Corporation (OAR).
*
@@ -71,12 +70,6 @@ void memfile_free_block(
void *memory
);
-/*
- * memfile_open
- *
- * This routine processes the open() system call. Note that there is
- * nothing special to be done at open() time.
- */
int memfile_open(
rtems_libio_t *iop,
const char *pathname,
@@ -109,11 +102,6 @@ int memfile_open(
return 0;
}
-/*
- * memfile_read
- *
- * This routine processes the read() system call.
- */
ssize_t memfile_read(
rtems_libio_t *iop,
void *buffer,
@@ -133,11 +121,6 @@ ssize_t memfile_read(
return status;
}
-/*
- * memfile_write
- *
- * This routine processes the write() system call.
- */
ssize_t memfile_write(
rtems_libio_t *iop,
const void *buffer,
@@ -166,11 +149,6 @@ ssize_t memfile_write(
* This IMFS_stat() can be used.
*/
-/*
- * memfile_ftruncate
- *
- * This routine processes the ftruncate() system call.
- */
int memfile_ftruncate(
rtems_libio_t *iop,
off_t length