diff options
Diffstat (limited to 'cpukit/libcsupport/include/rtems')
-rw-r--r-- | cpukit/libcsupport/include/rtems/assoc.h | 3 | ||||
-rw-r--r-- | cpukit/libcsupport/include/rtems/libcsupport.h | 6 | ||||
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio.h | 139 | ||||
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio_.h | 26 | ||||
-rw-r--r-- | cpukit/libcsupport/include/rtems/malloc.h | 2 |
5 files changed, 104 insertions, 72 deletions
diff --git a/cpukit/libcsupport/include/rtems/assoc.h b/cpukit/libcsupport/include/rtems/assoc.h index 70ac56d662..06a74849ef 100644 --- a/cpukit/libcsupport/include/rtems/assoc.h +++ b/cpukit/libcsupport/include/rtems/assoc.h @@ -85,6 +85,9 @@ const char *rtems_assoc_name_by_local( uint32_t ); +/** + * @brief RTEMS Associate Name by Remote + */ const char *rtems_assoc_name_by_remote( const rtems_assoc_t *, uint32_t diff --git a/cpukit/libcsupport/include/rtems/libcsupport.h b/cpukit/libcsupport/include/rtems/libcsupport.h index abe70205e3..81e2156ba4 100644 --- a/cpukit/libcsupport/include/rtems/libcsupport.h +++ b/cpukit/libcsupport/include/rtems/libcsupport.h @@ -56,6 +56,12 @@ Heap_Control *malloc_get_heap_pointer( void ); extern void libc_init(void); extern int host_errno(void); extern void fix_syscall_errno(void); + +/** + * @brief RTEMS Malloc Get Free Information + * + * Find amount of free heap remaining + */ extern size_t malloc_free_space(void); extern void open_dev_console(void); diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h index 85bcb9774d..84f3dc7451 100644 --- a/cpukit/libcsupport/include/rtems/libio.h +++ b/cpukit/libcsupport/include/rtems/libio.h @@ -4,6 +4,10 @@ * @ingroup LibIO * * @brief Basic IO API. + * + * This file contains the support infrastructure used to manage the + * table of integer style file descriptors used by the low level + * POSIX system calls like open(), read, fstat(), etc. */ /* @@ -172,7 +176,7 @@ typedef void (*rtems_filesystem_eval_path_t)( * @param[in] namelen Length of the name for the new link in characters. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_link(). */ @@ -190,7 +194,7 @@ typedef int (*rtems_filesystem_link_t)( * @param[in] mode The new mode of the node * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_fchmod(). */ @@ -207,7 +211,7 @@ typedef int (*rtems_filesystem_fchmod_t)( * @param[in] group Group ID for the node. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_chown(). */ @@ -228,7 +232,7 @@ typedef int (*rtems_filesystem_chown_t)( * @param[in, out] loc Location to clone. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_clonenode(). */ @@ -259,7 +263,7 @@ typedef void (*rtems_filesystem_freenode_t)( * @param[in] mt_entry The mount table entry. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_mount(). */ @@ -277,7 +281,7 @@ typedef int (*rtems_filesystem_mount_t) ( * @param[in] data The data provided by the user. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. */ typedef int (*rtems_filesystem_fsmount_me_t)( rtems_filesystem_mount_table_entry_t *mt_entry, @@ -294,7 +298,7 @@ typedef int (*rtems_filesystem_fsmount_me_t)( * @param[in] mt_entry The mount table entry. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_unmount(). */ @@ -361,7 +365,7 @@ typedef rtems_filesystem_node_types_t (*rtems_filesystem_node_type_t)( * @param[in] dev Optional device identifier for the new node. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_mknod(). */ @@ -380,7 +384,7 @@ typedef int (*rtems_filesystem_mknod_t)( * @param[in] loc The location of the node. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_rmnod(). */ @@ -397,7 +401,7 @@ typedef int (*rtems_filesystem_rmnod_t)( * @param[in] modtime Modification for the node. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_utime(). */ @@ -417,7 +421,7 @@ typedef int (*rtems_filesystem_utime_t)( * @param[in] target Contents for the symbolic link. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_symlink(). */ @@ -436,7 +440,7 @@ typedef int (*rtems_filesystem_symlink_t)( * @param[in] bufsize The size of the buffer in characters. * * @retval non-negative Size of the actual contents in characters. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_readlink(). */ @@ -456,7 +460,7 @@ typedef ssize_t (*rtems_filesystem_readlink_t)( * @param[in] namelen Length of the name for the new node in characters. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_rename(). */ @@ -475,7 +479,7 @@ typedef int (*rtems_filesystem_rename_t)( * @param[out] buf Buffer for file system information. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_statvfs(). */ @@ -758,7 +762,7 @@ int rtems_filesystem_default_statvfs( * @param[in] mode Optional mode for node creation. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_open(). */ @@ -775,7 +779,7 @@ typedef int (*rtems_filesystem_open_t)( * @param[in, out] iop The IO pointer. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_close(). */ @@ -793,7 +797,7 @@ typedef int (*rtems_filesystem_close_t)( * @param[in] count The size of the buffer in characters. * * @retval non-negative Count of read characters. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_read(). */ @@ -813,7 +817,7 @@ typedef ssize_t (*rtems_filesystem_read_t)( * @param[in] count The size of the buffer in characters. * * @retval non-negative Count of written characters. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_write(). */ @@ -831,7 +835,7 @@ typedef ssize_t (*rtems_filesystem_write_t)( * @param[in, out] buffer The buffer for IO control request data. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_ioctl(). */ @@ -849,7 +853,7 @@ typedef int (*rtems_filesystem_ioctl_t)( * @param[in] whence The reference position for the offset. * * @retval non-negative The new offset from the beginning of the file. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_lseek(), * rtems_filesystem_default_lseek_file(), and @@ -868,7 +872,7 @@ typedef off_t (*rtems_filesystem_lseek_t)( * @param[out] stat The buffer to status information. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_fstat(). */ @@ -884,7 +888,7 @@ typedef int (*rtems_filesystem_fstat_t)( * @param[in] length The new length in characters. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_ftruncate() and * rtems_filesystem_default_ftruncate_directory(). @@ -900,7 +904,7 @@ typedef int (*rtems_filesystem_ftruncate_t)( * @param[in, out] iop The IO pointer. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_fsync_or_fdatasync() and * rtems_filesystem_default_fsync_or_fdatasync_success(). @@ -915,7 +919,7 @@ typedef int (*rtems_filesystem_fsync_t)( * @param[in, out] iop The IO pointer. * * @retval 0 Successful operation. - * @retval -1 An error occured. The errno is set to indicate the error. + * @retval -1 An error occurred. The errno is set to indicate the error. * * @see rtems_filesystem_default_fsync_or_fdatasync() and * rtems_filesystem_default_fsync_or_fdatasync_success(). @@ -931,7 +935,7 @@ typedef int (*rtems_filesystem_fdatasync_t)( * @param[in] cmd Control command. * * @retval 0 Successful operation. - * @retval errno An error occured. This value is assigned to errno. + * @retval errno An error occurred. This value is assigned to errno. * * @see rtems_filesystem_default_fcntl(). */ @@ -1053,7 +1057,7 @@ off_t rtems_filesystem_default_lseek_directory( * * This function has no protection against concurrent access. * - * @retval -1 An error occured. In case an integer overflow occured, then the + * @retval -1 An error occurred. In case an integer overflow occurred, then the * errno will be set to EOVERFLOW. In case the new offset is negative, then * the errno will be set to EINVAL. In case the whence is SEEK_END and the * fstat() handler to obtain the current file size returned an error status, @@ -1176,9 +1180,9 @@ typedef struct { } rtems_filesystem_limits_and_options_t; /** - * @brief Default Pathconf Settings + * @brief Default pathconf settings. * - * Override in a filesystem. + * Override in a filesystem. */ extern const rtems_filesystem_limits_and_options_t rtems_filesystem_default_pathconf; @@ -1251,6 +1255,11 @@ typedef struct { /** @} */ +/** + * @brief RTEMS LibIO Initialization + * + * Called by BSP startup code to initialize the libio subsystem. + */ void rtems_libio_init(void); /** @@ -1401,7 +1410,7 @@ extern rtems_fs_init_functions_t rtems_fs_init_helper; * The @a mode value selects the access permissions of the directory. * * @retval 0 Successful operation. - * @retval -1 An error occured. The @c errno indicates the error. + * @retval -1 An error occurred. The @c errno indicates the error. */ extern int rtems_mkdir(const char *path, mode_t mode); @@ -1509,7 +1518,7 @@ extern rtems_chain_control rtems_filesystem_mount_table; * The @a mount_h handler will be used to mount a file system of this @a type. * * @retval 0 Successful operation. - * @retval -1 An error occured. The @c errno indicates the error. + * @retval -1 An error occurred. The @c errno indicates the error. */ int rtems_filesystem_register( const char *type, @@ -1520,7 +1529,7 @@ int rtems_filesystem_register( * @brief Unregisters a file system @a type. * * @retval 0 Successful operation. - * @retval -1 An error occured. The @c errno indicates the error. + * @retval -1 An error occurred. The @c errno indicates the error. */ int rtems_filesystem_unregister( const char *type @@ -1542,7 +1551,7 @@ int rtems_filesystem_unregister( * unpredictable effects. * * @retval 0 Successful operation. - * @retval -1 An error occured. The @c errno indicates the error. + * @retval -1 An error occurred. The @c errno indicates the error. * * @see ClassicEventTransient. */ @@ -1551,38 +1560,38 @@ int unmount( ); /** - * @brief Mounts a File System - * - * The @a source may be a path to the corresponding device file, or @c NULL. - * The @a target path must lead to an existing directory, or @c NULL. - * In case @a target is @c NULL, the root file system will be mounted. - * The @a data parameter will be forwarded to the file system - * initialization handler. The file system type is selected by - * @a filesystemtype and may be one of - * - RTEMS_FILESYSTEM_TYPE_DEVFS, - * - RTEMS_FILESYSTEM_TYPE_DOSFS, - * - RTEMS_FILESYSTEM_TYPE_FTPFS, - * - RTEMS_FILESYSTEM_TYPE_IMFS, - * - RTEMS_FILESYSTEM_TYPE_MINIIMFS, - * - RTEMS_FILESYSTEM_TYPE_NFS, - * - RTEMS_FILESYSTEM_TYPE_RFS, or - * - RTEMS_FILESYSTEM_TYPE_TFTPFS. - * - * Only configured or registered file system types are available. - * You can add file system types to your application configuration with - * - CONFIGURE_FILESYSTEM_DEVFS, - * - CONFIGURE_FILESYSTEM_DOSFS, - * - CONFIGURE_FILESYSTEM_FTPFS, - * - CONFIGURE_FILESYSTEM_IMFS, - * - CONFIGURE_FILESYSTEM_MINIIMFS, - * - CONFIGURE_FILESYSTEM_NFS, - * - CONFIGURE_FILESYSTEM_RFS, and - * - CONFIGURE_FILESYSTEM_TFTPFS. - * - * @see rtems_filesystem_register() and mount_and_make_target_path(). - * - * @retval 0 Successful operation. - * @retval -1 An error occured. The @c errno indicates the error. + * @brief Mounts a file system at @a target. + * + * The @a source may be a path to the corresponding device file, or @c NULL. + * The @a target path must lead to an existing directory, or @c NULL. + * In case @a target is @c NULL, the root file system will be mounted. + * The @a data parameter will be forwarded to the file system + * initialization handler. The file system type is selected by + * @a filesystemtype and may be one of + * - RTEMS_FILESYSTEM_TYPE_DEVFS, + * - RTEMS_FILESYSTEM_TYPE_DOSFS, + * - RTEMS_FILESYSTEM_TYPE_FTPFS, + * - RTEMS_FILESYSTEM_TYPE_IMFS, + * - RTEMS_FILESYSTEM_TYPE_MINIIMFS, + * - RTEMS_FILESYSTEM_TYPE_NFS, + * - RTEMS_FILESYSTEM_TYPE_RFS, or + * - RTEMS_FILESYSTEM_TYPE_TFTPFS. + * + * Only configured or registered file system types are available. + * You can add file system types to your application configuration with + * - CONFIGURE_FILESYSTEM_DEVFS, + * - CONFIGURE_FILESYSTEM_DOSFS, + * - CONFIGURE_FILESYSTEM_FTPFS, + * - CONFIGURE_FILESYSTEM_IMFS, + * - CONFIGURE_FILESYSTEM_MINIIMFS, + * - CONFIGURE_FILESYSTEM_NFS, + * - CONFIGURE_FILESYSTEM_RFS, and + * - CONFIGURE_FILESYSTEM_TFTPFS. + * + * @see rtems_filesystem_register() and mount_and_make_target_path(). + * + * @retval 0 Successful operation. + * @retval -1 An error occurred. The @c errno indicates the error. */ int mount( const char *source, @@ -1601,7 +1610,7 @@ int mount( * @see mount(). * * @retval 0 Successful operation. - * @retval -1 An error occured. The @c errno indicates the error. + * @retval -1 An error occurred. The @c errno indicates the error. */ int mount_and_make_target_path( const char *source, diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h index 7c5a29f0c3..6ef4b6ccb6 100644 --- a/cpukit/libcsupport/include/rtems/libio_.h +++ b/cpukit/libcsupport/include/rtems/libio_.h @@ -179,14 +179,14 @@ extern rtems_filesystem_global_location_t rtems_filesystem_global_location_null; rtems_libio_check_permissions_with_error(_iop, _flag, EINVAL ) /** - * @brief Clones a Node + * @brief Clones a node. * - * The caller must hold the file system instance lock. + * The caller must hold the file system instance lock. * - * @param[out] clone The cloned location. - * @param[in] master The master location. + * @param[out] clone The cloned location. + * @param[in] master The master location. * - * @see rtems_filesystem_instance_lock(). + * @see rtems_filesystem_instance_lock(). */ void rtems_filesystem_location_clone( rtems_filesystem_location_info_t *clone, @@ -276,12 +276,26 @@ static inline void rtems_filesystem_instance_unlock( * File Descriptor Routine Prototypes */ +/** + * This routine searches the IOP Table for an unused entry. If it + * finds one, it returns it. Otherwise, it returns NULL. + */ rtems_libio_t *rtems_libio_allocate(void); +/** + * Convert UNIX fnctl(2) flags to ones that RTEMS drivers understand + */ uint32_t rtems_libio_fcntl_flags( int fcntl_flags ); +/** + * Convert RTEMS internal flags to UNIX fnctl(2) flags + */ int rtems_libio_to_fcntl_flags( uint32_t flags ); +/** + * This routine frees the resources associated with an IOP (file descriptor) + * and clears the slot in the IOP Table. + */ void rtems_libio_free( rtems_libio_t *iop ); @@ -776,7 +790,7 @@ void rtems_filesystem_eval_path_error( * @brief Checks that the locations exist in the same file system instance. * * @retval 0 The locations exist and are in the same file system instance. - * @retval -1 An error occured. The @c errno indicates the error. + * @retval -1 An error occurred. The @c errno indicates the error. */ int rtems_filesystem_location_exists_in_same_instance_as( const rtems_filesystem_location_info_t *a, diff --git a/cpukit/libcsupport/include/rtems/malloc.h b/cpukit/libcsupport/include/rtems/malloc.h index a257674a38..c428bcffb2 100644 --- a/cpukit/libcsupport/include/rtems/malloc.h +++ b/cpukit/libcsupport/include/rtems/malloc.h @@ -110,7 +110,7 @@ typedef void (*rtems_malloc_dirtier_t)(void *, size_t); extern rtems_malloc_dirtier_t rtems_malloc_dirty_helper; /** - * @brief Dirty memory function + * @brief Dirty Memory Function * * This method fills the specified area with a non-zero pattern * to aid in debugging programs which do not initialize their |