From 6d5ba497b19ad6d379c80197b3ce412f981c3321 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Dec 2012 10:13:36 +0100 Subject: Filesystem: Revert documentation changes --- cpukit/libcsupport/include/rtems/libio.h | 68 +++++++++++++++---------------- cpukit/libcsupport/include/rtems/libio_.h | 10 ++--- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h index 85bcb9774d..756ae6f1f8 100644 --- a/cpukit/libcsupport/include/rtems/libio.h +++ b/cpukit/libcsupport/include/rtems/libio.h @@ -1176,9 +1176,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; @@ -1551,38 +1551,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 occured. The @c errno indicates the error. */ int mount( const char *source, diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h index 7c5a29f0c3..f56926acd9 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, -- cgit v1.2.3 From d0b9295fd9c1fc8e2458634f2d88ba1ef38d54a2 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Dec 2012 10:17:04 +0100 Subject: Fix spelling --- cpukit/libblock/include/rtems/blkdev.h | 2 +- cpukit/libcsupport/include/rtems/libio.h | 64 +++++++++++++++---------------- cpukit/libcsupport/include/rtems/libio_.h | 2 +- cpukit/libfs/src/rfs/rtems-rfs-rtems.h | 2 +- cpukit/score/include/rtems/score/heap.h | 2 +- 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/cpukit/libblock/include/rtems/blkdev.h b/cpukit/libblock/include/rtems/blkdev.h index 0ea955d435..f29a34987f 100644 --- a/cpukit/libblock/include/rtems/blkdev.h +++ b/cpukit/libblock/include/rtems/blkdev.h @@ -154,7 +154,7 @@ typedef struct rtems_blkdev_request { * @param[in,out] req The transfer request. * @param[in] status The status of the operation should be * - @c RTEMS_SUCCESSFUL, if the operation was successful, - * - @c RTEMS_IO_ERROR, if some sort of input or output error occured, or + * - @c RTEMS_IO_ERROR, if some sort of input or output error occurred, or * - @c RTEMS_UNSATISFIED, if media is no more present. */ static inline void rtems_blkdev_request_done( diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h index 756ae6f1f8..41c6a7072e 100644 --- a/cpukit/libcsupport/include/rtems/libio.h +++ b/cpukit/libcsupport/include/rtems/libio.h @@ -172,7 +172,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 +190,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 +207,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 +228,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 +259,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 +277,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 +294,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 +361,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 +380,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 +397,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 +417,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 +436,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 +456,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 +475,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 +758,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 +775,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 +793,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 +813,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 +831,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 +849,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 +868,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 +884,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 +900,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 +915,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 +931,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 +1053,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, @@ -1401,7 +1401,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 +1509,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 +1520,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 +1542,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. */ @@ -1582,7 +1582,7 @@ int unmount( * @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. + * @retval -1 An error occurred. The @c errno indicates the error. */ int mount( const char *source, @@ -1601,7 +1601,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 f56926acd9..8e5fa41597 100644 --- a/cpukit/libcsupport/include/rtems/libio_.h +++ b/cpukit/libcsupport/include/rtems/libio_.h @@ -776,7 +776,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/libfs/src/rfs/rtems-rfs-rtems.h b/cpukit/libfs/src/rfs/rtems-rfs-rtems.h index c475c4025b..00fcb27143 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-rtems.h +++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems.h @@ -46,7 +46,7 @@ * * @param what The message to print is the error is not zero. * @param error The error code. - * @retval -1 An error has occured. + * @retval -1 An error has occurred. * @retval 0 No error. */ int rtems_rfs_rtems_error (const char* mesg, int error); diff --git a/cpukit/score/include/rtems/score/heap.h b/cpukit/score/include/rtems/score/heap.h index 36ef48f3b6..f3d259d6cf 100644 --- a/cpukit/score/include/rtems/score/heap.h +++ b/cpukit/score/include/rtems/score/heap.h @@ -558,7 +558,7 @@ bool _Heap_Free( Heap_Control *heap, void *addr ); * If @a dump is @c true, then diagnostic messages will be printed to standard * output. In this case @a source is used to mark the output lines. * - * Returns @c true if no errors occured, and @c false if the heap is corrupt. + * Returns @c true if no errors occurred, and @c false if the heap is corrupt. */ bool _Heap_Walk( Heap_Control *heap, -- cgit v1.2.3 From 4fdc3ee0aa9d319aa19a83f986d57995b8b44991 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 13 Dec 2012 18:21:08 +0100 Subject: dosfs: Avoid error caused by bdbuf configuration The success of a block size change depends on the bdbuf configuration. Do not treat a failed block size change as a hard error. This is only a missed performance optimization. --- cpukit/libfs/src/dosfs/fat.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/cpukit/libfs/src/dosfs/fat.c b/cpukit/libfs/src/dosfs/fat.c index c82bf5ac8b..a672f42c7a 100644 --- a/cpukit/libfs/src/dosfs/fat.c +++ b/cpukit/libfs/src/dosfs/fat.c @@ -773,17 +773,12 @@ fat_init_volume_info(fat_fs_info_t *fs_info, const char *device) if (is_cluster_aligned(vol, vol->data_fsec) && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) { - vol->bytes_per_block = vol->bpc; - vol->bytes_per_block_log2 = vol->bpc_log2; - vol->sectors_per_block = vol->spc; - sc = rtems_bdbuf_set_block_size (vol->dd, vol->bytes_per_block, true); - if (RTEMS_SUCCESSFUL != sc) + sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); + if (sc == RTEMS_SUCCESSFUL) { - close(vol->fd); - free(fs_info->vhash); - free(fs_info->rhash); - free(fs_info->uino); - rtems_set_errno_and_return_minus_one( EIO ); + vol->bytes_per_block = vol->bpc; + vol->bytes_per_block_log2 = vol->bpc_log2; + vol->sectors_per_block = vol->spc; } } -- cgit v1.2.3 From cefc9aea6b8ccb5f634ba5d0389a44bbe180f0ca Mon Sep 17 00:00:00 2001 From: Alex Ivanov Date: Sat, 15 Dec 2012 07:23:36 -0500 Subject: libcsupport: Doxygen Enhancement Task #8 http://www.google-melange.com/gci/task/view/google/gci2012/7996208 --- cpukit/libcsupport/include/rtems/assoc.h | 3 ++ cpukit/libcsupport/include/rtems/libcsupport.h | 6 ++++ cpukit/libcsupport/include/rtems/libio.h | 9 ++++++ cpukit/libcsupport/include/rtems/libio_.h | 14 +++++++++ cpukit/libcsupport/include/rtems/malloc.h | 2 +- cpukit/libcsupport/src/__gettod.c | 22 +++++++++----- cpukit/libcsupport/src/__times.c | 26 ++++++++-------- cpukit/libcsupport/src/assocnamebyremote.c | 8 +++-- cpukit/libcsupport/src/cfgetispeed.c | 9 ++++-- cpukit/libcsupport/src/freenode.c | 8 +++-- cpukit/libcsupport/src/getchark.c | 7 +++++ cpukit/libcsupport/src/getlogin.c | 15 ++++++--- cpukit/libcsupport/src/libio.c | 37 +++++------------------ cpukit/libcsupport/src/libio_init.c | 17 +++++------ cpukit/libcsupport/src/malloc_dirtier.c | 9 ++++-- cpukit/libcsupport/src/malloc_get_statistics.c | 9 ++++-- cpukit/libcsupport/src/mallocfreespace.c | 10 ++++-- cpukit/libcsupport/src/readv.c | 20 ++++++++---- cpukit/libcsupport/src/setsid.c | 10 ++++-- cpukit/libcsupport/src/stat.c | 25 +++++++++------ cpukit/libcsupport/src/sup_fs_check_permissions.c | 7 +++++ cpukit/libcsupport/src/sup_fs_location.c | 7 +++++ cpukit/libcsupport/src/termios_setinitialbaud.c | 7 +++++ cpukit/libcsupport/src/ttyname.c | 12 ++++++-- cpukit/libcsupport/src/utime.c | 12 ++++++-- 25 files changed, 210 insertions(+), 101 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 41c6a7072e..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. */ /* @@ -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); /** diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h index 8e5fa41597..6ef4b6ccb6 100644 --- a/cpukit/libcsupport/include/rtems/libio_.h +++ b/cpukit/libcsupport/include/rtems/libio_.h @@ -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 ); 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 diff --git a/cpukit/libcsupport/src/__gettod.c b/cpukit/libcsupport/src/__gettod.c index a2f9d1052d..73cd04f821 100644 --- a/cpukit/libcsupport/src/__gettod.c +++ b/cpukit/libcsupport/src/__gettod.c @@ -1,6 +1,11 @@ -/* - * gettimeofday() - SVR4 and BSD4.3 extension required by Newlib +/** + * @file * + * @brief Get the Date and Time + * @ingroup libcsupport + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -22,8 +27,11 @@ #include #if defined(RTEMS_NEWLIB) && !defined(HAVE_GETTIMEOFDAY) -/* - * NOTE: The solaris gettimeofday does not have a second parameter. + +/** + * SVR4 and BSD4.3 extension required by Newlib + * + * @note The solaris gettimeofday does not have a second parameter. */ int gettimeofday( struct timeval *tp, @@ -54,7 +62,7 @@ int gettimeofday( #include -/* +/** * "Reentrant" version */ int _gettimeofday_r( @@ -68,10 +76,10 @@ int _gettimeofday_r( #endif #if defined(RTEMS_NEWLIB) && !defined(HAVE__GETTIMEOFDAY) -/* + +/** * "System call" version */ - int _gettimeofday( struct timeval *tp, struct timezone *tzp diff --git a/cpukit/libcsupport/src/__times.c b/cpukit/libcsupport/src/__times.c index 097cc9fe63..d941f933db 100644 --- a/cpukit/libcsupport/src/__times.c +++ b/cpukit/libcsupport/src/__times.c @@ -1,6 +1,11 @@ -/* - * times() - POSIX 1003.1b 4.5.2 - Get Process Times +/** + * @file * + * @brief Get Process Times + * @ingroup libcsupport + */ + +/* * COPYRIGHT (c) 1989-2010. * On-Line Applications Research Corporation (OAR). * @@ -24,6 +29,9 @@ #include #endif +/** + * POSIX 1003.1b 4.5.2 - Get Process Times + */ clock_t _times( struct tms *ptms ) @@ -79,12 +87,9 @@ clock_t _times( return ticks; } -/* - * times() - * +/** * times() system call wrapper for _times() above. */ - clock_t times( struct tms *ptms ) @@ -92,16 +97,13 @@ clock_t times( return _times( ptms ); } -/* - * _times_r - * - * This is the Newlib dependent reentrant version of times(). - */ - #if defined(RTEMS_NEWLIB) #include +/** + * This is the Newlib dependent reentrant version of times(). + */ clock_t _times_r( struct _reent *ptr __attribute__((unused)), struct tms *ptms diff --git a/cpukit/libcsupport/src/assocnamebyremote.c b/cpukit/libcsupport/src/assocnamebyremote.c index 92bad05956..376ba47ac7 100644 --- a/cpukit/libcsupport/src/assocnamebyremote.c +++ b/cpukit/libcsupport/src/assocnamebyremote.c @@ -1,6 +1,8 @@ -/* - * assoc.c - * rtems assoc routines +/** + * @file + * + * @brief RTEMS Associate Name by Remote + * @ingroup Associativity */ #if HAVE_CONFIG_H diff --git a/cpukit/libcsupport/src/cfgetispeed.c b/cpukit/libcsupport/src/cfgetispeed.c index 390e607ae5..a458f26b39 100644 --- a/cpukit/libcsupport/src/cfgetispeed.c +++ b/cpukit/libcsupport/src/cfgetispeed.c @@ -1,6 +1,11 @@ -/* - * cfgetispeed() - POSIX 1003.1b 7.1.3 - Baud Rate Functions +/** + * @file * + * @brief Baud Rate Functions + * @ingroup Termios + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/libcsupport/src/freenode.c b/cpukit/libcsupport/src/freenode.c index 84e58256d2..1646352359 100644 --- a/cpukit/libcsupport/src/freenode.c +++ b/cpukit/libcsupport/src/freenode.c @@ -1,6 +1,10 @@ -/* - * freenode() +/** + * @file * + * @brief Releases all Resources of a Location + * @ingroup LibIOInternal + */ +/* * COPYRIGHT (c) 1989-2010. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/libcsupport/src/getchark.c b/cpukit/libcsupport/src/getchark.c index 1e7bf017c8..785096905b 100644 --- a/cpukit/libcsupport/src/getchark.c +++ b/cpukit/libcsupport/src/getchark.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Get Character from Stdin + * @ingroup libcsupport + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/libcsupport/src/getlogin.c b/cpukit/libcsupport/src/getlogin.c index dbc348b95f..fe0f9ad6f8 100644 --- a/cpukit/libcsupport/src/getlogin.c +++ b/cpukit/libcsupport/src/getlogin.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Get User Name + * @ingroup libcsupport + */ + #if HAVE_CONFIG_H #include "config.h" #endif @@ -15,10 +22,10 @@ #include #include -/* +/** * 4.2.4 Get User Name, P1003.1b-1993, p. 87 * - * NOTE: P1003.1c/D10, p. 49 adds getlogin_r(). + * @note P1003.1c/D10, p. 49 adds getlogin_r(). */ char *getlogin( void ) { @@ -26,10 +33,10 @@ char *getlogin( void ) return _POSIX_types_Getlogin_buffer; } -/* +/** * 4.2.4 Get User Name, P1003.1b-1993, p. 87 * - * NOTE: P1003.1c/D10, p. 49 adds getlogin_r(). + * @note P1003.1c/D10, p. 49 adds getlogin_r(). */ int getlogin_r( char *name, diff --git a/cpukit/libcsupport/src/libio.c b/cpukit/libcsupport/src/libio.c index c8ab1f3a9a..a12a12c833 100644 --- a/cpukit/libcsupport/src/libio.c +++ b/cpukit/libcsupport/src/libio.c @@ -1,8 +1,11 @@ -/* - * 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. +/** + * @file * + * @brief File Descriptor Routines + * @ingroup LibIOInternal + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * @@ -39,12 +42,6 @@ */ #undef ACCEPT_O_NDELAY_ALIAS -/* - * rtems_libio_fcntl_flags - * - * Convert UNIX fnctl(2) flags to ones that RTEMS drivers understand - */ - static const rtems_assoc_t access_modes_assoc[] = { { "READ", LIBIO_FLAGS_READ, O_RDONLY }, { "WRITE", LIBIO_FLAGS_WRITE, O_WRONLY }, @@ -87,12 +84,6 @@ uint32_t rtems_libio_fcntl_flags( int fcntl_flags ) return flags; } -/* - * rtems_libio_to_fcntl_flags - * - * Convert RTEMS internal flags to UNIX fnctl(2) flags - */ - int rtems_libio_to_fcntl_flags( uint32_t flags ) { int fcntl_flags = 0; @@ -120,13 +111,6 @@ int rtems_libio_to_fcntl_flags( uint32_t flags ) return fcntl_flags; } -/* - * rtems_libio_allocate - * - * 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 ) { rtems_libio_t *iop = NULL; @@ -145,13 +129,6 @@ rtems_libio_t *rtems_libio_allocate( void ) return iop; } -/* - * rtems_libio_free - * - * 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 ) diff --git a/cpukit/libcsupport/src/libio_init.c b/cpukit/libcsupport/src/libio_init.c index 9e767c58b0..3496b59b5e 100644 --- a/cpukit/libcsupport/src/libio_init.c +++ b/cpukit/libcsupport/src/libio_init.c @@ -1,8 +1,11 @@ -/* - * 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. +/** + * @file * + * @brief RTEMS LibIO Initialization + * @ingroup LibIO + */ + +/* * COPYRIGHT (c) 1989-2010. * On-Line Applications Research Corporation (OAR). * @@ -38,12 +41,6 @@ rtems_id rtems_libio_semaphore; rtems_libio_t *rtems_libio_iops; rtems_libio_t *rtems_libio_iop_freelist; -/* - * rtems_libio_init - * - * Called by BSP startup code to initialize the libio subsystem. - */ - void rtems_libio_init( void ) { rtems_status_code rc; diff --git a/cpukit/libcsupport/src/malloc_dirtier.c b/cpukit/libcsupport/src/malloc_dirtier.c index 122c230c08..68ad153d49 100644 --- a/cpukit/libcsupport/src/malloc_dirtier.c +++ b/cpukit/libcsupport/src/malloc_dirtier.c @@ -1,6 +1,11 @@ -/* - * RTEMS Malloc Family -- Dirty Memory from Malloc +/** + * @file * + * @brief Dirty Memory Function + * @ingroup MallocSupport + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/libcsupport/src/malloc_get_statistics.c b/cpukit/libcsupport/src/malloc_get_statistics.c index 0d9269d7a4..187d5ceea1 100644 --- a/cpukit/libcsupport/src/malloc_get_statistics.c +++ b/cpukit/libcsupport/src/malloc_get_statistics.c @@ -1,6 +1,11 @@ -/* - * malloc_get_statistics Implementation +/** + * @file * + * @brief Print Malloc Statistic Usage Report + * @ingroup MallocSupport + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/libcsupport/src/mallocfreespace.c b/cpukit/libcsupport/src/mallocfreespace.c index c67896dbb2..2b262ca272 100644 --- a/cpukit/libcsupport/src/mallocfreespace.c +++ b/cpukit/libcsupport/src/mallocfreespace.c @@ -1,7 +1,11 @@ -/* - * RTEMS Malloc Get Free Information - * +/** + * @file * + * @brief RTEMS Malloc Get Free Information + * @ingroup libcsupport + */ + +/* * COPYRIGHT (c) 1989-2010. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/libcsupport/src/readv.c b/cpukit/libcsupport/src/readv.c index 4e540d5da4..2ff7f63767 100644 --- a/cpukit/libcsupport/src/readv.c +++ b/cpukit/libcsupport/src/readv.c @@ -1,10 +1,11 @@ -/* - * readv() - POSIX 1003.1 - Read a Vector - * - * OpenGroup URL: - * - * http://www.opengroup.org/onlinepubs/009695399/functions/readv.html +/** + * @file * + * @brief Read a Vector + * @ingroup libcsupport + */ + +/* * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * @@ -23,6 +24,13 @@ #include #include +/** + * readv() - POSIX 1003.1 - Read a Vector + * + * OpenGroup URL: + * + * http://www.opengroup.org/onlinepubs/009695399/functions/readv.html + */ ssize_t readv( int fd, const struct iovec *iov, diff --git a/cpukit/libcsupport/src/setsid.c b/cpukit/libcsupport/src/setsid.c index e77179d64f..f86b9e2b6a 100644 --- a/cpukit/libcsupport/src/setsid.c +++ b/cpukit/libcsupport/src/setsid.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Create Session and Set Process Group ID + * @ingroup libcsupport + */ + #if HAVE_CONFIG_H #include "config.h" #endif @@ -6,10 +13,9 @@ #include -/* +/** * 4.3.2 Create Session and Set Process Group ID, P1003.1b-1993, p. 88 */ - pid_t setsid( void ) { rtems_set_errno_and_return_minus_one( EPERM ); diff --git a/cpukit/libcsupport/src/stat.c b/cpukit/libcsupport/src/stat.c index 06c3a22b52..e75fdca171 100644 --- a/cpukit/libcsupport/src/stat.c +++ b/cpukit/libcsupport/src/stat.c @@ -1,8 +1,11 @@ -/* - * stat() - POSIX 1003.1b 5.6.2 - Get File Status - * - * Reused from lstat(). +/** + * @file * + * @brief Get File Status + * @ingroup libcsupport + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * @@ -31,6 +34,11 @@ #include +/** + * POSIX 1003.1b 5.6.2 - Get File Status + * + * Reused from lstat(). + */ int _STAT_NAME( const char *path, struct stat *buf ) { int rv = 0; @@ -48,16 +56,13 @@ int _STAT_NAME( const char *path, struct stat *buf ) return rv; } -/* - * _stat_r, _lstat_r - * - * This is the Newlib dependent reentrant version of stat() and lstat(). - */ - #if defined(RTEMS_NEWLIB) #include +/** + * This is the Newlib dependent reentrant version of stat() and lstat(). + */ int _STAT_R_NAME( struct _reent *ptr __attribute__((unused)), const char *path, diff --git a/cpukit/libcsupport/src/sup_fs_check_permissions.c b/cpukit/libcsupport/src/sup_fs_check_permissions.c index 85d237cce6..1bcc5d918e 100644 --- a/cpukit/libcsupport/src/sup_fs_check_permissions.c +++ b/cpukit/libcsupport/src/sup_fs_check_permissions.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief RTEMS File System Permissions Check Support + * @ingroup LibIOInternal + */ + /* * Copyright (c) 2012 embedded brains GmbH. All rights reserved. * diff --git a/cpukit/libcsupport/src/sup_fs_location.c b/cpukit/libcsupport/src/sup_fs_location.c index 8bf0374323..2ce514549e 100644 --- a/cpukit/libcsupport/src/sup_fs_location.c +++ b/cpukit/libcsupport/src/sup_fs_location.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief RTEMS File System Location Support + * @ingroup LibIOInternal + */ + /* * Copyright (c) 2012 embedded brains GmbH. All rights reserved. * diff --git a/cpukit/libcsupport/src/termios_setinitialbaud.c b/cpukit/libcsupport/src/termios_setinitialbaud.c index 072a7bda24..cba49b4590 100644 --- a/cpukit/libcsupport/src/termios_setinitialbaud.c +++ b/cpukit/libcsupport/src/termios_setinitialbaud.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Sets the Initial Baud in the Termios Context + * @ingroup TermiostypesSupport + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/libcsupport/src/ttyname.c b/cpukit/libcsupport/src/ttyname.c index 2e76597d96..f136e89a17 100644 --- a/cpukit/libcsupport/src/ttyname.c +++ b/cpukit/libcsupport/src/ttyname.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Demetermine Terminal Device Name + * @ingroup libcsupport + */ + /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -54,7 +61,7 @@ static char ttyname_buf[sizeof (_PATH_DEV) + MAXNAMLEN]; -/* +/** * ttyname_r() - POSIX 1003.1b 4.7.2 - Demetermine Terminal Device Name */ int ttyname_r( @@ -99,10 +106,9 @@ int ttyname_r( return 0; } -/* +/** * ttyname() - POSIX 1003.1b 4.7.2 - Determine Terminal Device Name */ - char *ttyname( int fd ) diff --git a/cpukit/libcsupport/src/utime.c b/cpukit/libcsupport/src/utime.c index 0f65397166..0b60de6013 100644 --- a/cpukit/libcsupport/src/utime.c +++ b/cpukit/libcsupport/src/utime.c @@ -1,6 +1,11 @@ -/* - * utime() - POSIX 1003.1b 5.5.6 - Set File Access and Modification Times +/** + * @file * + * @brief Set File Access and Modification Times + * @ingroup libcsupport + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * @@ -20,6 +25,9 @@ #include +/** + * POSIX 1003.1b 5.5.6 - Set File Access and Modification Times + */ int utime( const char *path, const struct utimbuf *times ) { int rv = 0; -- cgit v1.2.3 From e43f4758af5414a28f82c8178f2b53d23031376a Mon Sep 17 00:00:00 2001 From: Alex Ivanov Date: Sat, 15 Dec 2012 07:25:05 -0500 Subject: posix: Doxygen Enhancement Task #1 http://www.google-melange.com/gci/task/view/google/gci2012/7987220 --- cpukit/posix/include/mqueue.h | 26 +++++++++++++++++++--- cpukit/posix/include/rtems/posix/mutex.h | 16 ++++++++++++-- cpukit/posix/include/rtems/posix/priority.h | 10 +++++++++ cpukit/posix/include/rtems/posix/psignalimpl.h | 11 ++++++++++ cpukit/posix/include/rtems/posix/rwlock.h | 10 ++++++++- cpukit/posix/include/semaphore.h | 23 +++++++++++++++----- cpukit/posix/src/adjtime.c | 16 ++++++++------ cpukit/posix/src/condattrgetpshared.c | 10 +++++++-- cpukit/posix/src/conddestroy.c | 10 +++++++-- cpukit/posix/src/condsignal.c | 10 +++++++-- cpukit/posix/src/execve.c | 12 +++++++++-- cpukit/posix/src/keycreate.c | 10 +++++++-- cpukit/posix/src/mqueuereceive.c | 25 ++++++--------------- cpukit/posix/src/mqueuetimedsend.c | 21 ++++-------------- cpukit/posix/src/mutexattrsettype.c | 7 ++++++ cpukit/posix/src/mutextranslatereturncode.c | 20 ++++++----------- cpukit/posix/src/prwlockdestroy.c | 22 +++++++++---------- cpukit/posix/src/prwlocktranslatereturncode.c | 20 ++++++----------- cpukit/posix/src/psignalchecksignal.c | 12 ++++++----- cpukit/posix/src/pspinlock.c | 25 ++++++++++----------- cpukit/posix/src/psxpriorityisvalid.c | 7 ++++++ cpukit/posix/src/pthreadatfork.c | 30 ++++++++++++++++---------- cpukit/posix/src/pthreadattrgetschedpolicy.c | 12 +++++++++-- cpukit/posix/src/semdestroy.c | 11 ++++++---- cpukit/posix/src/sempost.c | 11 ++++++---- cpukit/posix/src/semwait.c | 13 +++++------ 26 files changed, 256 insertions(+), 144 deletions(-) diff --git a/cpukit/posix/include/mqueue.h b/cpukit/posix/include/mqueue.h index 56a97a0c7a..f41866bfe5 100644 --- a/cpukit/posix/include/mqueue.h +++ b/cpukit/posix/include/mqueue.h @@ -2,6 +2,18 @@ * @file mqueue.h * * This file contains the definitions related to POSIX Message Queues. + * + * The structure of the routines is identical to that of POSIX + * Message_queues to leave the option of having unnamed message + * queues at a future date. They are currently not part of the + * POSIX standard but unnamed message_queues are. This is also + * the reason for the apparently unnecessary tracking of + * the process_shared attribute. [In addition to the fact that + * it would be trivial to add pshared to the mq_attr structure + * and have process private message queues.] + * + * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open + * time. */ /* @@ -115,6 +127,13 @@ int mq_send( #include +/** + * @brief Send a Message to a Message Queue + * + * 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277 + * + * @note P1003.4b/D8, p. 45 adds mq_timedsend(). + */ int mq_timedsend( mqd_t mqdes, const char *msg_ptr, @@ -125,12 +144,13 @@ int mq_timedsend( #endif /* _POSIX_TIMEOUTS */ -/* +/** + * @brief Receive a Message From a Message Queue + * * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279 * - * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive(). + * @note P1003.4b/D8, p. 45 adds mq_timedreceive(). */ - ssize_t mq_receive( mqd_t mqdes, char *msg_ptr, diff --git a/cpukit/posix/include/rtems/posix/mutex.h b/cpukit/posix/include/rtems/posix/mutex.h index dc133d5421..0d73022f95 100644 --- a/cpukit/posix/include/rtems/posix/mutex.h +++ b/cpukit/posix/include/rtems/posix/mutex.h @@ -21,6 +21,14 @@ extern "C" { #endif +/** + * @defgroup POSIX_MUTEX POSIX Mutex Support + * + * @ingroup POSIX + * + * @brief Private Support Information for POSIX Mutex + */ + #include #include @@ -129,13 +137,17 @@ int _POSIX_Mutex_Lock_support( Watchdog_Interval timeout ); -/* - * _POSIX_Mutex_Translate_core_mutex_return_code +/** + * @brief POSIX Mutex Translate Core Mutex Return Code * * DESCRIPTION: * * A support routine which converts core mutex status codes into the * appropriate POSIX status values. + * + * @param[in] the_mutex_status is the mutex status code to translate + * + * @return the translated POSIX status code */ int _POSIX_Mutex_Translate_core_mutex_return_code( diff --git a/cpukit/posix/include/rtems/posix/priority.h b/cpukit/posix/include/rtems/posix/priority.h index 62ec9fbe2d..a6a3c289da 100644 --- a/cpukit/posix/include/rtems/posix/priority.h +++ b/cpukit/posix/include/rtems/posix/priority.h @@ -17,6 +17,14 @@ #ifndef _RTEMS_POSIX_PRIORITY_H #define _RTEMS_POSIX_PRIORITY_H +/** + * @defgroup POSIX_PRIORITY POSIX Priority Support + * + * @ingroup POSIX + * + * @brief Interface to the POSIX Priority Implementation + */ + #include /** @@ -44,6 +52,8 @@ #define POSIX_SCHEDULER_MINIMUM_PRIORITY (1) /** + * @brief POSIX Is Priority Valid + * * 1003.1b-1993,2.2.2.80 definition of priority, p. 19 * * "Numerically higher values represent higher priorities." diff --git a/cpukit/posix/include/rtems/posix/psignalimpl.h b/cpukit/posix/include/rtems/posix/psignalimpl.h index 6c46f3c49c..d9ba88427a 100644 --- a/cpukit/posix/include/rtems/posix/psignalimpl.h +++ b/cpukit/posix/include/rtems/posix/psignalimpl.h @@ -16,6 +16,14 @@ #ifndef _RTEMS_POSIX_PSIGNALIMPL_H #define _RTEMS_POSIX_PSIGNALIMPL_H +/** + * @defgroup POSIX_SIGNALS POSIX Signals Support + * + * @ingroup POSIX + * + * @brief Internal Information about POSIX Signals + */ + #include #include #include @@ -76,6 +84,9 @@ bool _POSIX_signals_Unblock_thread( siginfo_t *info ); +/** + * @brief POSIX Signals Check Signal + */ bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, diff --git a/cpukit/posix/include/rtems/posix/rwlock.h b/cpukit/posix/include/rtems/posix/rwlock.h index c4f2d7e146..411384c2c6 100644 --- a/cpukit/posix/include/rtems/posix/rwlock.h +++ b/cpukit/posix/include/rtems/posix/rwlock.h @@ -27,6 +27,14 @@ extern "C" { #endif +/** + * @defgroup POSIX_RWLOCK POSIX RWLock Manager + * + * @ingroup POSIX + * + * @brief Constants and Structures Associated with the POSIX RWLock Manager + */ + #include #include @@ -60,7 +68,7 @@ POSIX_EXTERN Objects_Information _POSIX_RWLock_Information; void _POSIX_RWLock_Manager_initialization(void); /** - * @brief _POSIX_RWLock_Translate_core_RWLock_return_code ( + * @brief POSIX RWLock Translate Core RWLock Return Code * * This routine translates SuperCore RWLock status codes into the * corresponding POSIX ones. diff --git a/cpukit/posix/include/semaphore.h b/cpukit/posix/include/semaphore.h index 91722006ce..1dc82bedef 100644 --- a/cpukit/posix/include/semaphore.h +++ b/cpukit/posix/include/semaphore.h @@ -21,6 +21,14 @@ extern "C" { #endif +/** + * @defgroup POSIX_SEMAPHORE POSIX Semaphores Support + * + * @ingroup POSIX + * + * @brief Private Support Information for POSIX Semaphores + */ + #include #if defined(_POSIX_SEMAPHORES) @@ -46,7 +54,9 @@ int sem_init( unsigned int value ); -/* +/** + * @brief Destroy an Unnamed Semaphore + * * 11.2.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220 */ int sem_destroy( @@ -78,10 +88,12 @@ int sem_unlink( const char *name ); -/* +/** + * @brief Lock a Semaphore + * * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226 * - * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27 + * @note P1003.4b/D8 adds sem_timedwait(), p. 27 */ int sem_wait( sem_t *sem @@ -98,10 +110,11 @@ int sem_timedwait( ); #endif -/* +/** + * @brief Unlock a Semaphore + * * 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227 */ - int sem_post( sem_t *sem ); diff --git a/cpukit/posix/src/adjtime.c b/cpukit/posix/src/adjtime.c index db88c923e1..23f7d3a9ed 100644 --- a/cpukit/posix/src/adjtime.c +++ b/cpukit/posix/src/adjtime.c @@ -1,9 +1,8 @@ -/* - * adjime() function +/** + * @file * - * This method was initially added as part of porting NTP to RTEMS. - * It is a BSD compatability function and now is available on - * GNU/Linux. + * @brief Correct the Time to Synchronize the System Clock + * @ingroup POSIX */ /* @@ -31,12 +30,15 @@ #include #include -/* +/** + * This method was initially added as part of porting NTP to RTEMS. + * It is a BSD compatability function and now is available on + * GNU/Linux. + * * At one point there was a static variable named adjustment * used by this implementation. I don't see any reason for it * to be here based upon the GNU/Linux documentation. */ - int adjtime( const struct timeval *delta, struct timeval *olddelta diff --git a/cpukit/posix/src/condattrgetpshared.c b/cpukit/posix/src/condattrgetpshared.c index a35f85e414..298c2618b3 100644 --- a/cpukit/posix/src/condattrgetpshared.c +++ b/cpukit/posix/src/condattrgetpshared.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Get the Process-Shared Condition Variable Attributes + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -22,11 +29,10 @@ #include #include -/* +/** * 11.4.1 Condition Variable Initialization Attributes, * P1003.1c/Draft 10, p. 96 */ - int pthread_condattr_getpshared( const pthread_condattr_t *attr, int *pshared diff --git a/cpukit/posix/src/conddestroy.c b/cpukit/posix/src/conddestroy.c index 905fb1ecca..0f32b89da3 100644 --- a/cpukit/posix/src/conddestroy.c +++ b/cpukit/posix/src/conddestroy.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Destroy a Condition Variable + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -22,11 +29,10 @@ #include #include -/* +/** * 11.4.2 Initializing and Destroying a Condition Variable, * P1003.1c/Draft 10, p. 87 */ - int pthread_cond_destroy( pthread_cond_t *cond ) diff --git a/cpukit/posix/src/condsignal.c b/cpukit/posix/src/condsignal.c index 8b5c2c90c4..debc110143 100644 --- a/cpukit/posix/src/condsignal.c +++ b/cpukit/posix/src/condsignal.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Signal a Condition + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -22,10 +29,9 @@ #include #include -/* +/** * 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101 */ - int pthread_cond_signal( pthread_cond_t *cond ) diff --git a/cpukit/posix/src/execve.c b/cpukit/posix/src/execve.c index c6f6ede19b..03320e52a0 100644 --- a/cpukit/posix/src/execve.c +++ b/cpukit/posix/src/execve.c @@ -1,6 +1,11 @@ -/* - * execve() - POSIX 1003.1b 3.1.2 +/** + * @file * + * @brief Execute a Program + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -18,6 +23,9 @@ #include #include +/** + * POSIX 1003.1b 3.1.2 + */ int execve( const char *path, char *const argv[], diff --git a/cpukit/posix/src/keycreate.c b/cpukit/posix/src/keycreate.c index 493b6fb278..3ac462dbcb 100644 --- a/cpukit/posix/src/keycreate.c +++ b/cpukit/posix/src/keycreate.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Thread-Specific Data Key Create + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2010. * On-Line Applications Research Corporation (OAR). @@ -21,10 +28,9 @@ #include #include -/* +/** * 17.1.1 Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 */ - int pthread_key_create( pthread_key_t *key, void (*destructor)( void * ) diff --git a/cpukit/posix/src/mqueuereceive.c b/cpukit/posix/src/mqueuereceive.c index 44defc250f..c5f9257747 100644 --- a/cpukit/posix/src/mqueuereceive.c +++ b/cpukit/posix/src/mqueuereceive.c @@ -1,16 +1,11 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. +/** + * @file * + * @brief Receive a Message From a Message Queue + * @ingroup POSIX_MQUEUE + */ + +/* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * @@ -37,12 +32,6 @@ #include #include -/* - * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279 - * - * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive(). - */ - ssize_t mq_receive( mqd_t mqdes, char *msg_ptr, diff --git a/cpukit/posix/src/mqueuetimedsend.c b/cpukit/posix/src/mqueuetimedsend.c index f06197fa79..da7e0e1058 100644 --- a/cpukit/posix/src/mqueuetimedsend.c +++ b/cpukit/posix/src/mqueuetimedsend.c @@ -1,15 +1,8 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] +/** + * @file * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. + * @brief Send a Message to a Message Queue + * @ingroup POSIX_MQUEUE */ /* @@ -39,12 +32,6 @@ #include #include -/* - * 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277 - * - * NOTE: P1003.4b/D8, p. 45 adds mq_timedsend(). - */ - int mq_timedsend( mqd_t mqdes, const char *msg_ptr, diff --git a/cpukit/posix/src/mutexattrsettype.c b/cpukit/posix/src/mutexattrsettype.c index a005747718..861e616ad3 100644 --- a/cpukit/posix/src/mutexattrsettype.c +++ b/cpukit/posix/src/mutexattrsettype.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Set a Mutex Type + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/mutextranslatereturncode.c b/cpukit/posix/src/mutextranslatereturncode.c index 53b5b0ee00..8c2d9af8ce 100644 --- a/cpukit/posix/src/mutextranslatereturncode.c +++ b/cpukit/posix/src/mutextranslatereturncode.c @@ -1,6 +1,11 @@ -/* - * POSIX Mutex Error Translation +/** + * @file * + * @brief POSIX Mutex Translate Core Mutex Return Code + * @ingroup POSIX_MUTEX + */ + +/* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * @@ -20,17 +25,6 @@ #include #include -/* - * _POSIX_Mutex_Translate_core_mutex_return_code - * - * Input parameters: - * the_mutex_status - mutex status code to translate - * - * Output parameters: - * status code - translated POSIX status code - * - */ - static int _POSIX_Mutex_Return_codes[CORE_MUTEX_STATUS_LAST + 1] = { 0, /* CORE_MUTEX_STATUS_SUCCESSFUL */ EBUSY, /* CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT */ diff --git a/cpukit/posix/src/prwlockdestroy.c b/cpukit/posix/src/prwlockdestroy.c index 684e173e18..9b644ba943 100644 --- a/cpukit/posix/src/prwlockdestroy.c +++ b/cpukit/posix/src/prwlockdestroy.c @@ -1,6 +1,10 @@ -/* - * POSIX RWLock Manager -- Destroy a RWLock +/** + * @file * + * @brief Destroy a RWLock + * @ingroup POSIX + */ +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -19,21 +23,17 @@ #include #include -/* - * pthread_rwlock_destroy - * +/** * This directive allows a thread to delete a rwlock specified by * the rwlock id. The rwlock is freed back to the inactive * rwlock chain. * - * Input parameters: - * rwlock - rwlock id + * @param[in] rwlock is the rwlock id * - * Output parameters: - * 0 - if successful - * error code - if unsuccessful + * @return This method returns 0 if there was not an + * error. Otherwise, a status code is returned indicating the + * source of the error. */ - int pthread_rwlock_destroy( pthread_rwlock_t *rwlock ) diff --git a/cpukit/posix/src/prwlocktranslatereturncode.c b/cpukit/posix/src/prwlocktranslatereturncode.c index 3c75e10aa4..48be176d36 100644 --- a/cpukit/posix/src/prwlocktranslatereturncode.c +++ b/cpukit/posix/src/prwlocktranslatereturncode.c @@ -1,6 +1,11 @@ -/* - * RWLock Manager -- Translate SuperCore Status +/** + * @file * + * @brief POSIX RWLock Translate Core RWLock Return Code + * @ingroup POSIX_RWLOCK + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -19,17 +24,6 @@ #include #include -/* - * _POSIX_RWLock_Translate_core_rwlock_return_code - * - * Input parameters: - * the_rwlock_status - rwlock status code to translate - * - * Output parameters: - * status code - translated POSIX status code - * - */ - static int _POSIX_RWLock_Return_codes[CORE_RWLOCK_STATUS_LAST + 1] = { 0, /* CORE_RWLOCK_SUCCESSFUL */ EINVAL, /* CORE_RWLOCK_DELETED */ diff --git a/cpukit/posix/src/psignalchecksignal.c b/cpukit/posix/src/psignalchecksignal.c index 171d7c8121..57237d3055 100644 --- a/cpukit/posix/src/psignalchecksignal.c +++ b/cpukit/posix/src/psignalchecksignal.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Signals Check Signal + * @ingroup POSIX_SIGNALS + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -31,11 +38,6 @@ #include #include - -/* - * _POSIX_signals_Check_signal - */ - bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, diff --git a/cpukit/posix/src/pspinlock.c b/cpukit/posix/src/pspinlock.c index ce1a2bb3c5..7f6793c1d5 100644 --- a/cpukit/posix/src/pspinlock.c +++ b/cpukit/posix/src/pspinlock.c @@ -1,6 +1,11 @@ -/* - * POSIX Spinlock Manager -- Wait at a Spinlock +/** + * @file * + * @brief Wait at a Spinlock + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -19,19 +24,15 @@ #include #include -/* - * pthread_spin_lock - * +/** * This directive allows a thread to wait at a spinlock. * - * Input parameters: - * spinlock - spinlock id - * - * Output parameters: - * 0 - if successful - * error code - if unsuccessful + * @param[in] spinlock is spinlock id + * + * @return This method returns 0 if there was not an + * error. Otherwise, a status code is returned indicating the + * source of the error. */ - int pthread_spin_lock( pthread_spinlock_t *spinlock ) diff --git a/cpukit/posix/src/psxpriorityisvalid.c b/cpukit/posix/src/psxpriorityisvalid.c index 3ef7a1ec26..eda424e420 100644 --- a/cpukit/posix/src/psxpriorityisvalid.c +++ b/cpukit/posix/src/psxpriorityisvalid.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Is Priority Valid + * @ingroup POSIX_PRIORITY + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/pthreadatfork.c b/cpukit/posix/src/pthreadatfork.c index 767f113d0c..558bc77555 100644 --- a/cpukit/posix/src/pthreadatfork.c +++ b/cpukit/posix/src/pthreadatfork.c @@ -1,15 +1,11 @@ -/* - * pthread_atfork() - POSIX 1003.1b 3.1.3 - * - * 3.1.3 Register Fork Handlers, P1003.1c/Draft 10, P1003.1c/Draft 10, p. 27 - * - * RTEMS does not support processes, so we fall under this and do not - * provide this routine: - * - * "Either the implementation shall support the pthread_atfork() function - * as described above or the pthread_atfork() funciton shall not be - * provided." +/** + * @file * + * @brief Register Fork Handlers + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -27,6 +23,18 @@ #include #include +/** + * POSIX 1003.1b 3.1.3 + * + * 3.1.3 Register Fork Handlers, P1003.1c/Draft 10, P1003.1c/Draft 10, p. 27 + * + * RTEMS does not support processes, so we fall under this and do not + * provide this routine: + * + * "Either the implementation shall support the pthread_atfork() function + * as described above or the pthread_atfork() funciton shall not be + * provided." + */ int pthread_atfork( void (*prepare)(void) __attribute__((unused)), void (*parent)(void) __attribute__((unused)), diff --git a/cpukit/posix/src/pthreadattrgetschedpolicy.c b/cpukit/posix/src/pthreadattrgetschedpolicy.c index 1a79711fb2..6b57e8a2ca 100644 --- a/cpukit/posix/src/pthreadattrgetschedpolicy.c +++ b/cpukit/posix/src/pthreadattrgetschedpolicy.c @@ -1,6 +1,11 @@ -/* - * 13.5.1 Thread Creation Scheduling Parameters, P1003.1c/Draft 10, p. 120 +/** + * @file * + * @brief Get The Schedpolicy Attribute + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * @@ -16,6 +21,9 @@ #include #include +/** + * 13.5.1 Thread Creation Scheduling Parameters, P1003.1c/Draft 10, p. 120 + */ int pthread_attr_getschedpolicy( const pthread_attr_t *attr, int *policy diff --git a/cpukit/posix/src/semdestroy.c b/cpukit/posix/src/semdestroy.c index b2a03f5ff7..14ba520fa3 100644 --- a/cpukit/posix/src/semdestroy.c +++ b/cpukit/posix/src/semdestroy.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Destroy an Unnamed Semaphore + * @ingroup POSIX_SEMAPHORE + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -25,10 +32,6 @@ #include #include -/* - * 11.2.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220 - */ - int sem_destroy( sem_t *sem ) diff --git a/cpukit/posix/src/sempost.c b/cpukit/posix/src/sempost.c index e1d6221ad7..7ce367986f 100644 --- a/cpukit/posix/src/sempost.c +++ b/cpukit/posix/src/sempost.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Unlock a Semaphore + * @ingroup POSIX_SEMAPHORE + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -25,10 +32,6 @@ #include #include -/* - * 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227 - */ - int sem_post( sem_t *sem ) diff --git a/cpukit/posix/src/semwait.c b/cpukit/posix/src/semwait.c index 32b896a4df..16fc9076d4 100644 --- a/cpukit/posix/src/semwait.c +++ b/cpukit/posix/src/semwait.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Lock a Semaphore + * @ingroup POSIX_SEMAPHORE + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). @@ -25,12 +32,6 @@ #include #include -/* - * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226 - * - * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27 - */ - int sem_wait( sem_t *sem ) -- cgit v1.2.3 From e79a766fb320e43b6846c96ba9933c67a63deefd Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Sat, 15 Dec 2012 07:26:34 -0500 Subject: libcsupport: Update file header for termios.h to remove link, add description. --- cpukit/libcsupport/include/sys/termios.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpukit/libcsupport/include/sys/termios.h b/cpukit/libcsupport/include/sys/termios.h index 8fd46b1cbc..1046eb8c87 100644 --- a/cpukit/libcsupport/include/sys/termios.h +++ b/cpukit/libcsupport/include/sys/termios.h @@ -3,7 +3,9 @@ * * @brief POSIX termios implementation for RTEMS console device driver. * - * http://pubs.opengroup.org/onlinepubs/009604599/basedefs/termios.h.html + * The Open Group Base Specifications Issue 6 + * IEEE Std 1003.1, 2004 Edition + * Chapter 11, General Terminal Interface */ /* -- cgit v1.2.3 From e49a36cb0b37cc3ad1c3f191fb439b17f6365539 Mon Sep 17 00:00:00 2001 From: Alex Ivanov Date: Sat, 15 Dec 2012 09:54:10 -0500 Subject: posix: Doxygen Enhancement Task #5 http://www.google-melange.com/gci/task/view/google/gci2012/7959229 --- cpukit/posix/include/aio.h | 20 ++++++++++++++++++-- cpukit/posix/include/rtems/posix/mqueue.h | 21 ++++++++++++++++++--- cpukit/posix/include/rtems/posix/psignalimpl.h | 6 ++++++ cpukit/posix/include/rtems/posix/ptimer.h | 12 +++++++----- cpukit/posix/include/rtems/posix/semaphore.h | 9 ++++++--- cpukit/posix/include/rtems/posix/spinlock.h | 10 +++++++++- cpukit/posix/include/semaphore.h | 5 +++++ cpukit/posix/src/aio_cancel.c | 24 +++++++----------------- cpukit/posix/src/barrierattrinit.c | 11 +++++++---- cpukit/posix/src/barrierattrsetpshared.c | 11 +++++++---- cpukit/posix/src/condbroadcast.c | 10 ++++++++-- cpukit/posix/src/condinit.c | 10 ++++++++-- cpukit/posix/src/execle.c | 9 +++++++-- cpukit/posix/src/mqueuedeletesupp.c | 23 +++++++---------------- cpukit/posix/src/mutexattrinit.c | 10 ++++++++-- cpukit/posix/src/pbarrierdestroy.c | 25 +++++++++++++------------ cpukit/posix/src/psignal.c | 11 +++++++---- cpukit/posix/src/psignalsetprocesssignals.c | 11 +++++++---- cpukit/posix/src/pspindestroy.c | 23 ++++++++++++----------- cpukit/posix/src/pspinlocktranslatereturncode.c | 20 +++++++------------- cpukit/posix/src/rwlockattrgetpshared.c | 11 +++++++---- cpukit/posix/src/sched_getprioritymin.c | 12 ++++++++++-- cpukit/posix/src/semaphoredeletesupp.c | 11 +++++++---- cpukit/posix/src/semtrywait.c | 13 +++++++------ cpukit/posix/src/sigtimedwait.c | 12 ++++++++++-- cpukit/posix/src/timergetoverrun.c | 16 +++++++--------- cpukit/posix/src/waitpid.c | 9 +++++++-- 27 files changed, 229 insertions(+), 136 deletions(-) diff --git a/cpukit/posix/include/aio.h b/cpukit/posix/include/aio.h index de0bdd5603..f4f824ab69 100644 --- a/cpukit/posix/include/aio.h +++ b/cpukit/posix/include/aio.h @@ -23,6 +23,14 @@ extern "C" { #endif +/** + * @defgroup POSIX_AIO POSIX Asynchronous I/O Support + * + * @ingroup POSIX + * + * @brief POSIX Asynchronous Input and Output + */ + #if defined(_POSIX_ASYNCHRONOUS_IO) /* @@ -126,10 +134,18 @@ ssize_t aio_return( const struct aiocb *aiocbp ); -/* +/** + * @brief Cancel Asynchronous I/O Operation + * * 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163 + * + * @param[in] filedes is the file descriptor + * @param[in] aiocbp is the asynchronous I/O control block + * + * @return This method returns AIO_CANCELED if the requested operation(s) + * were canceled. Otherwise, AIO_NOTCANCELED is returned indicating + * that at least one of the requested operation(s) cannot be canceled */ - int aio_cancel( int filedes, struct aiocb *aiocbp diff --git a/cpukit/posix/include/rtems/posix/mqueue.h b/cpukit/posix/include/rtems/posix/mqueue.h index ea94669e71..9226d6f86e 100644 --- a/cpukit/posix/include/rtems/posix/mqueue.h +++ b/cpukit/posix/include/rtems/posix/mqueue.h @@ -3,6 +3,18 @@ * * This include file contains all the private support information for * POSIX Message Queues. + * + * The structure of the routines is identical to that of POSIX + * Message_queues to leave the option of having unnamed message + * queues at a future date. They are currently not part of the + * POSIX standard but unnamed message_queues are. This is also + * the reason for the apparently unnecessary tracking of + * the process_shared attribute. [In addition to the fact that + * it would be trivial to add pshared to the mq_attr structure + * and have process private message queues.] + * + * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open + * time. */ /* @@ -27,6 +39,10 @@ extern "C" { #endif +/** + * @ingroup POSIX_MQUEUE + */ + /* * Data Structure used to manage a POSIX message queue */ @@ -84,15 +100,14 @@ int _POSIX_Message_queue_Create_support( POSIX_Message_queue_Control **message_queue ); -/* - * _POSIX_Message_queue_Delete +/** + * @brief POSIX Delete Message Queue * * DESCRIPTION: * * This routine supports the mq_unlink and mq_close routines by * doing most of the work involved with removing a message queue. */ - void _POSIX_Message_queue_Delete( POSIX_Message_queue_Control *the_mq ); diff --git a/cpukit/posix/include/rtems/posix/psignalimpl.h b/cpukit/posix/include/rtems/posix/psignalimpl.h index d9ba88427a..b8e5e1e0ea 100644 --- a/cpukit/posix/include/rtems/posix/psignalimpl.h +++ b/cpukit/posix/include/rtems/posix/psignalimpl.h @@ -71,6 +71,9 @@ extern API_extensions_Post_switch_control _POSIX_signals_Post_switch; * Internal routines */ +/** + * @brief POSIX Signals Manager Initialization + */ void _POSIX_signals_Manager_Initialization(void); static inline void _POSIX_signals_Add_post_switch_extension(void) @@ -107,6 +110,9 @@ int killinfo( const union sigval *value ); +/** + * @brief POSIX Signals Set Process Signals + */ void _POSIX_signals_Set_process_signals( sigset_t mask ); diff --git a/cpukit/posix/include/rtems/posix/ptimer.h b/cpukit/posix/include/rtems/posix/ptimer.h index a7c083711a..1b791cc915 100644 --- a/cpukit/posix/include/rtems/posix/ptimer.h +++ b/cpukit/posix/include/rtems/posix/ptimer.h @@ -88,13 +88,15 @@ int timer_gettime( struct itimerspec *value ); -/* +/** + * @brief Get Overrun Count for a POSIX Per-Process Timer + * + * The expiration of a timer must increase by one a counter. + * After the signal handler associated to the timer finishes + * its execution, _POSIX_Timer_TSR will have to set this counter to 0. + * * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 - * - * timer_getoverrun - * */ - int timer_getoverrun( timer_t timerid ); diff --git a/cpukit/posix/include/rtems/posix/semaphore.h b/cpukit/posix/include/rtems/posix/semaphore.h index 08df44be4f..378b284c42 100644 --- a/cpukit/posix/include/rtems/posix/semaphore.h +++ b/cpukit/posix/include/rtems/posix/semaphore.h @@ -21,6 +21,10 @@ extern "C" { #endif +/** + * @ingroup POSIX_SEMAPHORE + */ + #include #include #include @@ -134,14 +138,13 @@ int _POSIX_Semaphore_Create_support( POSIX_Semaphore_Control **the_sem ); -/* - * _POSIX_Semaphore_Delete +/** + * @brief POSIX Delete Semaphore * * DESCRIPTION: * * This routine supports the sem_close and sem_unlink routines. */ - void _POSIX_Semaphore_Delete( POSIX_Semaphore_Control *the_semaphore ); diff --git a/cpukit/posix/include/rtems/posix/spinlock.h b/cpukit/posix/include/rtems/posix/spinlock.h index 892040e8b8..44061bd42c 100644 --- a/cpukit/posix/include/rtems/posix/spinlock.h +++ b/cpukit/posix/include/rtems/posix/spinlock.h @@ -27,6 +27,14 @@ extern "C" { #endif +/** + * @defgroup POSIX_SPINLOCK POSIX Spinlock Support + * + * @ingroup POSIX + * + * @brief Constants and Structures Associated with the POSIX Spinlock Manager + */ + #include #include @@ -60,7 +68,7 @@ POSIX_EXTERN Objects_Information _POSIX_Spinlock_Information; void _POSIX_Spinlock_Manager_initialization(void); /** - * @brief _POSIX_Spinlock_Translate_core_spinlock_return_code ( + * @brief POSIX Spinlock Translate Core Spinlock Return Code * * This routine translates SuperCore Spinlock status codes into the * corresponding POSIX ones. diff --git a/cpukit/posix/include/semaphore.h b/cpukit/posix/include/semaphore.h index 1dc82bedef..17c583240c 100644 --- a/cpukit/posix/include/semaphore.h +++ b/cpukit/posix/include/semaphore.h @@ -99,6 +99,11 @@ int sem_wait( sem_t *sem ); +/** + * @brief Lock a Semaphore + * + * @see sem_wait() + */ int sem_trywait( sem_t *sem ); diff --git a/cpukit/posix/src/aio_cancel.c b/cpukit/posix/src/aio_cancel.c index be771e7c33..561e2f8776 100644 --- a/cpukit/posix/src/aio_cancel.c +++ b/cpukit/posix/src/aio_cancel.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Cancel Asynchronous I/O Operation + * @ingroup POSIX_AIO + */ + /* * Copyright 2010, Alin Rus * @@ -17,23 +24,6 @@ #include #include -/* - * aio_cancel - * - * Cancel an asynchronous I/O request - * - * Input parameters: - * fildes - file descriptor - * aiocbp - asynchronous I/O control block - * - * Output parameters: - * AIO_CANCELED - if the requested operation(s) - * were canceled - * AIO_NOTCANCELED - if at least one of the requested - * operation(s) cannot be canceled - */ - - int aio_cancel(int fildes, struct aiocb *aiocbp) { rtems_aio_request_chain *r_chain; diff --git a/cpukit/posix/src/barrierattrinit.c b/cpukit/posix/src/barrierattrinit.c index 2363e4d3db..29d58f4991 100644 --- a/cpukit/posix/src/barrierattrinit.c +++ b/cpukit/posix/src/barrierattrinit.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Initialize the Barrier Attributes Object + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -16,10 +23,6 @@ #include -/* - * Barrier Attributes Initialization - */ - int pthread_barrierattr_init( pthread_barrierattr_t *attr ) diff --git a/cpukit/posix/src/barrierattrsetpshared.c b/cpukit/posix/src/barrierattrsetpshared.c index df3c8017dd..897a833946 100644 --- a/cpukit/posix/src/barrierattrsetpshared.c +++ b/cpukit/posix/src/barrierattrsetpshared.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Set the Process-Shared Attribute of the Barrier Attributes Object + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -14,10 +21,6 @@ #include #include -/* - * Barrier Attributes Set Process Shared - */ - int pthread_barrierattr_setpshared( pthread_barrierattr_t *attr, int pshared diff --git a/cpukit/posix/src/condbroadcast.c b/cpukit/posix/src/condbroadcast.c index ab2f8713c3..6506d87d98 100644 --- a/cpukit/posix/src/condbroadcast.c +++ b/cpukit/posix/src/condbroadcast.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Broadcast a Condition + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -22,10 +29,9 @@ #include #include -/* +/** * 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101 */ - int pthread_cond_broadcast( pthread_cond_t *cond ) diff --git a/cpukit/posix/src/condinit.c b/cpukit/posix/src/condinit.c index 73f1f5b6b7..2a8321192e 100644 --- a/cpukit/posix/src/condinit.c +++ b/cpukit/posix/src/condinit.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Initialize a Condition Variable + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -22,11 +29,10 @@ #include #include -/* +/** * 11.4.2 Initializing and Destroying a Condition Variable, * P1003.1c/Draft 10, p. 87 */ - int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr diff --git a/cpukit/posix/src/execle.c b/cpukit/posix/src/execle.c index 8199d68c20..1dbd3826a1 100644 --- a/cpukit/posix/src/execle.c +++ b/cpukit/posix/src/execle.c @@ -1,6 +1,11 @@ -/* - * execle() - POSIX 1003.1b 3.1.2 +/** + * @file * + * @brief Execute a File + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/mqueuedeletesupp.c b/cpukit/posix/src/mqueuedeletesupp.c index 3c06a59e8a..1a7246278a 100644 --- a/cpukit/posix/src/mqueuedeletesupp.c +++ b/cpukit/posix/src/mqueuedeletesupp.c @@ -1,16 +1,11 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. +/** + * @file * + * @brief POSIX Delete Message Queue + * @ingroup POSIX_MQUEUE + */ + +/* * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * @@ -41,10 +36,6 @@ #include #endif -/* - * _POSIX_Message_queue_Delete - */ - void _POSIX_Message_queue_Delete( POSIX_Message_queue_Control *the_mq ) diff --git a/cpukit/posix/src/mutexattrinit.c b/cpukit/posix/src/mutexattrinit.c index f2d66010a1..9e1345ee6d 100644 --- a/cpukit/posix/src/mutexattrinit.c +++ b/cpukit/posix/src/mutexattrinit.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Mutex Initialization Attribute + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -21,10 +28,9 @@ #include #include -/* +/** * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 */ - int pthread_mutexattr_init( pthread_mutexattr_t *attr ) diff --git a/cpukit/posix/src/pbarrierdestroy.c b/cpukit/posix/src/pbarrierdestroy.c index a8f6ce3b5e..6b2e9d0bc9 100644 --- a/cpukit/posix/src/pbarrierdestroy.c +++ b/cpukit/posix/src/pbarrierdestroy.c @@ -1,6 +1,11 @@ -/* - * POSIX Barrier Manager -- Destroy a Barrier +/** + * @file * + * @brief Destroy a Barrier Object + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -19,21 +24,17 @@ #include #include -/* - * pthread_barrier_destroy - * +/** * This directive allows a thread to delete a barrier specified by * the barrier id. The barrier is freed back to the inactive * barrier chain. * - * Input parameters: - * barrier - barrier id - * - * Output parameters: - * 0 - if successful - * error code - if unsuccessful + * @param[in] barrier is the barrier id + * + * @return This method returns 0 if there was not an + * error. Otherwise, a status code is returned indicating the + * source of the error. */ - int pthread_barrier_destroy( pthread_barrier_t *barrier ) diff --git a/cpukit/posix/src/psignal.c b/cpukit/posix/src/psignal.c index 7623920f54..e490877d32 100644 --- a/cpukit/posix/src/psignal.c +++ b/cpukit/posix/src/psignal.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Signals Manager Initialization + * @ingroup POSIX_SIGNALS + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). @@ -162,10 +169,6 @@ API_extensions_Post_switch_control _POSIX_signals_Post_switch = { .hook = _POSIX_signals_Post_switch_hook }; -/* - * _POSIX_signals_Manager_Initialization - */ - void _POSIX_signals_Manager_Initialization(void) { uint32_t signo; diff --git a/cpukit/posix/src/psignalsetprocesssignals.c b/cpukit/posix/src/psignalsetprocesssignals.c index 22609bf2af..92c1d8164e 100644 --- a/cpukit/posix/src/psignalsetprocesssignals.c +++ b/cpukit/posix/src/psignalsetprocesssignals.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Signals Set Process Signals + * @ingroup POSIX_SIGNALS + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -27,10 +34,6 @@ #include #include -/* - * _POSIX_signals_Set_process_signals - */ - void _POSIX_signals_Set_process_signals( sigset_t mask ) diff --git a/cpukit/posix/src/pspindestroy.c b/cpukit/posix/src/pspindestroy.c index c5574c0c7b..97745b6b77 100644 --- a/cpukit/posix/src/pspindestroy.c +++ b/cpukit/posix/src/pspindestroy.c @@ -1,6 +1,11 @@ -/* - * POSIX Spinlock Manager -- Destroy a Spinlock +/** + * @file * + * @brief Destroy a Spinlock + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -19,21 +24,17 @@ #include #include -/* - * pthread_spin_destroy - * +/** * This directive allows a thread to delete a spinlock specified by * the spinlock id. The spinlock is freed back to the inactive * spinlock chain. * - * Input parameters: - * spinlock - spinlock id + * @param[in] spinlock is the spinlock id * - * Output parameters: - * 0 - if successful - * error code - if unsuccessful + * @return This method returns 0 if there was not an + * error. Otherwise, a status code is returned indicating the + * source of the error. */ - int pthread_spin_destroy( pthread_spinlock_t *spinlock ) diff --git a/cpukit/posix/src/pspinlocktranslatereturncode.c b/cpukit/posix/src/pspinlocktranslatereturncode.c index 92dca9101a..ce133a40b7 100644 --- a/cpukit/posix/src/pspinlocktranslatereturncode.c +++ b/cpukit/posix/src/pspinlocktranslatereturncode.c @@ -1,6 +1,11 @@ -/* - * Spinlock Manager -- Translate SuperCore Status +/** + * @file * + * @brief POSIX Spinlock Translate Core Spinlock Return Code + * @ingroup POSIX_SPINLOCK + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -20,17 +25,6 @@ #include #include -/* - * _POSIX_Spinlock_Translate_core_spinlock_return_code - * - * Input parameters: - * the_spinlock_status - spinlock status code to translate - * - * Output parameters: - * status code - translated POSIX status code - * - */ - static int _POSIX_Spinlock_Return_codes[CORE_SPINLOCK_STATUS_LAST + 1] = { 0, /* CORE_SPINLOCK_SUCCESSFUL */ EDEADLK, /* CORE_SPINLOCK_HOLDER_RELOCKING */ diff --git a/cpukit/posix/src/rwlockattrgetpshared.c b/cpukit/posix/src/rwlockattrgetpshared.c index 488809f87b..233cbffa22 100644 --- a/cpukit/posix/src/rwlockattrgetpshared.c +++ b/cpukit/posix/src/rwlockattrgetpshared.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Get the Process-Shared Attribute of the RWLock + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -14,10 +21,6 @@ #include #include -/* - * RWLock Attributes Get Process Shared - */ - int pthread_rwlockattr_getpshared( const pthread_rwlockattr_t *attr, int *pshared diff --git a/cpukit/posix/src/sched_getprioritymin.c b/cpukit/posix/src/sched_getprioritymin.c index ed5737e1bc..73d892de47 100644 --- a/cpukit/posix/src/sched_getprioritymin.c +++ b/cpukit/posix/src/sched_getprioritymin.c @@ -1,6 +1,11 @@ -/* - * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 +/** + * @file * + * @brief Get the Minimum Priority Limit + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -20,6 +25,9 @@ #include #include +/** + * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 + */ int sched_get_priority_min( int policy ) diff --git a/cpukit/posix/src/semaphoredeletesupp.c b/cpukit/posix/src/semaphoredeletesupp.c index 433c23cc7a..a24adef870 100644 --- a/cpukit/posix/src/semaphoredeletesupp.c +++ b/cpukit/posix/src/semaphoredeletesupp.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Delete Semaphore + * @ingroup POSIX_SEMAPHORE + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -25,10 +32,6 @@ #include #include -/* - * _POSIX_Semaphore_Delete - */ - void _POSIX_Semaphore_Delete( POSIX_Semaphore_Control *the_semaphore ) diff --git a/cpukit/posix/src/semtrywait.c b/cpukit/posix/src/semtrywait.c index e8c4e7689b..b80e515afd 100644 --- a/cpukit/posix/src/semtrywait.c +++ b/cpukit/posix/src/semtrywait.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Lock a Semaphore + * @ingroup POSIX_SEMAPHORE + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). @@ -25,12 +32,6 @@ #include #include -/* - * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226 - * - * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27 - */ - int sem_trywait( sem_t *sem ) diff --git a/cpukit/posix/src/sigtimedwait.c b/cpukit/posix/src/sigtimedwait.c index 1f23356056..b350a2cc33 100644 --- a/cpukit/posix/src/sigtimedwait.c +++ b/cpukit/posix/src/sigtimedwait.c @@ -1,6 +1,11 @@ -/* - * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 +/** + * @file * + * @brief Wait for Queued Signals + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * @@ -58,6 +63,9 @@ found_it: return signo; } +/** + * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 + */ int sigtimedwait( const sigset_t *set, siginfo_t *info, diff --git a/cpukit/posix/src/timergetoverrun.c b/cpukit/posix/src/timergetoverrun.c index 9403d02f5c..23a4e6f3fe 100644 --- a/cpukit/posix/src/timergetoverrun.c +++ b/cpukit/posix/src/timergetoverrun.c @@ -1,6 +1,11 @@ -/* - * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 +/** + * @file * + * @brief Get Overrun Count for a POSIX Per-Process Timer + * @ingroup POSIX_PRIV_TIMERS + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -21,13 +26,6 @@ #include #include -/* - * timer_getoverrun - * - * The expiration of a timer must increase by one a counter. - * After the signal handler associated to the timer finishes - * its execution, _POSIX_Timer_TSR will have to set this counter to 0. - */ int timer_getoverrun( timer_t timerid ) diff --git a/cpukit/posix/src/waitpid.c b/cpukit/posix/src/waitpid.c index 0ae199156f..03e4f7d731 100644 --- a/cpukit/posix/src/waitpid.c +++ b/cpukit/posix/src/waitpid.c @@ -1,6 +1,11 @@ -/* - * waitpid() - POSIX 1003.1 3.2.1 +/** + * @file * + * @brief Wait for Process to Change State + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * -- cgit v1.2.3 From eb08acf9031f7ac05745468427d2c8478c542ff2 Mon Sep 17 00:00:00 2001 From: Mathew Kallada Date: Sat, 15 Dec 2012 15:41:05 -0500 Subject: posix: Doxygen Enhancement Task #8 http://www.google-melange.com/gci/task/view/google/gci2012/8003213 --- cpukit/posix/include/rtems/posix/key.h | 2 +- cpukit/posix/include/rtems/posix/mqueue.h | 37 +++++++++++++++++++++++++--- cpukit/posix/include/rtems/posix/pthread.h | 8 +++++- cpukit/posix/include/rtems/posix/semaphore.h | 8 +++++- cpukit/posix/src/condwait.c | 7 ++++++ cpukit/posix/src/execvp.c | 9 +++++-- cpukit/posix/src/keyrundestructors.c | 7 ++++++ cpukit/posix/src/kill.c | 9 +++++-- cpukit/posix/src/mqueue.c | 19 ++++++-------- cpukit/posix/src/mqueuerecvsupp.c | 19 ++++++-------- cpukit/posix/src/mutexattrsetprioceiling.c | 7 ++++++ cpukit/posix/src/prwlocktryrdlock.c | 9 +++++-- cpukit/posix/src/pthread.c | 7 ++++++ cpukit/posix/src/pthreadattrgetstackaddr.c | 9 +++++-- cpukit/posix/src/pthreadattrsetguardsize.c | 9 +++++-- cpukit/posix/src/pthreadattrsetschedparam.c | 9 +++++-- cpukit/posix/src/pthreadequal.c | 9 +++++-- cpukit/posix/src/sched_setscheduler.c | 10 +++++--- cpukit/posix/src/semaphorewaitsupp.c | 7 ++++++ cpukit/posix/src/sigfillset.c | 9 +++++-- cpukit/posix/src/sigqueue.c | 9 +++++-- cpukit/posix/src/sigwait.c | 11 ++++++--- cpukit/posix/src/ualarm.c | 9 +++++-- 23 files changed, 182 insertions(+), 57 deletions(-) diff --git a/cpukit/posix/include/rtems/posix/key.h b/cpukit/posix/include/rtems/posix/key.h index ce4f093b13..edcaa42685 100644 --- a/cpukit/posix/include/rtems/posix/key.h +++ b/cpukit/posix/include/rtems/posix/key.h @@ -58,7 +58,7 @@ POSIX_EXTERN Objects_Information _POSIX_Keys_Information; void _POSIX_Key_Manager_initialization(void); /** - * @brief _POSIX_Keys_Run_destructors + * @brief Thread-Specific Data Key Create * * This function executes all the destructors associated with the thread's * keys. This function will execute until all values have been set to NULL. diff --git a/cpukit/posix/include/rtems/posix/mqueue.h b/cpukit/posix/include/rtems/posix/mqueue.h index 9226d6f86e..582d5b73b2 100644 --- a/cpukit/posix/include/rtems/posix/mqueue.h +++ b/cpukit/posix/include/rtems/posix/mqueue.h @@ -35,6 +35,12 @@ #include #include +/** + * @defgroup POSIX_MQUEUE_P Message Queues Private Support Information + * + * @ingroup POSIX + */ +/**@{*/ #ifdef __cplusplus extern "C" { #endif @@ -73,11 +79,24 @@ POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information; POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information_fds; /* - * _POSIX_Message_queue_Manager_initialization + * @brief Initializes message_queue Manager Related Data Structures * * DESCRIPTION: * * This routine performs the initialization necessary for this manager. + * + * NOTE: The structure of the routines is identical to that of POSIX + * Message_queues to leave the option of having unnamed message + * queues at a future date. They are currently not part of the + * POSIX standard but unnamed message_queues are. This is also + * the reason for the apparently unnecessary tracking of + * the process_shared attribute. [In addition to the fact that + * it would be trivial to add pshared to the mq_attr structure + * and have process private message queues.] + * + * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open + * time. + * */ void _POSIX_Message_queue_Manager_initialization(void); @@ -113,11 +132,23 @@ void _POSIX_Message_queue_Delete( ); /* - * _POSIX_Message_queue_Receive_support + * @brief POSIX Message Queue Receive Support * * DESCRIPTION: * * This routine supports the various flavors of receiving a message. + * + * NOTE: The structure of the routines is identical to that of POSIX + * Message_queues to leave the option of having unnamed message + * queues at a future date. They are currently not part of the + * POSIX standard but unnamed message_queues are. This is also + * the reason for the apparently unnecessary tracking of + * the process_shared attribute. [In addition to the fact that + * it would be trivial to add pshared to the mq_attr structure + * and have process private message queues.] + * + * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open + * time. */ ssize_t _POSIX_Message_queue_Receive_support( @@ -243,6 +274,6 @@ int _POSIX_Message_queue_Translate_core_message_queue_return_code( #ifdef __cplusplus } #endif - +/**@}*/ #endif /* end of include file */ diff --git a/cpukit/posix/include/rtems/posix/pthread.h b/cpukit/posix/include/rtems/posix/pthread.h index 52ad486337..910bdc97ed 100644 --- a/cpukit/posix/include/rtems/posix/pthread.h +++ b/cpukit/posix/include/rtems/posix/pthread.h @@ -21,6 +21,12 @@ #include #include +/** + * @defgroup POSIX_PTHREADS Private Threads + * + * @ingroup POSIX + */ +/**@{*/ #ifdef __cplusplus extern "C" { #endif @@ -176,6 +182,6 @@ extern void _POSIX_Threads_Initialize_user_threads_body(void); #ifdef __cplusplus } #endif - +/**@}*/ #endif /* end of include file */ diff --git a/cpukit/posix/include/rtems/posix/semaphore.h b/cpukit/posix/include/rtems/posix/semaphore.h index 378b284c42..08ace7684f 100644 --- a/cpukit/posix/include/rtems/posix/semaphore.h +++ b/cpukit/posix/include/rtems/posix/semaphore.h @@ -17,6 +17,12 @@ #ifndef _RTEMS_POSIX_SEMAPHORE_H #define _RTEMS_POSIX_SEMAPHORE_H +/** + * @defgroup POSIX_SEMAPHORES Semaphore + * + * @ingroup POSIX + */ +/**@{*/ #ifdef __cplusplus extern "C" { #endif @@ -150,7 +156,7 @@ void _POSIX_Semaphore_Delete( ); /* - * _POSIX_Semaphore_Wait_support + * @brief POSIX Semaphore Wait Support * * DESCRIPTION: * diff --git a/cpukit/posix/src/condwait.c b/cpukit/posix/src/condwait.c index 2540208e16..3162b4d97b 100644 --- a/cpukit/posix/src/condwait.c +++ b/cpukit/posix/src/condwait.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Waiting on a Condition + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/execvp.c b/cpukit/posix/src/execvp.c index 6b4d0e9a39..7712c8cef6 100644 --- a/cpukit/posix/src/execvp.c +++ b/cpukit/posix/src/execvp.c @@ -1,6 +1,11 @@ -/* - * execvp() - POSIX 1003.1b 3.1.2 +/** + * @file * + * @brief execvp() - POSIX 1003.1b 3.1.2 + * @ingroup POSIX_KEY Key + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/keyrundestructors.c b/cpukit/posix/src/keyrundestructors.c index 888b24715a..9f48888bb8 100644 --- a/cpukit/posix/src/keyrundestructors.c +++ b/cpukit/posix/src/keyrundestructors.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Thread-Specific Data Key Create + * @ingroup POSIX_KEY Key + */ + /* * Copyright (c) 2010 embedded brains GmbH. * diff --git a/cpukit/posix/src/kill.c b/cpukit/posix/src/kill.c index ee59fe4b84..8a476e40ce 100644 --- a/cpukit/posix/src/kill.c +++ b/cpukit/posix/src/kill.c @@ -1,6 +1,11 @@ -/* - * 3.3.2 Send a Signal to a Process, P1003.1b-1993, p. 68 +/** + * @file * + * @brief Send a Signal to a Process + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/mqueue.c b/cpukit/posix/src/mqueue.c index 689de26c62..93d6f1bc5b 100644 --- a/cpukit/posix/src/mqueue.c +++ b/cpukit/posix/src/mqueue.c @@ -1,16 +1,11 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. +/** + * @file * + * @brief Initializes message_queue Manager Related Data Structures + * @ingroup POSIX_MQUEUE_P Message Queues Private Support Information + */ + +/* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/mqueuerecvsupp.c b/cpukit/posix/src/mqueuerecvsupp.c index f1c3102e1f..5cfce067c6 100644 --- a/cpukit/posix/src/mqueuerecvsupp.c +++ b/cpukit/posix/src/mqueuerecvsupp.c @@ -1,16 +1,11 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. +/** + * @file * + * @brief POSIX Message Queue Receive Support + * @ingroup POSIX_MQUEUE_P Message Queues Private Support Information + */ + +/* * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/mutexattrsetprioceiling.c b/cpukit/posix/src/mutexattrsetprioceiling.c index f4c2da9b96..82c83cf80e 100644 --- a/cpukit/posix/src/mutexattrsetprioceiling.c +++ b/cpukit/posix/src/mutexattrsetprioceiling.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Mutex Initialization Scheduling Attributes + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/prwlocktryrdlock.c b/cpukit/posix/src/prwlocktryrdlock.c index eb8c5f8f05..f8524e34d2 100644 --- a/cpukit/posix/src/prwlocktryrdlock.c +++ b/cpukit/posix/src/prwlocktryrdlock.c @@ -1,6 +1,11 @@ -/* - * POSIX RWLock Manager -- Attempt to Obtain a Read Lock on a RWLock Instance +/** + * @file * + * @brief Attempt to Obtain a Read Lock on a RWLock Instance + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c index 1773c24b69..873449a2da 100644 --- a/cpukit/posix/src/pthread.c +++ b/cpukit/posix/src/pthread.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Private Support Information for POSIX Threads + * @ingroup POSIX_PTHREADS Private Threads + */ + /* * COPYRIGHT (c) 1989-2010. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/pthreadattrgetstackaddr.c b/cpukit/posix/src/pthreadattrgetstackaddr.c index c877c1395d..dfdffbd662 100644 --- a/cpukit/posix/src/pthreadattrgetstackaddr.c +++ b/cpukit/posix/src/pthreadattrgetstackaddr.c @@ -1,6 +1,11 @@ -/* - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 +/** + * @file * + * @brief Thread Creation Attributes + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/pthreadattrsetguardsize.c b/cpukit/posix/src/pthreadattrsetguardsize.c index 51390a7d12..7656d4fee9 100644 --- a/cpukit/posix/src/pthreadattrsetguardsize.c +++ b/cpukit/posix/src/pthreadattrsetguardsize.c @@ -1,6 +1,11 @@ -/* - * 16.1.1 Thread Creation Attributes +/** + * @file * + * @brief Thread Creation Attributes + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2010. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/pthreadattrsetschedparam.c b/cpukit/posix/src/pthreadattrsetschedparam.c index fb56652db7..65e560198f 100644 --- a/cpukit/posix/src/pthreadattrsetschedparam.c +++ b/cpukit/posix/src/pthreadattrsetschedparam.c @@ -1,6 +1,11 @@ -/* - * 13.5.1 Thread Creation Scheduling Parameters, P1003.1c/Draft 10, p. 120 +/** + * @file * + * @brief Thread Creation Scheduling Parameters + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/pthreadequal.c b/cpukit/posix/src/pthreadequal.c index bc18e33a13..ce08b1ea88 100644 --- a/cpukit/posix/src/pthreadequal.c +++ b/cpukit/posix/src/pthreadequal.c @@ -1,6 +1,11 @@ -/* - * 16.1.7 Compare Thread IDs, p1003.1c/Draft 10, p. 153 +/** + * @file * + * @brief Compare Thread IDs + * @ingroup POSIX + */ + +/* * NOTE: POSIX does not define the behavior when either thread id is invalid. * * COPYRIGHT (c) 1989-2007. diff --git a/cpukit/posix/src/sched_setscheduler.c b/cpukit/posix/src/sched_setscheduler.c index fcbc8fd3fd..f9b5c3f562 100644 --- a/cpukit/posix/src/sched_setscheduler.c +++ b/cpukit/posix/src/sched_setscheduler.c @@ -1,7 +1,11 @@ -/* - * 13.3.3 Set Scheduling Policy and Scheduling Parameters, - * P1003.1b-1993, p. 254 +/** + * @file * + * @brief Set Scheduling Policy and Scheduling Parameters + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/semaphorewaitsupp.c b/cpukit/posix/src/semaphorewaitsupp.c index 2ad1efe5af..5b215dad23 100644 --- a/cpukit/posix/src/semaphorewaitsupp.c +++ b/cpukit/posix/src/semaphorewaitsupp.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Semaphore Wait Support + * @ingroup POSIX_SEMAPHORES Semaphore + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/sigfillset.c b/cpukit/posix/src/sigfillset.c index 75b0ede57e..32b1ef15d0 100644 --- a/cpukit/posix/src/sigfillset.c +++ b/cpukit/posix/src/sigfillset.c @@ -1,6 +1,11 @@ -/* - * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69 +/** + * @file * + * @brief Manipulate Signal Sets + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/sigqueue.c b/cpukit/posix/src/sigqueue.c index b1f6cee67e..8b65aba0cb 100644 --- a/cpukit/posix/src/sigqueue.c +++ b/cpukit/posix/src/sigqueue.c @@ -1,6 +1,11 @@ -/* - * 3.3.9 Queue a Signal to a Process, P1003.1b-1993, p. 78 +/** + * @file * + * @brief Queue a Signal to a Process + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/sigwait.c b/cpukit/posix/src/sigwait.c index cfb733034b..24afa80602 100644 --- a/cpukit/posix/src/sigwait.c +++ b/cpukit/posix/src/sigwait.c @@ -1,8 +1,11 @@ -/* - * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 - * - * NOTE: P1003.1c/D10, p. 39 adds sigwait(). +/** + * @file * + * @brief Synchronously Accept a Signal + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/ualarm.c b/cpukit/posix/src/ualarm.c index 2a2f975d67..34ab0a41cc 100644 --- a/cpukit/posix/src/ualarm.c +++ b/cpukit/posix/src/ualarm.c @@ -1,6 +1,11 @@ -/* - * 3.4.1 Schedule Alarm, P1003.1b-1993, p. 79 +/** + * @file * + * @brief Schedule Alarm + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * -- cgit v1.2.3 From d86308bdf8d231cd02bb72e4669f12c2689f4dac Mon Sep 17 00:00:00 2001 From: Alex Ivanov Date: Sat, 15 Dec 2012 16:03:12 -0500 Subject: posix: Doxygen Enhancement Task #2 http://www.google-melange.com/gci/task/view/google/gci2012/7988213 --- cpukit/posix/include/mqueue.h | 16 +++++++++------- cpukit/posix/include/rtems/posix/cond.h | 11 +++++------ cpukit/posix/include/rtems/posix/psignalimpl.h | 5 +++++ cpukit/posix/include/rtems/posix/pthread.h | 15 ++++++++++++--- cpukit/posix/include/semaphore.h | 24 +++++++++++++++++------- cpukit/posix/src/condwaitsupp.c | 14 +++++++------- cpukit/posix/src/mqueuenotify.c | 24 +++++++----------------- cpukit/posix/src/mqueuesetattr.c | 23 +++++++---------------- cpukit/posix/src/mutexattrdestroy.c | 12 +++++++++--- cpukit/posix/src/mutexinit.c | 15 +++++++++++---- cpukit/posix/src/mutextimedlock.c | 14 ++++++++------ cpukit/posix/src/mutextrylock.c | 14 ++++++++++---- cpukit/posix/src/pause.c | 14 +++++++++----- cpukit/posix/src/pbarrierwait.c | 25 +++++++++++++------------ cpukit/posix/src/prwlockrdlock.c | 23 ++++++++++++----------- cpukit/posix/src/psignalunblockthread.c | 13 +++++++------ cpukit/posix/src/pthreadattrinit.c | 12 ++++++++++-- cpukit/posix/src/pthreaddetach.c | 12 ++++++++++-- cpukit/posix/src/pthreadinitthreads.c | 18 +++++++----------- cpukit/posix/src/sched_getparam.c | 12 ++++++++++-- cpukit/posix/src/semclose.c | 16 +++++++--------- cpukit/posix/src/semgetvalue.c | 11 +++++++---- cpukit/posix/src/semunlink.c | 16 +++++++--------- cpukit/posix/src/sigprocmask.c | 16 ++++++++++++---- cpukit/posix/src/wait.c | 9 +++++++-- 25 files changed, 225 insertions(+), 159 deletions(-) diff --git a/cpukit/posix/include/mqueue.h b/cpukit/posix/include/mqueue.h index f41866bfe5..a35d94ccc4 100644 --- a/cpukit/posix/include/mqueue.h +++ b/cpukit/posix/include/mqueue.h @@ -172,11 +172,12 @@ ssize_t mq_timedreceive( #if defined(_POSIX_REALTIME_SIGNALS) -/* - * 15.2.6 Notify Process that a Message is Available on a Queue, - * P1003.1b-1993, p. 280 +/** + * @brief Notify Process that a Message is Available on a Queue + * + * 15.2.6 Notify Process that a Message is Available on a Queue, + * P1003.1b-1993, p. 280 */ - int mq_notify( mqd_t mqdes, const struct sigevent *notification @@ -184,10 +185,11 @@ int mq_notify( #endif /* _POSIX_REALTIME_SIGNALS */ -/* - * 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281 +/** + * @brief Set Message Queue Attributes + * + * 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281 */ - int mq_setattr( mqd_t mqdes, const struct mq_attr *mqstat, diff --git a/cpukit/posix/include/rtems/posix/cond.h b/cpukit/posix/include/rtems/posix/cond.h index b089abe4a9..93b5b4cf2a 100644 --- a/cpukit/posix/include/rtems/posix/cond.h +++ b/cpukit/posix/include/rtems/posix/cond.h @@ -148,15 +148,14 @@ int _POSIX_Condition_variables_Signal_support( bool is_broadcast ); -/* - * _POSIX_Condition_variables_Wait_support +/** + * @brief POSIX Condition Variables Wait Support * - * DESCRIPTION: + * DESCRIPTION: * - * A support routine which implements guts of the blocking, non-blocking, and - * timed wait version of condition variable wait routines. + * A support routine which implements guts of the blocking, non-blocking, and + * timed wait version of condition variable wait routines. */ - int _POSIX_Condition_variables_Wait_support( pthread_cond_t *cond, pthread_mutex_t *mutex, diff --git a/cpukit/posix/include/rtems/posix/psignalimpl.h b/cpukit/posix/include/rtems/posix/psignalimpl.h index b8e5e1e0ea..daeb92771d 100644 --- a/cpukit/posix/include/rtems/posix/psignalimpl.h +++ b/cpukit/posix/include/rtems/posix/psignalimpl.h @@ -81,6 +81,11 @@ static inline void _POSIX_signals_Add_post_switch_extension(void) _API_extensions_Add_post_switch( &_POSIX_signals_Post_switch ); } +/** + * @brief POSIX Signals Thread Unlock + * + * XXX this routine could probably be cleaned up + */ bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, diff --git a/cpukit/posix/include/rtems/posix/pthread.h b/cpukit/posix/include/rtems/posix/pthread.h index 910bdc97ed..5932d45a39 100644 --- a/cpukit/posix/include/rtems/posix/pthread.h +++ b/cpukit/posix/include/rtems/posix/pthread.h @@ -30,6 +30,15 @@ #ifdef __cplusplus extern "C" { #endif + +/** + * @defgroup POSIX_PTHREAD POSIX Threads Support + * + * @ingroup POSIX + * + * @brief Private Support Information for POSIX Threads + */ + /** * The following sets the minimum stack size for POSIX threads. */ @@ -170,10 +179,10 @@ int _POSIX_Thread_Translate_sched_param( ); /** - * @brief _POSIX_Threads_Initialize_user_threads_body + * @brief POSIX Threads Initialize User Threads Body * - * This routine creates and starts all configured user - * initialization threads. + * This routine creates and starts all configured user + * initialization threads. */ extern void _POSIX_Threads_Initialize_user_threads_body(void); diff --git a/cpukit/posix/include/semaphore.h b/cpukit/posix/include/semaphore.h index 17c583240c..59ed9e6703 100644 --- a/cpukit/posix/include/semaphore.h +++ b/cpukit/posix/include/semaphore.h @@ -74,15 +74,24 @@ sem_t *sem_open( ... ); -/* - * 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224 +/** + * @brief Close a Named Semaphore + * + * Routine to close a semaphore that has been opened or initialized. + * + * 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224 */ int sem_close( sem_t *sem ); -/* - * 11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225 +/** + * @brief Remove a Named Semaphore + * + * Unlinks a named semaphore, sem_close must also be called to remove + * the semaphore. + * + * 11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225 */ int sem_unlink( const char *name @@ -124,10 +133,11 @@ int sem_post( sem_t *sem ); -/* - * 11.2.8 Get the Value of a Semaphore, P1003.1b-1993, p.229 +/** + * @brief Get the Value of a Semaphore + * + * 11.2.8 Get the Value of a Semaphore, P1003.1b-1993, p.229 */ - int sem_getvalue( sem_t *sem, int *sval diff --git a/cpukit/posix/src/condwaitsupp.c b/cpukit/posix/src/condwaitsupp.c index 79b5c02164..91bdc32a0c 100644 --- a/cpukit/posix/src/condwaitsupp.c +++ b/cpukit/posix/src/condwaitsupp.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Condition Variables Wait Support + * @ingroup POSIX_COND_VARS + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -22,13 +29,6 @@ #include #include -/* - * _POSIX_Condition_variables_Wait_support - * - * A support routine which implements guts of the blocking, non-blocking, and - * timed wait version of condition variable wait routines. - */ - int _POSIX_Condition_variables_Wait_support( pthread_cond_t *cond, pthread_mutex_t *mutex, diff --git a/cpukit/posix/src/mqueuenotify.c b/cpukit/posix/src/mqueuenotify.c index 9909fae4fa..5387335c33 100644 --- a/cpukit/posix/src/mqueuenotify.c +++ b/cpukit/posix/src/mqueuenotify.c @@ -1,16 +1,11 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. +/** + * @file * + * @brief Notify Process that a Message is Available on a Queue + * @ingroup POSIX_MQUEUE + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -57,11 +52,6 @@ static void _POSIX_Message_queue_Notify_handler( _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL ); } -/* - * 15.2.6 Notify Process that a Message is Available on a Queue, - * P1003.1b-1993, p. 280 - */ - int mq_notify( mqd_t mqdes, const struct sigevent *notification diff --git a/cpukit/posix/src/mqueuesetattr.c b/cpukit/posix/src/mqueuesetattr.c index 7abdceb730..2fbcd95e3f 100644 --- a/cpukit/posix/src/mqueuesetattr.c +++ b/cpukit/posix/src/mqueuesetattr.c @@ -1,16 +1,11 @@ -/* - * NOTE: The structure of the routines is identical to that of POSIX - * Message_queues to leave the option of having unnamed message - * queues at a future date. They are currently not part of the - * POSIX standard but unnamed message_queues are. This is also - * the reason for the apparently unnecessary tracking of - * the process_shared attribute. [In addition to the fact that - * it would be trivial to add pshared to the mq_attr structure - * and have process private message queues.] - * - * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open - * time. +/** + * @file * + * @brief Set Message Queue Attributes + * @ingroup POSIX_MQUEUE + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -37,10 +32,6 @@ #include #include -/* - * 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281 - */ - int mq_setattr( mqd_t mqdes, const struct mq_attr *mqstat, diff --git a/cpukit/posix/src/mutexattrdestroy.c b/cpukit/posix/src/mutexattrdestroy.c index d7a6616908..06d5c1d2fc 100644 --- a/cpukit/posix/src/mutexattrdestroy.c +++ b/cpukit/posix/src/mutexattrdestroy.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Destroy Mutex Attributes Object + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -21,10 +28,9 @@ #include #include -/* - * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 +/** + * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 */ - int pthread_mutexattr_destroy( pthread_mutexattr_t *attr ) diff --git a/cpukit/posix/src/mutexinit.c b/cpukit/posix/src/mutexinit.c index 26e75538c5..5ef3485ee2 100644 --- a/cpukit/posix/src/mutexinit.c +++ b/cpukit/posix/src/mutexinit.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Initialize a Mutex + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). @@ -21,11 +28,11 @@ #include #include -/* - * 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87 +/** + * 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87 * - * NOTE: XXX Could be optimized so all the attribute error checking - * is not performed when attr is NULL. + * NOTE: XXX Could be optimized so all the attribute error checking + * is not performed when attr is NULL. */ int pthread_mutex_init( diff --git a/cpukit/posix/src/mutextimedlock.c b/cpukit/posix/src/mutextimedlock.c index a8d258a8f8..442f3c6052 100644 --- a/cpukit/posix/src/mutextimedlock.c +++ b/cpukit/posix/src/mutextimedlock.c @@ -1,5 +1,8 @@ -/* - * Mutex Timed Lock +/** + * @file + * + * @brief Mutex Timed Lock + * @ingroup POSIX */ /* @@ -28,12 +31,11 @@ #include #include -/* - * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 +/** + * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 * - * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 + * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 */ - int pthread_mutex_timedlock( pthread_mutex_t *mutex, const struct timespec *abstime diff --git a/cpukit/posix/src/mutextrylock.c b/cpukit/posix/src/mutextrylock.c index 85b6da51a7..f398dc208a 100644 --- a/cpukit/posix/src/mutextrylock.c +++ b/cpukit/posix/src/mutextrylock.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Try to Lock Mutex + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -24,12 +31,11 @@ #include #include -/* - * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 +/** + * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 * - * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 + * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 */ - int pthread_mutex_trylock( pthread_mutex_t *mutex ) diff --git a/cpukit/posix/src/pause.c b/cpukit/posix/src/pause.c index 3a307d6e93..ee74f6746b 100644 --- a/cpukit/posix/src/pause.c +++ b/cpukit/posix/src/pause.c @@ -1,6 +1,11 @@ -/* - * 3.4.2 Suspend Process Execution, P1003.1b-1993, p. 81 +/** + * @file * + * @brief Suspend Process Execution + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * @@ -17,10 +22,9 @@ #include #include -/* - * 3.4.2 Suspend Process Execution, P1003.1b-1993, p. 81 +/** + * 3.4.2 Suspend Process Execution, P1003.1b-1993, p. 81 */ - int pause( void ) { sigset_t all_signals; diff --git a/cpukit/posix/src/pbarrierwait.c b/cpukit/posix/src/pbarrierwait.c index c5e73bcb26..0ad9634411 100644 --- a/cpukit/posix/src/pbarrierwait.c +++ b/cpukit/posix/src/pbarrierwait.c @@ -1,6 +1,11 @@ -/* - * POSIX Barrier Manager -- Wait at a Barrier +/** + * @file * + * @brief Wait at a Barrier + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -19,18 +24,14 @@ #include #include -/* - * pthread_barrier_wait - * - * This directive allows a thread to wait at a barrier. +/** + * This directive allows a thread to wait at a barrier. * - * Input parameters: - * barrier - barrier id + * @param[in] barrier is the barrier id * - * Output parameters: - * 0 - if successful - * PTHREAD_BARRIER_SERIAL_THREAD - if successful - * error code - if unsuccessful + * @retval 0 if successful + * @retval PTHREAD_BARRIER_SERIAL_THREAD if successful + * @retval error_code if unsuccessful */ int pthread_barrier_wait( diff --git a/cpukit/posix/src/prwlockrdlock.c b/cpukit/posix/src/prwlockrdlock.c index ec75fea823..0ce4764915 100644 --- a/cpukit/posix/src/prwlockrdlock.c +++ b/cpukit/posix/src/prwlockrdlock.c @@ -1,6 +1,11 @@ -/* - * POSIX RWLock Manager -- Obtain a Read Lock on a RWLock Instance +/** + * @file * + * @brief Obtain a Read Lock on a RWLock Instance + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -19,17 +24,13 @@ #include #include -/* - * pthread_rwlock_rdlock - * - * This directive attempts to obtain a read only lock on an rwlock instance. +/** + * This directive attempts to obtain a read only lock on an rwlock instance. * - * Input parameters: - * rwlock - pointer to rwlock id + * @param[in] rwlock is the pointer to rwlock id * - * Output parameters: - * 0 - if successful - * error code - if unsuccessful + * @retval 0 if successful + * @retval error_code if unsuccessful */ int pthread_rwlock_rdlock( diff --git a/cpukit/posix/src/psignalunblockthread.c b/cpukit/posix/src/psignalunblockthread.c index 5dc6ef587b..0603a7f152 100644 --- a/cpukit/posix/src/psignalunblockthread.c +++ b/cpukit/posix/src/psignalunblockthread.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Signals Thread Unlock + * @ingroup POSIX_SIGNALS + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -27,12 +34,6 @@ #include #include - -/* - * _POSIX_signals_Unblock_thread - */ - -/* XXX this routine could probably be cleaned up */ bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, diff --git a/cpukit/posix/src/pthreadattrinit.c b/cpukit/posix/src/pthreadattrinit.c index 67942c8ac4..1e5211bfd6 100644 --- a/cpukit/posix/src/pthreadattrinit.c +++ b/cpukit/posix/src/pthreadattrinit.c @@ -1,6 +1,11 @@ -/* - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 +/** + * @file * + * @brief Thread Attributes Creation + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * @@ -19,6 +24,9 @@ #include #include +/** + * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 + */ int pthread_attr_init( pthread_attr_t *attr ) diff --git a/cpukit/posix/src/pthreaddetach.c b/cpukit/posix/src/pthreaddetach.c index a50aa86a4e..682bac8b42 100644 --- a/cpukit/posix/src/pthreaddetach.c +++ b/cpukit/posix/src/pthreaddetach.c @@ -1,6 +1,11 @@ -/* - * 16.1.4 Detaching a Thread, P1003.1c/Draft 10, p. 149 +/** + * @file * + * @brief Detaching a Thread + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -20,6 +25,9 @@ #include #include +/** + * 16.1.4 Detaching a Thread, P1003.1c/Draft 10, p. 149 + */ int pthread_detach( pthread_t thread ) diff --git a/cpukit/posix/src/pthreadinitthreads.c b/cpukit/posix/src/pthreadinitthreads.c index b2c850fda2..8b17e06a14 100644 --- a/cpukit/posix/src/pthreadinitthreads.c +++ b/cpukit/posix/src/pthreadinitthreads.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Threads Initialize User Threads Body + * @ingroup POSIX_PTHREAD + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). @@ -28,17 +35,6 @@ #include #include -/* - * _POSIX_Threads_Initialize_user_threads_body - * - * This routine creates and starts all configured user - * initialization threads. - * - * Input parameters: NONE - * - * Output parameters: NONE - */ - void _POSIX_Threads_Initialize_user_threads_body(void) { int status; diff --git a/cpukit/posix/src/sched_getparam.c b/cpukit/posix/src/sched_getparam.c index 9cd95fefbe..d9e516a8ed 100644 --- a/cpukit/posix/src/sched_getparam.c +++ b/cpukit/posix/src/sched_getparam.c @@ -1,6 +1,11 @@ -/* - * 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253 +/** + * @file * + * @brief Set Scheduling Parameters + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * @@ -19,6 +24,9 @@ #include #include +/** + * 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253 + */ int sched_getparam( pid_t pid __attribute__((unused)), struct sched_param *param __attribute__((unused)) diff --git a/cpukit/posix/src/semclose.c b/cpukit/posix/src/semclose.c index 3913cd57fb..a9521bdd6b 100644 --- a/cpukit/posix/src/semclose.c +++ b/cpukit/posix/src/semclose.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Close a Named Semaphore + * @ingroup POSIX_SEMAPHORE + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -25,15 +32,6 @@ #include #include - -/* - * sem_close - * - * Routine to close a semaphore that has been opened or initialized. - * - * 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224 - */ - int sem_close( sem_t *sem ) diff --git a/cpukit/posix/src/semgetvalue.c b/cpukit/posix/src/semgetvalue.c index 7b21c82df9..8ea0bdad07 100644 --- a/cpukit/posix/src/semgetvalue.c +++ b/cpukit/posix/src/semgetvalue.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Get the Value of a Semaphore + * @ingroup POSIX_SEMAPHORE + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -25,10 +32,6 @@ #include #include -/* - * 11.2.8 Get the Value of a Semaphore, P1003.1b-1993, p.229 - */ - int sem_getvalue( sem_t *sem, int *sval diff --git a/cpukit/posix/src/semunlink.c b/cpukit/posix/src/semunlink.c index 16c9525e3f..c34add8131 100644 --- a/cpukit/posix/src/semunlink.c +++ b/cpukit/posix/src/semunlink.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Remove a Named Semaphore + * @ingroup POSIX_SEMAPHORE + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). @@ -25,15 +32,6 @@ #include #include -/* - * sem_unlink - * - * Unlinks a named semaphore, sem_close must also be called to remove - * the semaphore. - * - * 11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225 - */ - int sem_unlink( const char *name ) diff --git a/cpukit/posix/src/sigprocmask.c b/cpukit/posix/src/sigprocmask.c index 26435f7c03..464343bab0 100644 --- a/cpukit/posix/src/sigprocmask.c +++ b/cpukit/posix/src/sigprocmask.c @@ -1,8 +1,11 @@ -/* - * 3.3.5 Examine and Change Blocked Signals, P1003.1b-1993, p. 73 - * - * NOTE: P1003.1c/D10, p. 37 adds pthread_sigmask(). +/** + * @file * + * @brief Examine and Change Blocked Signals + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * @@ -18,6 +21,11 @@ #include #include +/** + * 3.3.5 Examine and Change Blocked Signals, P1003.1b-1993, p. 73 + * + * NOTE: P1003.1c/D10, p. 37 adds pthread_sigmask(). + */ int sigprocmask( int how, const sigset_t *set, diff --git a/cpukit/posix/src/wait.c b/cpukit/posix/src/wait.c index 1984c47741..8e48af71d6 100644 --- a/cpukit/posix/src/wait.c +++ b/cpukit/posix/src/wait.c @@ -1,6 +1,11 @@ -/* - * waitpid() - POSIX 1003.1b 3.2.1 +/** + * @file * + * @brief Wait for Process to Change State + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * -- cgit v1.2.3 From 810ecf05af45f50b9650a7156a98f7058f656570 Mon Sep 17 00:00:00 2001 From: Mathew Kallada Date: Sun, 16 Dec 2012 08:38:02 -0500 Subject: posix: Doxygen Enhancement Task #7 http://www.google-melange.com/gci/task/view/google/gci2012/7958218 --- cpukit/posix/include/rtems/posix/mutex.h | 6 +++--- cpukit/posix/include/rtems/posix/psignalimpl.h | 3 +++ cpukit/posix/include/semaphore.h | 11 +++++++---- cpukit/posix/src/_execve.c | 9 +++++++-- cpukit/posix/src/execlp.c | 9 +++++++-- cpukit/posix/src/keygetspecific.c | 7 +++++++ cpukit/posix/src/mutex.c | 7 +++++++ cpukit/posix/src/mutexattrsetprotocol.c | 7 +++++++ cpukit/posix/src/mutexdestroy.c | 7 +++++++ cpukit/posix/src/mutexget.c | 9 +++++++-- cpukit/posix/src/mutexunlock.c | 7 +++++++ cpukit/posix/src/prwlocktimedrdlock.c | 9 +++++++-- cpukit/posix/src/psignalclearsignals.c | 7 +++++++ cpukit/posix/src/psxtransschedparam.c | 10 +++++++++- cpukit/posix/src/pthreadattrdestroy.c | 9 +++++++-- cpukit/posix/src/pthreadattrgetguardsize.c | 9 +++++++-- cpukit/posix/src/pthreadattrgetinheritsched.c | 9 +++++++-- cpukit/posix/src/pthreadattrgetstacksize.c | 9 +++++++-- cpukit/posix/src/pthreadattrsetdetachstate.c | 9 +++++++-- cpukit/posix/src/sched_yield.c | 9 +++++++-- cpukit/posix/src/semtimedwait.c | 7 +++++++ cpukit/posix/src/sigismember.c | 9 +++++++-- 22 files changed, 148 insertions(+), 30 deletions(-) diff --git a/cpukit/posix/include/rtems/posix/mutex.h b/cpukit/posix/include/rtems/posix/mutex.h index 0d73022f95..727745ae67 100644 --- a/cpukit/posix/include/rtems/posix/mutex.h +++ b/cpukit/posix/include/rtems/posix/mutex.h @@ -56,7 +56,7 @@ POSIX_EXTERN Objects_Information _POSIX_Mutex_Information; POSIX_EXTERN pthread_mutexattr_t _POSIX_Mutex_Default_attributes; /* - * _POSIX_Mutex_Manager_initialization + * @brief POSIX Mutex Manager Initialization * * DESCRIPTION: * @@ -144,9 +144,9 @@ int _POSIX_Mutex_Lock_support( * * A support routine which converts core mutex status codes into the * appropriate POSIX status values. - * + * * @param[in] the_mutex_status is the mutex status code to translate - * + * * @return the translated POSIX status code */ diff --git a/cpukit/posix/include/rtems/posix/psignalimpl.h b/cpukit/posix/include/rtems/posix/psignalimpl.h index daeb92771d..c416a7aa1b 100644 --- a/cpukit/posix/include/rtems/posix/psignalimpl.h +++ b/cpukit/posix/include/rtems/posix/psignalimpl.h @@ -101,6 +101,9 @@ bool _POSIX_signals_Check_signal( bool is_global ); +/** + * @brief POSIX Signals Clear Signals + */ bool _POSIX_signals_Clear_signals( POSIX_API_Control *api, int signo, diff --git a/cpukit/posix/include/semaphore.h b/cpukit/posix/include/semaphore.h index 59ed9e6703..37e3fd54b4 100644 --- a/cpukit/posix/include/semaphore.h +++ b/cpukit/posix/include/semaphore.h @@ -56,7 +56,7 @@ int sem_init( /** * @brief Destroy an Unnamed Semaphore - * + * * 11.2.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220 */ int sem_destroy( @@ -99,7 +99,7 @@ int sem_unlink( /** * @brief Lock a Semaphore - * + * * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226 * * @note P1003.4b/D8 adds sem_timedwait(), p. 27 @@ -110,7 +110,7 @@ int sem_wait( /** * @brief Lock a Semaphore - * + * * @see sem_wait() */ int sem_trywait( @@ -118,6 +118,9 @@ int sem_trywait( ); #if defined(_POSIX_TIMEOUTS) +/** + * @brief Lock a Semaphore + */ int sem_timedwait( sem_t *sem, const struct timespec *timeout @@ -126,7 +129,7 @@ int sem_timedwait( /** * @brief Unlock a Semaphore - * + * * 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227 */ int sem_post( diff --git a/cpukit/posix/src/_execve.c b/cpukit/posix/src/_execve.c index 7e6cf23a8a..b606fd63df 100644 --- a/cpukit/posix/src/_execve.c +++ b/cpukit/posix/src/_execve.c @@ -1,6 +1,11 @@ -/* - * execve() - POSIX 1003.1b 3.1.2 +/** + * @file * + * @brief execve() + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/execlp.c b/cpukit/posix/src/execlp.c index 10d44e0019..7a4c5142a6 100644 --- a/cpukit/posix/src/execlp.c +++ b/cpukit/posix/src/execlp.c @@ -1,6 +1,11 @@ -/* - * execlp() - POSIX 1003.1b 3.1.2 +/** + * @file * + * @brief execlp() + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/keygetspecific.c b/cpukit/posix/src/keygetspecific.c index c7b2cc55fc..3a34359297 100644 --- a/cpukit/posix/src/keygetspecific.c +++ b/cpukit/posix/src/keygetspecific.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Thread-Specific Data Management + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/mutex.c b/cpukit/posix/src/mutex.c index fd9fed3f77..c6026e08d7 100644 --- a/cpukit/posix/src/mutex.c +++ b/cpukit/posix/src/mutex.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Mutex Manager Initialization + * @ingroup POSIX_MUTEX POSIX Mutex Support + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/mutexattrsetprotocol.c b/cpukit/posix/src/mutexattrsetprotocol.c index 1c51ad5f03..fc7c1afe74 100644 --- a/cpukit/posix/src/mutexattrsetprotocol.c +++ b/cpukit/posix/src/mutexattrsetprotocol.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Mutex Initialization Scheduling Attributes + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/mutexdestroy.c b/cpukit/posix/src/mutexdestroy.c index 56f65b3b8f..4a9f1e964a 100644 --- a/cpukit/posix/src/mutexdestroy.c +++ b/cpukit/posix/src/mutexdestroy.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Initializing and Destroying a Mutex + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/mutexget.c b/cpukit/posix/src/mutexget.c index f1419034c3..44d1864118 100644 --- a/cpukit/posix/src/mutexget.c +++ b/cpukit/posix/src/mutexget.c @@ -1,6 +1,11 @@ -/* - * Convert POSIX Mutex ID to local object pointer +/** + * @file * + * @brief Convert POSIX Mutex ID to local object pointer + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/mutexunlock.c b/cpukit/posix/src/mutexunlock.c index ab0230f69a..75eaec73c1 100644 --- a/cpukit/posix/src/mutexunlock.c +++ b/cpukit/posix/src/mutexunlock.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Locking and Unlocking a Mutex + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/prwlocktimedrdlock.c b/cpukit/posix/src/prwlocktimedrdlock.c index 6bb397ad11..95a3fa5423 100644 --- a/cpukit/posix/src/prwlocktimedrdlock.c +++ b/cpukit/posix/src/prwlocktimedrdlock.c @@ -1,6 +1,11 @@ -/* - * POSIX RWLock Manager -- Attempt to Obtain a Read Lock on a RWLock Instance +/** + * @file * + * @brief Attempt to Obtain a Read Lock on a RWLock Instance + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/psignalclearsignals.c b/cpukit/posix/src/psignalclearsignals.c index 390bcd1579..e71f2fa575 100644 --- a/cpukit/posix/src/psignalclearsignals.c +++ b/cpukit/posix/src/psignalclearsignals.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Signals Clear Signals + * @ingroup POSIX_SIGNALS POSIX Signals Support + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/psxtransschedparam.c b/cpukit/posix/src/psxtransschedparam.c index 059a7fb728..3c42ee15e3 100644 --- a/cpukit/posix/src/psxtransschedparam.c +++ b/cpukit/posix/src/psxtransschedparam.c @@ -1,4 +1,12 @@ -/* COPYRIGHT (c) 1989-2009. +/** + * @file + * + * @brief Translate sched_param into SuperCore Terms + * @ingroup POSIX_PTHREAD Private POSIX Threads + */ + +/* + * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be diff --git a/cpukit/posix/src/pthreadattrdestroy.c b/cpukit/posix/src/pthreadattrdestroy.c index 0852b29ec7..27d58ccec7 100644 --- a/cpukit/posix/src/pthreadattrdestroy.c +++ b/cpukit/posix/src/pthreadattrdestroy.c @@ -1,6 +1,11 @@ -/* - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 +/** + * @file * + * @brief Thread Creation Attributes + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/pthreadattrgetguardsize.c b/cpukit/posix/src/pthreadattrgetguardsize.c index 72211cdf9a..81eee4f9f9 100644 --- a/cpukit/posix/src/pthreadattrgetguardsize.c +++ b/cpukit/posix/src/pthreadattrgetguardsize.c @@ -1,6 +1,11 @@ -/* - * 16.1.1 Thread Creation Attributes +/** + * @file * + * @brief Thread Creation Attributes + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2010. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/pthreadattrgetinheritsched.c b/cpukit/posix/src/pthreadattrgetinheritsched.c index ae564650e6..84f1fa560f 100644 --- a/cpukit/posix/src/pthreadattrgetinheritsched.c +++ b/cpukit/posix/src/pthreadattrgetinheritsched.c @@ -1,6 +1,11 @@ -/* - * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 +/** + * @file * + * @brief Thread Creation Scheduling Attributes + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/pthreadattrgetstacksize.c b/cpukit/posix/src/pthreadattrgetstacksize.c index 9827933c51..06854ca54b 100644 --- a/cpukit/posix/src/pthreadattrgetstacksize.c +++ b/cpukit/posix/src/pthreadattrgetstacksize.c @@ -1,6 +1,11 @@ -/* - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 +/** + * @file * + * @brief Thread Creation Attributes + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/pthreadattrsetdetachstate.c b/cpukit/posix/src/pthreadattrsetdetachstate.c index e10d663815..a76d304a43 100644 --- a/cpukit/posix/src/pthreadattrsetdetachstate.c +++ b/cpukit/posix/src/pthreadattrsetdetachstate.c @@ -1,6 +1,11 @@ -/* - * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 +/** + * @file * + * @brief Thread Creation Attributes + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/sched_yield.c b/cpukit/posix/src/sched_yield.c index b2d61c53ce..1aa4713a85 100644 --- a/cpukit/posix/src/sched_yield.c +++ b/cpukit/posix/src/sched_yield.c @@ -1,6 +1,11 @@ -/* - * 13.3.5 Yield Processor, P1003.1b-1993, p. 257 +/** + * @file * + * @brief Yield Processor + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * diff --git a/cpukit/posix/src/semtimedwait.c b/cpukit/posix/src/semtimedwait.c index 33008366f5..9f54ad3add 100644 --- a/cpukit/posix/src/semtimedwait.c +++ b/cpukit/posix/src/semtimedwait.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Lock a Semaphore + * @ingroup POSIX_SEMAPHORE POSIX Semaphores Support + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/sigismember.c b/cpukit/posix/src/sigismember.c index 545df3ec28..5591085af4 100644 --- a/cpukit/posix/src/sigismember.c +++ b/cpukit/posix/src/sigismember.c @@ -1,6 +1,11 @@ -/* - * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69 +/** + * @file * + * @brief Manipulate Signal Sets + * @ingroup POSIX + */ + +/* * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * -- cgit v1.2.3 From f95d74a4ad782371b4f6fe63b93bf9bb8acc70b7 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Sun, 16 Dec 2012 17:33:57 +0100 Subject: libtests/md501: New test --- testsuites/libtests/Makefile.am | 1 + testsuites/libtests/configure.ac | 1 + testsuites/libtests/md501/Makefile.am | 19 +++ testsuites/libtests/md501/init.c | 215 ++++++++++++++++++++++++++++++++++ testsuites/libtests/md501/md501.doc | 13 ++ testsuites/libtests/md501/md501.scn | 2 + 6 files changed, 251 insertions(+) create mode 100644 testsuites/libtests/md501/Makefile.am create mode 100644 testsuites/libtests/md501/init.c create mode 100644 testsuites/libtests/md501/md501.doc create mode 100644 testsuites/libtests/md501/md501.scn diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am index 119774277b..f6f1b0d5a6 100644 --- a/testsuites/libtests/Makefile.am +++ b/testsuites/libtests/Makefile.am @@ -1,6 +1,7 @@ ACLOCAL_AMFLAGS = -I ../aclocal SUBDIRS = POSIX +SUBDIRS += md501 SUBDIRS += sparsedisk01 SUBDIRS += block16 SUBDIRS += block15 diff --git a/testsuites/libtests/configure.ac b/testsuites/libtests/configure.ac index b8be927f47..b07b9bc3df 100644 --- a/testsuites/libtests/configure.ac +++ b/testsuites/libtests/configure.ac @@ -43,6 +43,7 @@ AM_CONDITIONAL(HAS_POSIX,test x"${rtems_cv_RTEMS_POSIX_API}" = x"yes") # Explicitly list all Makefiles here AC_CONFIG_FILES([Makefile +md501/Makefile sparsedisk01/Makefile block16/Makefile mghttpd01/Makefile diff --git a/testsuites/libtests/md501/Makefile.am b/testsuites/libtests/md501/Makefile.am new file mode 100644 index 0000000000..5751738069 --- /dev/null +++ b/testsuites/libtests/md501/Makefile.am @@ -0,0 +1,19 @@ +rtems_tests_PROGRAMS = md501 +md501_SOURCES = init.c + +dist_rtems_tests_DATA = md501.scn md501.doc + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/leaf.am + +AM_CPPFLAGS += -I$(top_srcdir)/../support/include + +LINK_OBJS = $(md501_OBJECTS) +LINK_LIBS = $(md501_LDLIBS) + +md501$(EXEEXT): $(md501_OBJECTS) $(md501_DEPENDENCIES) + @rm -f md501$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/libtests/md501/init.c b/testsuites/libtests/md501/init.c new file mode 100644 index 0000000000..6f8b6bf392 --- /dev/null +++ b/testsuites/libtests/md501/init.c @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2012 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Obere Lagerstr. 30 + * 82178 Puchheim + * Germany + * + * + * 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. + */ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "tmacros.h" + +#include + +static const uint32_t sample_data[] = { + 0U, + 1U, + 1U, + 2U, + 3U, + 5U, + 8U, + 13U, + 21U, + 34U, + 55U, + 89U, + 144U, + 233U, + 377U, + 610U, + 987U, + 1597U, + 2584U, + 4181U, + 6765U, + 10946U, + 17711U, + 28657U, + 46368U, + 75025U, + 121393U, + 196418U, + 317811U, + 514229U, + 832040U, + 1346269U, + 2178309U, + 3524578U, + 5702887U, + 9227465U, + 14930352U, + 24157817U, + 39088169U, + 63245986U, + 102334155U, + 165580141U, + 267914296U, + 433494437U, + 701408733U, + 1134903170U, + 1836311903U, + 2971215073U +}; + +static const uint8_t +expected_digests[RTEMS_ARRAY_SIZE(sample_data)][16] = { + { 0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04, + 0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e }, + { 0x93, 0xb8, 0x85, 0xad, 0xfe, 0x0d, 0xa0, 0x89, + 0xcd, 0xf6, 0x34, 0x90, 0x4f, 0xd5, 0x9f, 0x71 }, + { 0xc4, 0x10, 0x3f, 0x12, 0x2d, 0x27, 0x67, 0x7c, + 0x9d, 0xb1, 0x44, 0xca, 0xe1, 0x39, 0x4a, 0x66 }, + { 0x69, 0x3e, 0x9a, 0xf8, 0x4d, 0x3d, 0xfc, 0xc7, + 0x1e, 0x64, 0x0e, 0x00, 0x5b, 0xdc, 0x5e, 0x2e }, + { 0xf1, 0xd3, 0xff, 0x84, 0x43, 0x29, 0x77, 0x32, + 0x86, 0x2d, 0xf2, 0x1d, 0xc4, 0xe5, 0x72, 0x62 }, + { 0xca, 0x9c, 0x49, 0x1a, 0xc6, 0x6b, 0x2c, 0x62, + 0x50, 0x08, 0x82, 0xe9, 0x3f, 0x37, 0x19, 0xa8 }, + { 0x73, 0x19, 0x46, 0x88, 0x47, 0xd7, 0xb1, 0xae, + 0xe4, 0x0d, 0xbf, 0x5d, 0xd9, 0x63, 0xc9, 0x99 }, + { 0xd3, 0x10, 0xa4, 0x04, 0x83, 0xf9, 0x39, 0x9d, + 0xd7, 0xed, 0x17, 0x12, 0xe0, 0xfd, 0xd7, 0x02 }, + { 0xfa, 0x5a, 0xd9, 0xa8, 0x55, 0x7e, 0x5a, 0x84, + 0xcf, 0x23, 0xe5, 0x2d, 0x3d, 0x3a, 0xdf, 0x77 }, + { 0x7d, 0x54, 0x9f, 0x72, 0x14, 0x2d, 0xc6, 0xd3, + 0x55, 0xff, 0x74, 0x2e, 0xdf, 0xe0, 0xd2, 0x4c }, + { 0xdc, 0x3e, 0xd0, 0xe0, 0x41, 0x89, 0x4e, 0x29, + 0xac, 0xfd, 0xb8, 0xf6, 0xf0, 0xd7, 0xcb, 0x06 }, + { 0x32, 0xe0, 0x77, 0xfa, 0xba, 0x23, 0x2f, 0x08, + 0xb1, 0x6a, 0xe0, 0x82, 0xaf, 0xd1, 0x66, 0x25 }, + { 0x9e, 0x7f, 0x6f, 0xa5, 0xa4, 0x5d, 0xad, 0x95, + 0xf3, 0xa7, 0x2e, 0x1c, 0x5a, 0xec, 0x89, 0x36 }, + { 0xcb, 0x7d, 0xab, 0x55, 0xe7, 0x17, 0x7d, 0xf2, + 0xc7, 0x28, 0xa1, 0x7b, 0xef, 0xe9, 0x04, 0xe9 }, + { 0x5c, 0x90, 0x2d, 0x82, 0x30, 0x42, 0x74, 0xc5, + 0x71, 0x21, 0xfb, 0x7b, 0x3e, 0x0e, 0x02, 0x5f }, + { 0x5c, 0x49, 0xa3, 0xd4, 0xa3, 0x19, 0xc5, 0x61, + 0x3f, 0x1a, 0x00, 0x1b, 0x50, 0xc5, 0xff, 0x69 }, + { 0xc9, 0xf9, 0xc8, 0xba, 0x6f, 0x99, 0x68, 0x56, + 0x25, 0x84, 0x3b, 0xdc, 0x10, 0x3c, 0xef, 0x5d }, + { 0x1f, 0xfa, 0x2f, 0x79, 0xbc, 0x11, 0xbb, 0x25, + 0xed, 0x71, 0x24, 0x4b, 0xb6, 0x98, 0x43, 0x4d }, + { 0xe3, 0x7d, 0xca, 0x05, 0x2c, 0x66, 0xb6, 0x94, + 0xb6, 0x1d, 0x4e, 0xb8, 0xcf, 0x96, 0x4f, 0x92 }, + { 0xe1, 0x87, 0xd2, 0xe8, 0x01, 0xf1, 0xa8, 0x8a, + 0x85, 0x75, 0x88, 0x53, 0x1e, 0x89, 0xba, 0x5b }, + { 0x9f, 0xe1, 0x02, 0x79, 0x78, 0x66, 0xde, 0xc1, + 0xa8, 0x19, 0x43, 0xbb, 0x12, 0xa6, 0x83, 0x25 }, + { 0xd2, 0xc9, 0xb2, 0xc2, 0x33, 0x6b, 0xe6, 0x00, + 0x54, 0xd9, 0xee, 0xdc, 0x73, 0x56, 0x63, 0x5a }, + { 0x8d, 0x22, 0x28, 0x5d, 0x43, 0x7e, 0x5e, 0x7c, + 0xc7, 0x95, 0x99, 0x14, 0x6e, 0xdb, 0x0b, 0x8e }, + { 0xb0, 0x94, 0x12, 0xcf, 0xac, 0xb8, 0x62, 0x66, + 0x82, 0x42, 0xda, 0x19, 0x2d, 0xf4, 0x9c, 0xfc }, + { 0x6d, 0xe2, 0xdb, 0x98, 0x90, 0x1c, 0xd1, 0xa0, + 0x33, 0x5b, 0xe8, 0x41, 0x85, 0xf6, 0xb0, 0xa9 }, + { 0xdd, 0x5a, 0x0e, 0x73, 0x04, 0x50, 0x0c, 0x82, + 0x1c, 0xac, 0x16, 0x7a, 0xfc, 0x2c, 0x49, 0x9b }, + { 0x50, 0xb1, 0x37, 0xe3, 0x2b, 0x8d, 0x73, 0x0e, + 0x71, 0xef, 0x80, 0x04, 0x77, 0xe3, 0x33, 0x88 }, + { 0x34, 0xb4, 0x5c, 0xc2, 0xc5, 0x9f, 0xa1, 0x38, + 0x7a, 0x63, 0x72, 0x2d, 0x27, 0x9d, 0x7e, 0xe2 }, + { 0x1d, 0x80, 0x21, 0xb2, 0x30, 0x62, 0x00, 0xd0, + 0x7f, 0x44, 0x7b, 0x02, 0x13, 0x84, 0x46, 0x06 }, + { 0xa9, 0x26, 0xa4, 0x59, 0x8f, 0xe3, 0x72, 0x63, + 0xa9, 0xf3, 0xd9, 0xe1, 0x71, 0x8d, 0x53, 0x04 }, + { 0xbb, 0xcf, 0xc7, 0xe1, 0xb1, 0x05, 0x83, 0x36, + 0x06, 0xd4, 0xc1, 0x7b, 0x59, 0x9b, 0x38, 0xd3 }, + { 0xe1, 0xb8, 0xab, 0x14, 0x9f, 0x77, 0x78, 0x48, + 0x52, 0x46, 0xad, 0x11, 0x0d, 0x14, 0x1e, 0x5f }, + { 0x8e, 0xeb, 0x2d, 0xe2, 0x6d, 0xf3, 0xe0, 0xff, + 0x77, 0x35, 0x46, 0x58, 0xb5, 0xa7, 0xa9, 0x81 }, + { 0xe6, 0x5a, 0xd2, 0x29, 0x38, 0x38, 0xc4, 0x49, + 0x34, 0xad, 0x74, 0x93, 0x1b, 0x22, 0x4e, 0xd2 }, + { 0x72, 0xb3, 0x93, 0xea, 0xfb, 0xcd, 0xa3, 0xb6, + 0x42, 0xd9, 0xd4, 0x32, 0xcf, 0x14, 0x0d, 0x99 }, + { 0xd6, 0xc2, 0x60, 0x2f, 0x28, 0xc2, 0xc8, 0x79, + 0x3b, 0x98, 0x8b, 0x33, 0x5f, 0x55, 0xe5, 0xc6 }, + { 0x48, 0xa4, 0x0f, 0xc1, 0x6e, 0xe1, 0x9b, 0xbd, + 0x5f, 0x55, 0x2f, 0x1d, 0x66, 0x0d, 0x6f, 0x2e }, + { 0x65, 0x85, 0x50, 0x04, 0xb5, 0xa6, 0x14, 0x93, + 0xb4, 0xe3, 0x32, 0x49, 0x08, 0x27, 0x1a, 0xd4 }, + { 0xd1, 0xb2, 0xe5, 0xcd, 0x38, 0x11, 0xec, 0x0f, + 0xe4, 0x84, 0x11, 0x46, 0x6c, 0x2e, 0x8d, 0x13 }, + { 0x59, 0x3d, 0x1e, 0x9c, 0x81, 0x51, 0x1d, 0x30, + 0x93, 0x57, 0xaf, 0xde, 0x1f, 0x91, 0x15, 0x11 }, + { 0x57, 0x9d, 0x78, 0xd1, 0xf3, 0xc9, 0xa1, 0xdf, + 0x0c, 0x68, 0x70, 0x60, 0x4b, 0xab, 0xa4, 0xb4 }, + { 0xba, 0x86, 0x0d, 0xd4, 0xda, 0xc8, 0x3e, 0x7a, + 0x5c, 0xa5, 0xda, 0x2b, 0x51, 0x12, 0xca, 0xfb }, + { 0xda, 0x10, 0xff, 0x74, 0x10, 0xfe, 0x79, 0xa3, + 0x33, 0x68, 0xac, 0x10, 0x99, 0x13, 0xc8, 0x2a }, + { 0xc5, 0x47, 0xa0, 0xd7, 0x8b, 0xcd, 0xc4, 0xc5, + 0xdb, 0x0d, 0x5c, 0xba, 0x21, 0xba, 0xa9, 0x68 }, + { 0x8f, 0xa8, 0x7b, 0x3d, 0xfd, 0xd3, 0x41, 0x6b, + 0xa7, 0x3f, 0xb0, 0x25, 0x7d, 0xe4, 0xa7, 0x48 }, + { 0xc9, 0x64, 0x99, 0x9c, 0xaa, 0x54, 0x7c, 0x95, + 0xd0, 0x78, 0x97, 0x16, 0xfe, 0x55, 0xf7, 0x99 }, + { 0xa4, 0xea, 0xa3, 0x20, 0xb7, 0xa2, 0x71, 0xb7, + 0xdd, 0x59, 0xca, 0x81, 0xe8, 0x19, 0x04, 0xb3 }, + { 0x11, 0x99, 0x0a, 0xab, 0x09, 0xa0, 0x7d, 0x96, + 0x9e, 0x0a, 0xe6, 0x07, 0xe5, 0x6b, 0xfb, 0x7c } +}; + +static void test(void) +{ + size_t n = RTEMS_ARRAY_SIZE(sample_data); + size_t i; + + for (i = 0; i < n; ++i) { + uint8_t digest[16]; + MD5_CTX ctx; + + MD5Init(&ctx); + MD5Update(&ctx, &sample_data [0], i); + MD5Final(&digest [0], &ctx); + + rtems_test_assert( + memcmp(&digest[0], &expected_digests[i][0], sizeof(digest)) == 0 + ); + } +} + +static void Init(rtems_task_argument arg) +{ + puts("\n\n*** TEST MD5 1 ***"); + + test(); + + puts("*** END OF TEST MD5 1 ***"); + + rtems_test_exit(0); +} + +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER + +#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM + +#define CONFIGURE_MAXIMUM_TASKS 1 + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT + +#include diff --git a/testsuites/libtests/md501/md501.doc b/testsuites/libtests/md501/md501.doc new file mode 100644 index 0000000000..fcb994bc34 --- /dev/null +++ b/testsuites/libtests/md501/md501.doc @@ -0,0 +1,13 @@ +This file describes the directives and concepts tested by this test set. + +test set name: md501 + +directives: + + - MD5Init + - MD5Update + - MD5Final + +concepts: + + - Ensures that the MD5 digest is calucated correctly for a sample data set. diff --git a/testsuites/libtests/md501/md501.scn b/testsuites/libtests/md501/md501.scn new file mode 100644 index 0000000000..3a7d31819f --- /dev/null +++ b/testsuites/libtests/md501/md501.scn @@ -0,0 +1,2 @@ +*** TEST MD5 1 *** +*** END OF TEST MD5 1 *** -- cgit v1.2.3 From c40f36b08b9203735ca5018e306c2493e99b7220 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Sun, 16 Dec 2012 21:34:13 +0100 Subject: libtests/md501: Use test cases of RFC 2202 --- testsuites/libtests/md501/init.c | 359 ++++++++++++++++++++---------------- testsuites/libtests/md501/md501.doc | 1 + 2 files changed, 200 insertions(+), 160 deletions(-) diff --git a/testsuites/libtests/md501/init.c b/testsuites/libtests/md501/init.c index 6f8b6bf392..cf888fba05 100644 --- a/testsuites/libtests/md501/init.c +++ b/testsuites/libtests/md501/init.c @@ -20,174 +20,213 @@ #include -static const uint32_t sample_data[] = { - 0U, - 1U, - 1U, - 2U, - 3U, - 5U, - 8U, - 13U, - 21U, - 34U, - 55U, - 89U, - 144U, - 233U, - 377U, - 610U, - 987U, - 1597U, - 2584U, - 4181U, - 6765U, - 10946U, - 17711U, - 28657U, - 46368U, - 75025U, - 121393U, - 196418U, - 317811U, - 514229U, - 832040U, - 1346269U, - 2178309U, - 3524578U, - 5702887U, - 9227465U, - 14930352U, - 24157817U, - 39088169U, - 63245986U, - 102334155U, - 165580141U, - 267914296U, - 433494437U, - 701408733U, - 1134903170U, - 1836311903U, - 2971215073U -}; - -static const uint8_t -expected_digests[RTEMS_ARRAY_SIZE(sample_data)][16] = { - { 0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04, - 0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e }, - { 0x93, 0xb8, 0x85, 0xad, 0xfe, 0x0d, 0xa0, 0x89, - 0xcd, 0xf6, 0x34, 0x90, 0x4f, 0xd5, 0x9f, 0x71 }, - { 0xc4, 0x10, 0x3f, 0x12, 0x2d, 0x27, 0x67, 0x7c, - 0x9d, 0xb1, 0x44, 0xca, 0xe1, 0x39, 0x4a, 0x66 }, - { 0x69, 0x3e, 0x9a, 0xf8, 0x4d, 0x3d, 0xfc, 0xc7, - 0x1e, 0x64, 0x0e, 0x00, 0x5b, 0xdc, 0x5e, 0x2e }, - { 0xf1, 0xd3, 0xff, 0x84, 0x43, 0x29, 0x77, 0x32, - 0x86, 0x2d, 0xf2, 0x1d, 0xc4, 0xe5, 0x72, 0x62 }, - { 0xca, 0x9c, 0x49, 0x1a, 0xc6, 0x6b, 0x2c, 0x62, - 0x50, 0x08, 0x82, 0xe9, 0x3f, 0x37, 0x19, 0xa8 }, - { 0x73, 0x19, 0x46, 0x88, 0x47, 0xd7, 0xb1, 0xae, - 0xe4, 0x0d, 0xbf, 0x5d, 0xd9, 0x63, 0xc9, 0x99 }, - { 0xd3, 0x10, 0xa4, 0x04, 0x83, 0xf9, 0x39, 0x9d, - 0xd7, 0xed, 0x17, 0x12, 0xe0, 0xfd, 0xd7, 0x02 }, - { 0xfa, 0x5a, 0xd9, 0xa8, 0x55, 0x7e, 0x5a, 0x84, - 0xcf, 0x23, 0xe5, 0x2d, 0x3d, 0x3a, 0xdf, 0x77 }, - { 0x7d, 0x54, 0x9f, 0x72, 0x14, 0x2d, 0xc6, 0xd3, - 0x55, 0xff, 0x74, 0x2e, 0xdf, 0xe0, 0xd2, 0x4c }, - { 0xdc, 0x3e, 0xd0, 0xe0, 0x41, 0x89, 0x4e, 0x29, - 0xac, 0xfd, 0xb8, 0xf6, 0xf0, 0xd7, 0xcb, 0x06 }, - { 0x32, 0xe0, 0x77, 0xfa, 0xba, 0x23, 0x2f, 0x08, - 0xb1, 0x6a, 0xe0, 0x82, 0xaf, 0xd1, 0x66, 0x25 }, - { 0x9e, 0x7f, 0x6f, 0xa5, 0xa4, 0x5d, 0xad, 0x95, - 0xf3, 0xa7, 0x2e, 0x1c, 0x5a, 0xec, 0x89, 0x36 }, - { 0xcb, 0x7d, 0xab, 0x55, 0xe7, 0x17, 0x7d, 0xf2, - 0xc7, 0x28, 0xa1, 0x7b, 0xef, 0xe9, 0x04, 0xe9 }, - { 0x5c, 0x90, 0x2d, 0x82, 0x30, 0x42, 0x74, 0xc5, - 0x71, 0x21, 0xfb, 0x7b, 0x3e, 0x0e, 0x02, 0x5f }, - { 0x5c, 0x49, 0xa3, 0xd4, 0xa3, 0x19, 0xc5, 0x61, - 0x3f, 0x1a, 0x00, 0x1b, 0x50, 0xc5, 0xff, 0x69 }, - { 0xc9, 0xf9, 0xc8, 0xba, 0x6f, 0x99, 0x68, 0x56, - 0x25, 0x84, 0x3b, 0xdc, 0x10, 0x3c, 0xef, 0x5d }, - { 0x1f, 0xfa, 0x2f, 0x79, 0xbc, 0x11, 0xbb, 0x25, - 0xed, 0x71, 0x24, 0x4b, 0xb6, 0x98, 0x43, 0x4d }, - { 0xe3, 0x7d, 0xca, 0x05, 0x2c, 0x66, 0xb6, 0x94, - 0xb6, 0x1d, 0x4e, 0xb8, 0xcf, 0x96, 0x4f, 0x92 }, - { 0xe1, 0x87, 0xd2, 0xe8, 0x01, 0xf1, 0xa8, 0x8a, - 0x85, 0x75, 0x88, 0x53, 0x1e, 0x89, 0xba, 0x5b }, - { 0x9f, 0xe1, 0x02, 0x79, 0x78, 0x66, 0xde, 0xc1, - 0xa8, 0x19, 0x43, 0xbb, 0x12, 0xa6, 0x83, 0x25 }, - { 0xd2, 0xc9, 0xb2, 0xc2, 0x33, 0x6b, 0xe6, 0x00, - 0x54, 0xd9, 0xee, 0xdc, 0x73, 0x56, 0x63, 0x5a }, - { 0x8d, 0x22, 0x28, 0x5d, 0x43, 0x7e, 0x5e, 0x7c, - 0xc7, 0x95, 0x99, 0x14, 0x6e, 0xdb, 0x0b, 0x8e }, - { 0xb0, 0x94, 0x12, 0xcf, 0xac, 0xb8, 0x62, 0x66, - 0x82, 0x42, 0xda, 0x19, 0x2d, 0xf4, 0x9c, 0xfc }, - { 0x6d, 0xe2, 0xdb, 0x98, 0x90, 0x1c, 0xd1, 0xa0, - 0x33, 0x5b, 0xe8, 0x41, 0x85, 0xf6, 0xb0, 0xa9 }, - { 0xdd, 0x5a, 0x0e, 0x73, 0x04, 0x50, 0x0c, 0x82, - 0x1c, 0xac, 0x16, 0x7a, 0xfc, 0x2c, 0x49, 0x9b }, - { 0x50, 0xb1, 0x37, 0xe3, 0x2b, 0x8d, 0x73, 0x0e, - 0x71, 0xef, 0x80, 0x04, 0x77, 0xe3, 0x33, 0x88 }, - { 0x34, 0xb4, 0x5c, 0xc2, 0xc5, 0x9f, 0xa1, 0x38, - 0x7a, 0x63, 0x72, 0x2d, 0x27, 0x9d, 0x7e, 0xe2 }, - { 0x1d, 0x80, 0x21, 0xb2, 0x30, 0x62, 0x00, 0xd0, - 0x7f, 0x44, 0x7b, 0x02, 0x13, 0x84, 0x46, 0x06 }, - { 0xa9, 0x26, 0xa4, 0x59, 0x8f, 0xe3, 0x72, 0x63, - 0xa9, 0xf3, 0xd9, 0xe1, 0x71, 0x8d, 0x53, 0x04 }, - { 0xbb, 0xcf, 0xc7, 0xe1, 0xb1, 0x05, 0x83, 0x36, - 0x06, 0xd4, 0xc1, 0x7b, 0x59, 0x9b, 0x38, 0xd3 }, - { 0xe1, 0xb8, 0xab, 0x14, 0x9f, 0x77, 0x78, 0x48, - 0x52, 0x46, 0xad, 0x11, 0x0d, 0x14, 0x1e, 0x5f }, - { 0x8e, 0xeb, 0x2d, 0xe2, 0x6d, 0xf3, 0xe0, 0xff, - 0x77, 0x35, 0x46, 0x58, 0xb5, 0xa7, 0xa9, 0x81 }, - { 0xe6, 0x5a, 0xd2, 0x29, 0x38, 0x38, 0xc4, 0x49, - 0x34, 0xad, 0x74, 0x93, 0x1b, 0x22, 0x4e, 0xd2 }, - { 0x72, 0xb3, 0x93, 0xea, 0xfb, 0xcd, 0xa3, 0xb6, - 0x42, 0xd9, 0xd4, 0x32, 0xcf, 0x14, 0x0d, 0x99 }, - { 0xd6, 0xc2, 0x60, 0x2f, 0x28, 0xc2, 0xc8, 0x79, - 0x3b, 0x98, 0x8b, 0x33, 0x5f, 0x55, 0xe5, 0xc6 }, - { 0x48, 0xa4, 0x0f, 0xc1, 0x6e, 0xe1, 0x9b, 0xbd, - 0x5f, 0x55, 0x2f, 0x1d, 0x66, 0x0d, 0x6f, 0x2e }, - { 0x65, 0x85, 0x50, 0x04, 0xb5, 0xa6, 0x14, 0x93, - 0xb4, 0xe3, 0x32, 0x49, 0x08, 0x27, 0x1a, 0xd4 }, - { 0xd1, 0xb2, 0xe5, 0xcd, 0x38, 0x11, 0xec, 0x0f, - 0xe4, 0x84, 0x11, 0x46, 0x6c, 0x2e, 0x8d, 0x13 }, - { 0x59, 0x3d, 0x1e, 0x9c, 0x81, 0x51, 0x1d, 0x30, - 0x93, 0x57, 0xaf, 0xde, 0x1f, 0x91, 0x15, 0x11 }, - { 0x57, 0x9d, 0x78, 0xd1, 0xf3, 0xc9, 0xa1, 0xdf, - 0x0c, 0x68, 0x70, 0x60, 0x4b, 0xab, 0xa4, 0xb4 }, - { 0xba, 0x86, 0x0d, 0xd4, 0xda, 0xc8, 0x3e, 0x7a, - 0x5c, 0xa5, 0xda, 0x2b, 0x51, 0x12, 0xca, 0xfb }, - { 0xda, 0x10, 0xff, 0x74, 0x10, 0xfe, 0x79, 0xa3, - 0x33, 0x68, 0xac, 0x10, 0x99, 0x13, 0xc8, 0x2a }, - { 0xc5, 0x47, 0xa0, 0xd7, 0x8b, 0xcd, 0xc4, 0xc5, - 0xdb, 0x0d, 0x5c, 0xba, 0x21, 0xba, 0xa9, 0x68 }, - { 0x8f, 0xa8, 0x7b, 0x3d, 0xfd, 0xd3, 0x41, 0x6b, - 0xa7, 0x3f, 0xb0, 0x25, 0x7d, 0xe4, 0xa7, 0x48 }, - { 0xc9, 0x64, 0x99, 0x9c, 0xaa, 0x54, 0x7c, 0x95, - 0xd0, 0x78, 0x97, 0x16, 0xfe, 0x55, 0xf7, 0x99 }, - { 0xa4, 0xea, 0xa3, 0x20, 0xb7, 0xa2, 0x71, 0xb7, - 0xdd, 0x59, 0xca, 0x81, 0xe8, 0x19, 0x04, 0xb3 }, - { 0x11, 0x99, 0x0a, 0xab, 0x09, 0xa0, 0x7d, 0x96, - 0x9e, 0x0a, 0xe6, 0x07, 0xe5, 0x6b, 0xfb, 0x7c } +#ifndef MD5_BLOCK_SIZE + #define MD5_BLOCK_SIZE 64 +#endif + +#ifndef MD5_DIGEST_LENGTH + #define MD5_DIGEST_LENGTH 16 +#endif + +/* Test cases according to RFC 2202 */ + +static const uint8_t key_1[] = { + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + 0x0b, 0x0b, 0x0b }; -static void test(void) +static const uint8_t data_1[] = { + 'H', 'i', ' ', 'T', 'h', 'e', 'r', 'e' +}; + +static const uint8_t digest_1[MD5_DIGEST_LENGTH] = { + 0x92, 0x94, 0x72, 0x7a, 0x36, 0x38, 0xbb, 0x1c, 0x13, 0xf4, 0x8e, 0xf8, 0x15, + 0x8b, 0xfc, 0x9d +}; + +static const uint8_t key_2[] = { + 'J', 'e', 'f', 'e' +}; + +static const uint8_t data_2[] = { + 'w', 'h', 'a', 't', ' ', 'd', 'o', ' ', 'y', 'a', ' ', 'w', 'a', 'n', 't', + ' ', 'f', 'o', 'r', ' ', 'n', 'o', 't', 'h', 'i', 'n', 'g', '?' +}; + +static const uint8_t digest_2[MD5_DIGEST_LENGTH] = { + 0x75, 0x0c, 0x78, 0x3e, 0x6a, 0xb0, 0xb5, 0x03, 0xea, 0xa8, 0x6e, 0x31, 0x0a, + 0x5d, 0xb7, 0x38 +}; + +static const uint8_t key_3[] = { + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa +}; + +static const uint8_t data_3[] = { + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd +}; + +static const uint8_t digest_3[MD5_DIGEST_LENGTH] = { + 0x56, 0xbe, 0x34, 0x52, 0x1d, 0x14, 0x4c, 0x88, 0xdb, 0xb8, 0xc7, 0x33, 0xf0, + 0xe8, 0xb3, 0xf6 +}; + +static const uint8_t key_4[] = { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, + 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19 +}; + +static const uint8_t data_4[] = { + 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, + 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, + 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, + 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd +}; + +static const uint8_t digest_4[MD5_DIGEST_LENGTH] = { + 0x69, 0x7e, 0xaf, 0x0a, 0xca, 0x3a, 0x3a, 0xea, 0x3a, 0x75, 0x16, 0x47, 0x46, + 0xff, 0xaa, 0x79 +}; + +static const uint8_t key_5[] = { + 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, + 0x0c, 0x0c, 0x0c +}; + +static const uint8_t data_5[] = { + 'T', 'e', 's', 't', ' ', 'W', 'i', 't', 'h', ' ', 'T', 'r', 'u', 'n', 'c', + 'a', 't', 'i', 'o', 'n' +}; + +static const uint8_t digest_5[MD5_DIGEST_LENGTH] = { + 0x56, 0x46, 0x1e, 0xf2, 0x34, 0x2e, 0xdc, 0x00, 0xf9, 0xba, 0xb9, 0x95, 0x69, + 0x0e, 0xfd, 0x4c +}; + +static const uint8_t key_6[] = { + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa +}; + +static const uint8_t data_6[] = { + 'T', 'e', 's', 't', ' ', 'U', 's', 'i', 'n', 'g', ' ', 'L', 'a', 'r', 'g', + 'e', 'r', ' ', 'T', 'h', 'a', 'n', ' ', 'B', 'l', 'o', 'c', 'k', '-', 'S', + 'i', 'z', 'e', ' ', 'K', 'e', 'y', ' ', '-', ' ', 'H', 'a', 's', 'h', ' ', + 'K', 'e', 'y', ' ', 'F', 'i', 'r', 's', 't' +}; + +static const uint8_t digest_6[MD5_DIGEST_LENGTH] = { + 0x6b, 0x1a, 0xb7, 0xfe, 0x4b, 0xd7, 0xbf, 0x8f, 0x0b, 0x62, 0xe6, 0xce, 0x61, + 0xb9, 0xd0, 0xcd +}; + +static const uint8_t key_7[] = { + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa +}; + +static const uint8_t data_7[] = { + 'T', 'e', 's', 't', ' ', 'U', 's', 'i', 'n', 'g', ' ', 'L', 'a', 'r', 'g', + 'e', 'r', ' ', 'T', 'h', 'a', 'n', ' ', 'B', 'l', 'o', 'c', 'k', '-', 'S', + 'i', 'z', 'e', ' ', 'K', 'e', 'y', ' ', 'a', 'n', 'd', ' ', 'L', 'a', 'r', + 'g', 'e', 'r', ' ', 'T', 'h', 'a', 'n', ' ', 'O', 'n', 'e', ' ', 'B', 'l', + 'o', 'c', 'k', '-', 'S', 'i', 'z', 'e', ' ', 'D', 'a', 't', 'a' +}; + +static const uint8_t digest_7[MD5_DIGEST_LENGTH] = { + 0x6f, 0x63, 0x0f, 0xad, 0x67, 0xcd, 0xa0, 0xee, 0x1f, 0xb1, 0xf5, 0x62, 0xdb, + 0x3a, 0xa5, 0x3e +}; + +static void test_md5( + const uint8_t *key, + size_t key_size, + const uint8_t *data, + size_t data_size, + const uint8_t expected_digest[MD5_DIGEST_LENGTH] +) { - size_t n = RTEMS_ARRAY_SIZE(sample_data); + MD5_CTX inner_ctx; + MD5_CTX outer_ctx; + uint8_t inner_digest[MD5_DIGEST_LENGTH]; + uint8_t outer_digest[MD5_DIGEST_LENGTH]; + uint8_t key_buf[MD5_DIGEST_LENGTH]; + uint8_t buf[MD5_BLOCK_SIZE]; size_t i; - for (i = 0; i < n; ++i) { - uint8_t digest[16]; - MD5_CTX ctx; + if (key_size > MD5_BLOCK_SIZE) { + MD5_CTX tmp_ctx; + + MD5Init(&tmp_ctx); + MD5Update(&tmp_ctx, key, key_size); + MD5Final(&key_buf[0], &tmp_ctx); + + key = &key_buf[0]; + key_size = MD5_DIGEST_LENGTH; + } + + /* Inner digest */ + + MD5Init(&inner_ctx); + + /* Pad the key for the inner digest */ + for (i = 0; i < key_size; ++i) { + buf[i] = key[i] ^ 0x36; + } + for (i = key_size; i < MD5_BLOCK_SIZE; ++i) { + buf[i] = 0x36; + } + + MD5Update(&inner_ctx, &buf[0], MD5_BLOCK_SIZE); + MD5Update(&inner_ctx, data, data_size); + + MD5Final(&inner_digest[0], &inner_ctx); + + /* Outer digest */ - MD5Init(&ctx); - MD5Update(&ctx, &sample_data [0], i); - MD5Final(&digest [0], &ctx); + MD5Init(&outer_ctx); - rtems_test_assert( - memcmp(&digest[0], &expected_digests[i][0], sizeof(digest)) == 0 - ); + /* Pad the key for outer digest */ + for (i = 0; i < key_size; ++i) { + buf[i] = key[i] ^ 0x5c; } + for (i = key_size; i < MD5_BLOCK_SIZE; ++i) { + buf[i] = 0x5c; + } + + MD5Update(&outer_ctx, &buf[0], MD5_BLOCK_SIZE); + MD5Update(&outer_ctx, &inner_digest[0], MD5_DIGEST_LENGTH); + + MD5Final(&outer_digest[0], &outer_ctx); + + rtems_test_assert( + memcmp(&outer_digest[0], expected_digest, sizeof(outer_digest)) == 0 + ); +} + +static void test(void) +{ + test_md5(&key_1[0], sizeof(key_1), &data_1[0], sizeof(data_1), &digest_1[0]); + test_md5(&key_2[0], sizeof(key_2), &data_2[0], sizeof(data_2), &digest_2[0]); + test_md5(&key_3[0], sizeof(key_3), &data_3[0], sizeof(data_3), &digest_3[0]); + test_md5(&key_4[0], sizeof(key_4), &data_4[0], sizeof(data_4), &digest_4[0]); + test_md5(&key_5[0], sizeof(key_5), &data_5[0], sizeof(data_5), &digest_5[0]); + test_md5(&key_6[0], sizeof(key_6), &data_6[0], sizeof(data_6), &digest_6[0]); + test_md5(&key_7[0], sizeof(key_7), &data_7[0], sizeof(data_7), &digest_7[0]); } static void Init(rtems_task_argument arg) diff --git a/testsuites/libtests/md501/md501.doc b/testsuites/libtests/md501/md501.doc index fcb994bc34..62936e7243 100644 --- a/testsuites/libtests/md501/md501.doc +++ b/testsuites/libtests/md501/md501.doc @@ -11,3 +11,4 @@ directives: concepts: - Ensures that the MD5 digest is calucated correctly for a sample data set. + - Test cases are from RFC 2202. -- cgit v1.2.3 From ea4f072ef323fac64abeabc675e07c97b66b695b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Dec 2012 10:23:30 +0100 Subject: shell: Remove interface down warning in ifconfig Whether an interface down is supported or not depends on the interface driver. --- cpukit/libmisc/shell/main_ifconfig.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cpukit/libmisc/shell/main_ifconfig.c b/cpukit/libmisc/shell/main_ifconfig.c index dbf16183ff..d81d8b005a 100644 --- a/cpukit/libmisc/shell/main_ifconfig.c +++ b/cpukit/libmisc/shell/main_ifconfig.c @@ -218,10 +218,6 @@ static int rtems_shell_main_ifconfig( flags |= IFF_UP; } - if (f_down != 0) { - printf("Warning: taking interfaces down is not supported\n"); - } - rc = rtems_bsdnet_ifconfig(iface, SIOCSIFFLAGS, &flags); if (rc < 0) { printf("Could not set interface flags: %s\n", strerror(errno)); -- cgit v1.2.3 From 1edaa5fe7b2440f614dc5269f31394360d1a661e Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Dec 2012 12:01:47 +0100 Subject: libnetworking: Make functions public Make functions rtems_bsdnet_semaphore_obtain_recursive() and rtems_bsdnet_semaphore_release_recursive() public. --- cpukit/libnetworking/rtems/rtems_bsdnet_internal.h | 2 ++ cpukit/libnetworking/rtems/rtems_glue.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h index b477d7d654..05e54b272f 100644 --- a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h +++ b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h @@ -136,6 +136,8 @@ void rtems_bsdnet_free (void *addr, int type); void rtems_bsdnet_semaphore_obtain (void); void rtems_bsdnet_semaphore_release (void); +void rtems_bsdnet_semaphore_obtain_recursive (uint32_t nest_count); +uint32_t rtems_bsdnet_semaphore_release_recursive (void); void rtems_bsdnet_schednetisr (int n); int rtems_bsdnet_parse_driver_name (const struct rtems_bsdnet_ifconfig *config, char **namep); diff --git a/cpukit/libnetworking/rtems/rtems_glue.c b/cpukit/libnetworking/rtems/rtems_glue.c index 8380e4d410..95cabe4d27 100644 --- a/cpukit/libnetworking/rtems/rtems_glue.c +++ b/cpukit/libnetworking/rtems/rtems_glue.c @@ -111,7 +111,7 @@ rtems_bsdnet_initialize_sockaddr_in(struct sockaddr_in *addr) memcpy(addr, &address_template, sizeof(*addr)); } -static uint32_t +uint32_t rtems_bsdnet_semaphore_release_recursive(void) { #ifdef RTEMS_FAST_MUTEX @@ -128,7 +128,7 @@ rtems_bsdnet_semaphore_release_recursive(void) #endif } -static void +void rtems_bsdnet_semaphore_obtain_recursive(uint32_t nest_count) { uint32_t i; -- cgit v1.2.3 From f25d31f52b4c21d5bf2ea01642939e2a0b4ac08c Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 17 Dec 2012 16:40:23 +0100 Subject: bsp/lpc32xx: Add idle thread body --- c/src/lib/libbsp/arm/lpc32xx/Makefile.am | 1 + c/src/lib/libbsp/arm/lpc32xx/include/bsp.h | 4 +++ c/src/lib/libbsp/arm/lpc32xx/misc/idle-thread.c | 34 +++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 c/src/lib/libbsp/arm/lpc32xx/misc/idle-thread.c diff --git a/c/src/lib/libbsp/arm/lpc32xx/Makefile.am b/c/src/lib/libbsp/arm/lpc32xx/Makefile.am index 09c385d25a..37a4793b39 100644 --- a/c/src/lib/libbsp/arm/lpc32xx/Makefile.am +++ b/c/src/lib/libbsp/arm/lpc32xx/Makefile.am @@ -137,6 +137,7 @@ libbsp_a_SOURCES += misc/restart.c libbsp_a_SOURCES += misc/system-clocks.c libbsp_a_SOURCES += misc/timer.c libbsp_a_SOURCES += misc/nand-select.c +libbsp_a_SOURCES += misc/idle-thread.c # SSP diff --git a/c/src/lib/libbsp/arm/lpc32xx/include/bsp.h b/c/src/lib/libbsp/arm/lpc32xx/include/bsp.h index 5d9d18ac3b..5e6800f722 100644 --- a/c/src/lib/libbsp/arm/lpc32xx/include/bsp.h +++ b/c/src/lib/libbsp/arm/lpc32xx/include/bsp.h @@ -149,6 +149,10 @@ void lpc32xx_select_nand_controller(lpc32xx_nand_controller nand_controller); void bsp_restart(void *addr); +void *bsp_idle_thread(uintptr_t arg); + +#define BSP_IDLE_TASK_BODY bsp_idle_thread + #define BSP_CONSOLE_UART_BASE LPC32XX_BASE_UART_5 /** diff --git a/c/src/lib/libbsp/arm/lpc32xx/misc/idle-thread.c b/c/src/lib/libbsp/arm/lpc32xx/misc/idle-thread.c new file mode 100644 index 0000000000..0ac51c0f46 --- /dev/null +++ b/c/src/lib/libbsp/arm/lpc32xx/misc/idle-thread.c @@ -0,0 +1,34 @@ +/** + * @file + * + * @ingroup lpc32xx + * + * @brief bsp_idle_thread() implementation. + */ + +/* + * Copyright (c) 2012 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Obere Lagerstr. 30 + * 82178 Puchheim + * Germany + * + * + * 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. + */ + +#include + +#include + +void *bsp_idle_thread(uintptr_t arg) +{ + while (true) { + arm_cp15_wait_for_interrupt(); + } + + return NULL; +} -- cgit v1.2.3 From d1cf32676d1a155b1c49e047db0d91013c2b8c8f Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 18 Dec 2012 10:44:48 +0100 Subject: bsp/lpc32xx: Fix function prototype --- c/src/lib/libbsp/arm/lpc32xx/console/console-config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c/src/lib/libbsp/arm/lpc32xx/console/console-config.c b/c/src/lib/libbsp/arm/lpc32xx/console/console-config.c index 2428697604..812a2cc5b4 100644 --- a/c/src/lib/libbsp/arm/lpc32xx/console/console-config.c +++ b/c/src/lib/libbsp/arm/lpc32xx/console/console-config.c @@ -28,14 +28,14 @@ extern console_fns lpc32xx_hsu_fns; -static uint8_t lpc32xx_uart_get_register(uint32_t addr, uint8_t i) +static uint8_t lpc32xx_uart_get_register(uintptr_t addr, uint8_t i) { volatile uint32_t *reg = (volatile uint32_t *) addr; return (uint8_t) reg [i]; } -static void lpc32xx_uart_set_register(uint32_t addr, uint8_t i, uint8_t val) +static void lpc32xx_uart_set_register(uintptr_t addr, uint8_t i, uint8_t val) { volatile uint32_t *reg = (volatile uint32_t *) addr; -- cgit v1.2.3 From 380628ea0581c83dd3d34715f54cbd9bcdc9b96d Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 18 Dec 2012 10:45:13 +0100 Subject: bsp/lpc32xx: Configure U4_TX pin for UART 4 --- c/src/lib/libbsp/arm/lpc32xx/console/console-config.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/c/src/lib/libbsp/arm/lpc32xx/console/console-config.c b/c/src/lib/libbsp/arm/lpc32xx/console/console-config.c index 812a2cc5b4..1230dfd12f 100644 --- a/c/src/lib/libbsp/arm/lpc32xx/console/console-config.c +++ b/c/src/lib/libbsp/arm/lpc32xx/console/console-config.c @@ -55,6 +55,14 @@ static void lpc32xx_uart_set_register(uintptr_t addr, uint8_t i, uint8_t val) #ifdef LPC32XX_UART_4_BAUD static bool lpc32xx_uart_probe_4(int minor) { + volatile lpc32xx_gpio *gpio = &lpc32xx.gpio; + + /* + * Set GPO_21/U4_TX/LCDVD[3] to U4_TX. This works only if LCD module is + * disabled. + */ + gpio->p2_mux_set = BSP_BIT32(2); + LPC32XX_UARTCLK_CTRL |= 1U << 1; LPC32XX_U4CLK = LPC32XX_CONFIG_U4CLK; -- cgit v1.2.3 From c9562c593b485590774ad8a7c2564aaa64223ed3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 18 Dec 2012 11:18:40 +0100 Subject: bsp/lpc32xx: Add UART_CLKMODE settings --- c/src/lib/libbsp/arm/lpc32xx/console/console-config.c | 3 +++ c/src/lib/libbsp/arm/lpc32xx/startup/bspstarthooks.c | 1 + 2 files changed, 4 insertions(+) diff --git a/c/src/lib/libbsp/arm/lpc32xx/console/console-config.c b/c/src/lib/libbsp/arm/lpc32xx/console/console-config.c index 1230dfd12f..738f5d86de 100644 --- a/c/src/lib/libbsp/arm/lpc32xx/console/console-config.c +++ b/c/src/lib/libbsp/arm/lpc32xx/console/console-config.c @@ -47,6 +47,7 @@ static void lpc32xx_uart_set_register(uintptr_t addr, uint8_t i, uint8_t val) { LPC32XX_UARTCLK_CTRL |= 1U << 0; LPC32XX_U3CLK = LPC32XX_CONFIG_U3CLK; + LPC32XX_UART_CLKMODE = BSP_FLD32SET(LPC32XX_UART_CLKMODE, 0x2, 4, 5); return true; } @@ -65,6 +66,7 @@ static void lpc32xx_uart_set_register(uintptr_t addr, uint8_t i, uint8_t val) LPC32XX_UARTCLK_CTRL |= 1U << 1; LPC32XX_U4CLK = LPC32XX_CONFIG_U4CLK; + LPC32XX_UART_CLKMODE = BSP_FLD32SET(LPC32XX_UART_CLKMODE, 0x2, 6, 7); return true; } @@ -75,6 +77,7 @@ static void lpc32xx_uart_set_register(uintptr_t addr, uint8_t i, uint8_t val) { LPC32XX_UARTCLK_CTRL |= 1U << 3; LPC32XX_U6CLK = LPC32XX_CONFIG_U6CLK; + LPC32XX_UART_CLKMODE = BSP_FLD32SET(LPC32XX_UART_CLKMODE, 0x2, 10, 11); return true; } diff --git a/c/src/lib/libbsp/arm/lpc32xx/startup/bspstarthooks.c b/c/src/lib/libbsp/arm/lpc32xx/startup/bspstarthooks.c index 21b49de53e..acc24e9cc5 100644 --- a/c/src/lib/libbsp/arm/lpc32xx/startup/bspstarthooks.c +++ b/c/src/lib/libbsp/arm/lpc32xx/startup/bspstarthooks.c @@ -269,6 +269,7 @@ static BSP_START_TEXT_SECTION void setup_uarts(void) #ifdef LPC32XX_UART_5_BAUD LPC32XX_UARTCLK_CTRL |= 1U << 2; LPC32XX_U5CLK = LPC32XX_CONFIG_U5CLK; + LPC32XX_UART_CLKMODE = BSP_FLD32SET(LPC32XX_UART_CLKMODE, 0x2, 8, 9); BSP_CONSOLE_UART_INIT(0x01); #endif } -- cgit v1.2.3 From e5a7f8469a2c3f7ab7c092c387c02380e6bde453 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Dec 2012 09:40:44 +0100 Subject: bsps/arm: Avoid mbuf migration in LPC ethernet The receive task will only hand over a mbuf if it gets a new one immediately. This avoids mbuf migration out of the receive task in case of overload. --- .../libbsp/arm/shared/lpc/network/lpc-ethernet.c | 86 ++++++++-------------- 1 file changed, 30 insertions(+), 56 deletions(-) diff --git a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c index 56df8d4fef..b74f045ddc 100644 --- a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c +++ b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c @@ -7,7 +7,7 @@ */ /* - * Copyright (c) 2009-2011 embedded brains GmbH. All rights reserved. + * Copyright (c) 2009-2012 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Obere Lagerstr. 30 @@ -317,6 +317,7 @@ typedef struct { unsigned receive_interrupts; unsigned transmitted_frames; unsigned transmit_interrupts; + unsigned receive_drop_errors; unsigned receive_overrun_errors; unsigned receive_fragment_errors; unsigned receive_crc_errors; @@ -528,14 +529,11 @@ static void lpc_eth_receive_task(void *arg) uint32_t const index_max = e->rx_unit_count - 1; uint32_t produce_index = 0; uint32_t consume_index = 0; - uint32_t receive_index = 0; LPC_ETH_PRINTF("%s\n", __func__); /* Main event loop */ while (true) { - bool wait_for_mbuf = false; - /* Wait for events */ sc = rtems_bsdnet_event_receive( LPC_ETH_EVENT_INITIALIZE | LPC_ETH_EVENT_INTERRUPT, @@ -592,7 +590,6 @@ static void lpc_eth_receive_task(void *arg) /* Initialize indices */ produce_index = lpc_eth->rxproduceindex; consume_index = lpc_eth->rxconsumeindex; - receive_index = consume_index; /* Enable receiver */ lpc_eth->command |= ETH_CMD_RX_ENABLE; @@ -611,49 +608,47 @@ static void lpc_eth_receive_task(void *arg) /* Get current produce index */ produce_index = lpc_eth->rxproduceindex; - if (receive_index != produce_index) { + if (consume_index != produce_index) { uint32_t stat = 0; - /* Fragment mbuf */ - struct mbuf *m = mbufs [receive_index]; - /* Fragment status */ rtems_cache_invalidate_multiple_data_lines( - (void *) &status [receive_index], + (void *) &status [consume_index], sizeof(status [0]) ); - stat = status [receive_index].info; - - /* Remove mbuf from table */ - mbufs [receive_index] = NULL; + stat = status [consume_index].info; if ( (stat & ETH_RX_STAT_LAST_FLAG) != 0 && (stat & LPC_ETH_RX_STAT_ERRORS) == 0 ) { - /* Ethernet header */ - struct ether_header *eh = mtod(m, struct ether_header *); + /* Received mbuf */ + struct mbuf *m = mbufs [consume_index]; - /* Discard Ethernet header and CRC */ - int sz = (int) (stat & ETH_RX_STAT_RXSIZE_MASK) + 1 - - ETHER_HDR_LEN - ETHER_CRC_LEN; + if (lpc_eth_add_new_mbuf(ifp, desc, mbufs, consume_index, false)) { + /* Ethernet header */ + struct ether_header *eh = mtod(m, struct ether_header *); - /* Update mbuf */ - m->m_len = sz; - m->m_pkthdr.len = sz; - m->m_data = mtod(m, char *) + ETHER_HDR_LEN; + /* Discard Ethernet header and CRC */ + int sz = (int) (stat & ETH_RX_STAT_RXSIZE_MASK) + 1 + - ETHER_HDR_LEN - ETHER_CRC_LEN; - LPC_ETH_PRINTF("rx: %02" PRIu32 ": %u\n", receive_index, sz); + /* Update mbuf */ + m->m_len = sz; + m->m_pkthdr.len = sz; + m->m_data = mtod(m, char *) + ETHER_HDR_LEN; - /* Hand over */ - ether_input(ifp, eh, m); + LPC_ETH_PRINTF("rx: %02" PRIu32 ": %u\n", consume_index, sz); - /* Increment received frames counter */ - ++e->received_frames; - } else { - /* Release mbuf */ - m_free(m); + /* Hand over */ + ether_input(ifp, eh, m); + /* Increment received frames counter */ + ++e->received_frames; + } else { + ++e->receive_drop_errors; + } + } else { /* Update error counters */ if ((stat & ETH_RX_STAT_OVERRUN) != 0) { ++e->receive_overrun_errors; @@ -678,37 +673,15 @@ static void lpc_eth_receive_task(void *arg) } } - /* Increment receive index */ - receive_index = lpc_eth_increment(receive_index, index_max); + /* Increment and update consume index */ + consume_index = lpc_eth_increment(consume_index, index_max); + lpc_eth->rxconsumeindex = consume_index; } else { /* Nothing to do, enable receive interrupts */ lpc_eth_enable_receive_interrupts(); break; } } - - /* Wait for mbuf? */ - wait_for_mbuf = - lpc_eth_increment(produce_index, index_max) == consume_index; - - /* Fill queue with new mbufs */ - while (consume_index != produce_index) { - /* Add new mbuf to queue */ - if ( - !lpc_eth_add_new_mbuf(ifp, desc, mbufs, consume_index, wait_for_mbuf) - ) { - break; - } - - /* We wait for at most one mbuf */ - wait_for_mbuf = false; - - /* Increment consume index */ - consume_index = lpc_eth_increment(consume_index, index_max); - - /* Update consume indices */ - lpc_eth->rxconsumeindex = consume_index; - } } cleanup: @@ -1268,6 +1241,7 @@ static void lpc_eth_interface_stats(lpc_eth_driver_entry *e) printf("receive interrupts: %u\n", e->receive_interrupts); printf("transmitted frames: %u\n", e->transmitted_frames); printf("transmit interrupts: %u\n", e->transmit_interrupts); + printf("receive drop errors: %u\n", e->receive_drop_errors); printf("receive overrun errors: %u\n", e->receive_overrun_errors); printf("receive fragment errors: %u\n", e->receive_fragment_errors); printf("receive CRC errors: %u\n", e->receive_crc_errors); -- cgit v1.2.3 From 5970dcc9e2d5e824b3d47e73043f51316f8fcd30 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Dec 2012 10:28:18 +0100 Subject: bsps/arm: Remove superfluous attributes --- c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c index b74f045ddc..8dc40328ac 100644 --- a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c +++ b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c @@ -1084,7 +1084,7 @@ static uint32_t lpc_eth_mdio_read_anlpar(void) } static int lpc_eth_mdio_read( - int phy __attribute__((unused)), + int phy, void *arg __attribute__((unused)), unsigned reg, uint32_t *val @@ -1106,7 +1106,7 @@ static int lpc_eth_mdio_read( } static int lpc_eth_mdio_write( - int phy __attribute__((unused)), + int phy, void *arg __attribute__((unused)), unsigned reg, uint32_t val @@ -1366,7 +1366,7 @@ static void lpc_eth_interface_start(struct ifnet *ifp) RTEMS_SYSLOG_ERROR_SC(sc, "send transmit start event"); } -static void lpc_eth_interface_watchdog(struct ifnet *ifp __attribute__((unused))) +static void lpc_eth_interface_watchdog(struct ifnet *ifp) { lpc_eth_driver_entry *e = (lpc_eth_driver_entry *) ifp->if_softc; uint32_t anlpar = lpc_eth_mdio_read_anlpar(); -- cgit v1.2.3 From 573822b1e94a996aff60875a68c203b9f5690c9f Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Dec 2012 12:07:28 +0100 Subject: bsps/arm: Use assert() instead of status macros --- .../libbsp/arm/shared/lpc/network/lpc-ethernet.c | 42 +++++----------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c index 8dc40328ac..33d41998d9 100644 --- a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c +++ b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -50,8 +51,6 @@ #include #include -#include - #if MCLBYTES > (2 * 1024) #error "MCLBYTES to large" #endif @@ -541,7 +540,7 @@ static void lpc_eth_receive_task(void *arg) RTEMS_NO_TIMEOUT, &events ); - RTEMS_CLEANUP_SC(sc, cleanup, "wait for events"); + assert(sc == RTEMS_SUCCESSFUL); LPC_ETH_PRINTF("rx: wake up: 0x%08" PRIx32 "\n", events); @@ -683,17 +682,6 @@ static void lpc_eth_receive_task(void *arg) } } } - -cleanup: - - /* Clear task ID */ - e->receive_task = RTEMS_ID_NONE; - - /* Release network semaphore */ - rtems_bsdnet_semaphore_release(); - - /* Terminate self */ - (void) rtems_task_delete(RTEMS_SELF); } static struct mbuf *lpc_eth_next_fragment( @@ -790,7 +778,7 @@ static void lpc_eth_transmit_task(void *arg) RTEMS_NO_TIMEOUT, &events ); - RTEMS_CLEANUP_SC(sc, cleanup, "wait for events"); + assert(sc == RTEMS_SUCCESSFUL); LPC_ETH_PRINTF("tx: wake up: 0x%08" PRIx32 "\n", events); @@ -1038,17 +1026,6 @@ static void lpc_eth_transmit_task(void *arg) lpc_eth_enable_transmit_interrupts(); } } - -cleanup: - - /* Clear task ID */ - e->transmit_task = RTEMS_ID_NONE; - - /* Release network semaphore */ - rtems_bsdnet_semaphore_release(); - - /* Terminate self */ - (void) rtems_task_delete(RTEMS_SELF); } static void lpc_eth_mdio_wait_for_not_busy(void) @@ -1363,7 +1340,7 @@ static void lpc_eth_interface_start(struct ifnet *ifp) ifp->if_flags |= IFF_OACTIVE; sc = rtems_bsdnet_event_send(e->transmit_task, LPC_ETH_EVENT_START); - RTEMS_SYSLOG_ERROR_SC(sc, "send transmit start event"); + assert(sc == RTEMS_SUCCESSFUL); } static void lpc_eth_interface_watchdog(struct ifnet *ifp) @@ -1429,17 +1406,16 @@ static int lpc_eth_attach(struct rtems_bsdnet_ifconfig *config) /* Check parameter */ if (unit_index < 0) { - RTEMS_SYSLOG_ERROR("parse error for interface name\n"); return 0; } if (unit_index != 0) { - RTEMS_DO_CLEANUP(cleanup, "unexpected unit number"); + goto cleanup; } if (config->hardware_address == NULL) { - RTEMS_DO_CLEANUP(cleanup, "MAC address missing"); + goto cleanup; } - if (e->state != LPC_ETH_NOT_INITIALIZED) { - RTEMS_DO_CLEANUP(cleanup, "already attached"); + if (e->state != LPC_ETH_STATE_NOT_INITIALIZED) { + goto cleanup; } /* MDIO */ @@ -1498,7 +1474,7 @@ static int lpc_eth_attach(struct rtems_bsdnet_ifconfig *config) + LPC_ETH_CONFIG_TX_BUF_SIZE); table_area = lpc_eth_config_alloc_table_area(table_area_size); if (table_area == NULL) { - RTEMS_DO_CLEANUP(cleanup, "no memory for table area"); + goto cleanup; } memset(table_area, 0, table_area_size); -- cgit v1.2.3 From e99893f986c7719e75d652cfc1525cb4f47ec6e6 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Dec 2012 12:17:15 +0100 Subject: bsps/arm: Prepare for interface down support --- .../libbsp/arm/shared/lpc/network/lpc-ethernet.c | 161 +++++++++++---------- 1 file changed, 83 insertions(+), 78 deletions(-) diff --git a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c index 33d41998d9..df71776d90 100644 --- a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c +++ b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c @@ -291,10 +291,9 @@ static volatile lpc_eth_controller *const lpc_eth = #endif typedef enum { - LPC_ETH_NOT_INITIALIZED, - LPC_ETH_INITIALIZED, - LPC_ETH_STARTED, - LPC_ETH_RUNNING + LPC_ETH_STATE_NOT_INITIALIZED = 0, + LPC_ETH_STATE_DOWN, + LPC_ETH_STATE_UP } lpc_eth_state; typedef struct { @@ -332,13 +331,39 @@ typedef struct { unsigned transmit_no_descriptor_errors; unsigned transmit_overflow_errors; unsigned transmit_fatal_errors; + rtems_vector_number interrupt_number; + rtems_id control_task; } lpc_eth_driver_entry; -static lpc_eth_driver_entry lpc_eth_driver_data = { - .state = LPC_ETH_NOT_INITIALIZED, - .receive_task = RTEMS_ID_NONE, - .transmit_task = RTEMS_ID_NONE -}; +static lpc_eth_driver_entry lpc_eth_driver_data; + +static void lpc_eth_control_request_complete(const lpc_eth_driver_entry *e) +{ + rtems_status_code sc = rtems_event_transient_send(e->control_task); + assert(sc == RTEMS_SUCCESSFUL); +} + +static void lpc_eth_control_request( + lpc_eth_driver_entry *e, + rtems_id task, + rtems_event_set event +) +{ + rtems_status_code sc = RTEMS_SUCCESSFUL; + uint32_t nest_count = 0; + + e->control_task = rtems_task_self(); + + sc = rtems_bsdnet_event_send(task, event); + assert(sc == RTEMS_SUCCESSFUL); + + nest_count = rtems_bsdnet_semaphore_release_recursive(); + sc = rtems_event_transient_receive(RTEMS_WAIT, RTEMS_NO_TIMEOUT); + assert(sc == RTEMS_SUCCESSFUL); + rtems_bsdnet_semaphore_obtain_recursive(nest_count); + + e->control_task = 0; +} static inline uint32_t lpc_eth_increment( uint32_t value, @@ -596,6 +621,8 @@ static void lpc_eth_receive_task(void *arg) /* Enable receive interrupts */ lpc_eth_enable_receive_interrupts(); + lpc_eth_control_request_complete(e); + /* Wait for events */ continue; } @@ -830,6 +857,8 @@ static void lpc_eth_transmit_task(void *arg) /* Enable transmitter */ lpc_eth->command |= ETH_CMD_TX_ENABLE; + + lpc_eth_control_request_complete(e); } /* Free consumed fragments */ @@ -1102,15 +1131,12 @@ static int lpc_eth_mdio_write( return eno; } -static void lpc_eth_interface_init(void *arg) +static void lpc_eth_up_or_down(lpc_eth_driver_entry *e, bool up) { rtems_status_code sc = RTEMS_SUCCESSFUL; - lpc_eth_driver_entry *e = (lpc_eth_driver_entry *) arg; struct ifnet *ifp = &e->arpcom.ac_if; - LPC_ETH_PRINTF("%s\n", __func__); - - if (e->state == LPC_ETH_INITIALIZED) { + if (up && e->state == LPC_ETH_STATE_DOWN) { lpc_eth_config_module_enable(); /* Soft reset */ @@ -1137,7 +1163,7 @@ static void lpc_eth_interface_init(void *arg) #else lpc_eth->command = 0x0400; #endif - lpc_eth->intenable = 0; + lpc_eth->intenable = ETH_INT_RX_OVERRUN | ETH_INT_TX_UNDERRUN; lpc_eth->intclear = 0x30ff; lpc_eth->powerdown = 0; @@ -1149,59 +1175,40 @@ static void lpc_eth_interface_init(void *arg) lpc_eth->sa2 = ((uint32_t) e->arpcom.ac_enaddr [1] << 8) | (uint32_t) e->arpcom.ac_enaddr [0]; + lpc_eth_enable_promiscous_mode((ifp->if_flags & IFF_PROMISC) != 0); + /* Enable receiver */ lpc_eth->mac1 = 0x03; - /* Start receive task */ - if (e->receive_task == RTEMS_ID_NONE) { - e->receive_task = rtems_bsdnet_newproc( - "ntrx", - 4096, - lpc_eth_receive_task, - e - ); - sc = rtems_bsdnet_event_send(e->receive_task, LPC_ETH_EVENT_INITIALIZE); - RTEMS_SYSLOG_ERROR_SC(sc, "send receive initialize event"); - } - - /* Start transmit task */ - if (e->transmit_task == RTEMS_ID_NONE) { - e->transmit_task = rtems_bsdnet_newproc( - "nttx", - 4096, - lpc_eth_transmit_task, - e - ); - sc = rtems_bsdnet_event_send(e->transmit_task, LPC_ETH_EVENT_INITIALIZE); - RTEMS_SYSLOG_ERROR_SC(sc, "send transmit initialize event"); - } - - /* Change state */ - if ( - e->receive_task != RTEMS_ID_NONE && e->transmit_task != RTEMS_ID_NONE - ) { - e->state = LPC_ETH_STARTED; - } - } - - if (e->state == LPC_ETH_STARTED) { - /* Enable fatal interrupts */ - lpc_eth->intenable = ETH_INT_RX_OVERRUN | ETH_INT_TX_UNDERRUN; - - /* Enable promiscous mode */ - lpc_eth_enable_promiscous_mode((ifp->if_flags & IFF_PROMISC) != 0); + /* Initialize tasks */ + lpc_eth_control_request(e, e->receive_task, LPC_ETH_EVENT_INITIALIZE); + lpc_eth_control_request(e, e->transmit_task, LPC_ETH_EVENT_INITIALIZE); + + /* Install interrupt handler */ + sc = rtems_interrupt_handler_install( + e->interrupt_number, + "Ethernet", + RTEMS_INTERRUPT_UNIQUE, + lpc_eth_interrupt_handler, + e + ); + assert(sc == RTEMS_SUCCESSFUL); /* Start watchdog timer */ ifp->if_timer = 1; - /* Set interface to running state */ - ifp->if_flags |= IFF_RUNNING; - /* Change state */ - e->state = LPC_ETH_RUNNING; + e->state = LPC_ETH_STATE_UP; + } else if (!up && e->state == LPC_ETH_STATE_UP) { + /* TODO */ } } +static void lpc_eth_interface_init(void *arg) +{ + /* Nothing to do */ +} + static void lpc_eth_interface_stats(lpc_eth_driver_entry *e) { int media = IFM_MAKEWORD(0, 0, 0, 0); @@ -1309,13 +1316,7 @@ static int lpc_eth_interface_ioctl( ether_ioctl(ifp, cmd, data); break; case SIOCSIFFLAGS: - if (ifp->if_flags & IFF_RUNNING) { - /* TODO: off */ - } - if (ifp->if_flags & IFF_UP) { - ifp->if_flags |= IFF_RUNNING; - /* TODO: init */ - } + lpc_eth_up_or_down(e, (ifp->if_flags & IFF_UP) != 0); break; case SIOCADDMULTI: case SIOCDELMULTI: @@ -1395,7 +1396,6 @@ static unsigned lpc_eth_fixup_unit_count(int count, int default_value, int max) static int lpc_eth_attach(struct rtems_bsdnet_ifconfig *config) { - rtems_status_code sc = RTEMS_SUCCESSFUL; lpc_eth_driver_entry *e = &lpc_eth_driver_data; struct ifnet *ifp = &e->arpcom.ac_if; char *unit_name = NULL; @@ -1446,18 +1446,8 @@ static int lpc_eth_attach(struct rtems_bsdnet_ifconfig *config) ); config->xbuf_count = (int) e->tx_unit_count; - /* Disable interrupts */ - lpc_eth->intenable = 0; - - /* Install interrupt handler */ - sc = rtems_interrupt_handler_install( - config->irno, - "Ethernet", - RTEMS_INTERRUPT_UNIQUE, - lpc_eth_interrupt_handler, - e - ); - RTEMS_CLEANUP_SC(sc, cleanup, "install interrupt handler"); + /* Remember interrupt number */ + e->interrupt_number = config->irno; /* Copy MAC address */ memcpy(e->arpcom.ac_enaddr, config->hardware_address, ETHER_ADDR_LEN); @@ -1515,8 +1505,23 @@ static int lpc_eth_attach(struct rtems_bsdnet_ifconfig *config) ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_timer = 0; + /* Create tasks */ + e->receive_task = rtems_bsdnet_newproc( + "ntrx", + 4096, + lpc_eth_receive_task, + e + ); + e->transmit_task = rtems_bsdnet_newproc( + "nttx", + 4096, + lpc_eth_transmit_task, + e + ); + /* Change status */ - e->state = LPC_ETH_INITIALIZED; + ifp->if_flags |= IFF_RUNNING; + e->state = LPC_ETH_STATE_DOWN; /* Attach the interface */ if_attach(ifp); -- cgit v1.2.3 From 2cd48da071950ad73baa3802200449c17b6a0893 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Dec 2012 13:08:10 +0100 Subject: bsps/arm: Add interface down support --- .../arm/lpc24xx/include/lpc-ethernet-config.h | 5 + .../arm/lpc32xx/include/lpc-ethernet-config.h | 5 + .../libbsp/arm/shared/lpc/network/lpc-ethernet.c | 138 ++++++++++++++------- 3 files changed, 105 insertions(+), 43 deletions(-) diff --git a/c/src/lib/libbsp/arm/lpc24xx/include/lpc-ethernet-config.h b/c/src/lib/libbsp/arm/lpc24xx/include/lpc-ethernet-config.h index 8c787b75da..26482bfcda 100644 --- a/c/src/lib/libbsp/arm/lpc24xx/include/lpc-ethernet-config.h +++ b/c/src/lib/libbsp/arm/lpc24xx/include/lpc-ethernet-config.h @@ -92,6 +92,11 @@ extern "C" { } #endif +static void lpc_eth_config_module_disable(void) +{ + lpc24xx_module_disable(LPC24XX_MODULE_ETHERNET); +} + static char *lpc_eth_config_alloc_table_area(size_t size) { if (size < LPC24XX_ETH_RAM_SIZE) { diff --git a/c/src/lib/libbsp/arm/lpc32xx/include/lpc-ethernet-config.h b/c/src/lib/libbsp/arm/lpc32xx/include/lpc-ethernet-config.h index 12dbd792f6..3dc1dc0f3c 100644 --- a/c/src/lib/libbsp/arm/lpc32xx/include/lpc-ethernet-config.h +++ b/c/src/lib/libbsp/arm/lpc32xx/include/lpc-ethernet-config.h @@ -71,6 +71,11 @@ extern "C" { } #endif +static void lpc_eth_config_module_disable(void) +{ + LPC32XX_MAC_CLK_CTRL = 0; +} + #define LPC_ETH_CONFIG_USE_TRANSMIT_DMA static char *lpc_eth_config_alloc_table_area(size_t size) diff --git a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c index df71776d90..fd7effd869 100644 --- a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c +++ b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c @@ -253,10 +253,12 @@ static volatile lpc_eth_controller *const lpc_eth = #define LPC_ETH_EVENT_INITIALIZE RTEMS_EVENT_1 -#define LPC_ETH_EVENT_START RTEMS_EVENT_2 +#define LPC_ETH_EVENT_TXSTART RTEMS_EVENT_2 #define LPC_ETH_EVENT_INTERRUPT RTEMS_EVENT_3 +#define LPC_ETH_EVENT_STOP RTEMS_EVENT_4 + /* Status */ #define LPC_ETH_INTERRUPT_RECEIVE \ @@ -560,7 +562,9 @@ static void lpc_eth_receive_task(void *arg) while (true) { /* Wait for events */ sc = rtems_bsdnet_event_receive( - LPC_ETH_EVENT_INITIALIZE | LPC_ETH_EVENT_INTERRUPT, + LPC_ETH_EVENT_INITIALIZE + | LPC_ETH_EVENT_STOP + | LPC_ETH_EVENT_INTERRUPT, RTEMS_EVENT_ANY | RTEMS_WAIT, RTEMS_NO_TIMEOUT, &events @@ -569,6 +573,14 @@ static void lpc_eth_receive_task(void *arg) LPC_ETH_PRINTF("rx: wake up: 0x%08" PRIx32 "\n", events); + /* Stop receiver? */ + if ((events & LPC_ETH_EVENT_STOP) != 0) { + lpc_eth_control_request_complete(e); + + /* Wait for events */ + continue; + } + /* Initialize receiver? */ if ((events & LPC_ETH_EVENT_INITIALIZE) != 0) { /* Disable receive interrupts */ @@ -799,7 +811,8 @@ static void lpc_eth_transmit_task(void *arg) /* Wait for events */ sc = rtems_bsdnet_event_receive( LPC_ETH_EVENT_INITIALIZE - | LPC_ETH_EVENT_START + | LPC_ETH_EVENT_STOP + | LPC_ETH_EVENT_TXSTART | LPC_ETH_EVENT_INTERRUPT, RTEMS_EVENT_ANY | RTEMS_WAIT, RTEMS_NO_TIMEOUT, @@ -809,6 +822,14 @@ static void lpc_eth_transmit_task(void *arg) LPC_ETH_PRINTF("tx: wake up: 0x%08" PRIx32 "\n", events); + /* Stop transmitter? */ + if ((events & LPC_ETH_EVENT_STOP) != 0) { + lpc_eth_control_request_complete(e); + + /* Wait for events */ + continue; + } + /* Initialize transmitter? */ if ((events & LPC_ETH_EVENT_INITIALIZE) != 0) { /* Disable transmit interrupts */ @@ -1131,6 +1152,13 @@ static int lpc_eth_mdio_write( return eno; } +static void lpc_eth_soft_reset(void) +{ + lpc_eth->command = 0x38; + lpc_eth->mac1 = 0xcf00; + lpc_eth->mac1 = 0x0; +} + static void lpc_eth_up_or_down(lpc_eth_driver_entry *e, bool up) { rtems_status_code sc = RTEMS_SUCCESSFUL; @@ -1139,12 +1167,7 @@ static void lpc_eth_up_or_down(lpc_eth_driver_entry *e, bool up) if (up && e->state == LPC_ETH_STATE_DOWN) { lpc_eth_config_module_enable(); - /* Soft reset */ - - /* Do soft reset */ - lpc_eth->command = 0x38; - lpc_eth->mac1 = 0xcf00; - lpc_eth->mac1 = 0x0; + lpc_eth_soft_reset(); /* Initialize PHY */ lpc_eth->mcfg = ETH_MCFG_CLOCK_SELECT(0x7); @@ -1200,7 +1223,26 @@ static void lpc_eth_up_or_down(lpc_eth_driver_entry *e, bool up) /* Change state */ e->state = LPC_ETH_STATE_UP; } else if (!up && e->state == LPC_ETH_STATE_UP) { - /* TODO */ + /* Remove interrupt handler */ + sc = rtems_interrupt_handler_remove( + e->interrupt_number, + lpc_eth_interrupt_handler, + e + ); + assert(sc == RTEMS_SUCCESSFUL); + + /* Stop tasks */ + lpc_eth_control_request(e, e->receive_task, LPC_ETH_EVENT_STOP); + lpc_eth_control_request(e, e->transmit_task, LPC_ETH_EVENT_STOP); + + lpc_eth_soft_reset(); + lpc_eth_config_module_disable(); + + /* Stop watchdog timer */ + ifp->if_timer = 0; + + /* Change state */ + e->state = LPC_ETH_STATE_DOWN; } } @@ -1211,8 +1253,13 @@ static void lpc_eth_interface_init(void *arg) static void lpc_eth_interface_stats(lpc_eth_driver_entry *e) { - int media = IFM_MAKEWORD(0, 0, 0, 0); - int eno = rtems_mii_ioctl(&e->mdio, e, SIOCGIFMEDIA, &media); + int eno = EIO; + int media = 0; + + if (e->state == LPC_ETH_STATE_UP) { + media = IFM_MAKEWORD(0, 0, 0, 0); + eno = rtems_mii_ioctl(&e->mdio, e, SIOCGIFMEDIA, &media); + } rtems_bsdnet_semaphore_release(); @@ -1340,46 +1387,51 @@ static void lpc_eth_interface_start(struct ifnet *ifp) ifp->if_flags |= IFF_OACTIVE; - sc = rtems_bsdnet_event_send(e->transmit_task, LPC_ETH_EVENT_START); - assert(sc == RTEMS_SUCCESSFUL); + if (e->state == LPC_ETH_STATE_UP) { + sc = rtems_bsdnet_event_send(e->transmit_task, LPC_ETH_EVENT_TXSTART); + assert(sc == RTEMS_SUCCESSFUL); + } } static void lpc_eth_interface_watchdog(struct ifnet *ifp) { lpc_eth_driver_entry *e = (lpc_eth_driver_entry *) ifp->if_softc; - uint32_t anlpar = lpc_eth_mdio_read_anlpar(); - - if (e->anlpar != anlpar) { - bool full_duplex = false; - bool speed = false; - - e->anlpar = anlpar; - - if ((anlpar & ANLPAR_TX_FD) != 0) { - full_duplex = true; - speed = true; - } else if ((anlpar & ANLPAR_T4) != 0) { - speed = true; - } else if ((anlpar & ANLPAR_TX) != 0) { - speed = true; - } else if ((anlpar & ANLPAR_10_FD) != 0) { - full_duplex = true; - } - if (full_duplex) { - lpc_eth->mac2 |= ETH_MAC2_FULL_DUPLEX; - } else { - lpc_eth->mac2 &= ~ETH_MAC2_FULL_DUPLEX; - } + if (e->state == LPC_ETH_STATE_UP) { + uint32_t anlpar = lpc_eth_mdio_read_anlpar(); - if (speed) { - lpc_eth->supp |= ETH_SUPP_SPEED; - } else { - lpc_eth->supp &= ~ETH_SUPP_SPEED; + if (e->anlpar != anlpar) { + bool full_duplex = false; + bool speed = false; + + e->anlpar = anlpar; + + if ((anlpar & ANLPAR_TX_FD) != 0) { + full_duplex = true; + speed = true; + } else if ((anlpar & ANLPAR_T4) != 0) { + speed = true; + } else if ((anlpar & ANLPAR_TX) != 0) { + speed = true; + } else if ((anlpar & ANLPAR_10_FD) != 0) { + full_duplex = true; + } + + if (full_duplex) { + lpc_eth->mac2 |= ETH_MAC2_FULL_DUPLEX; + } else { + lpc_eth->mac2 &= ~ETH_MAC2_FULL_DUPLEX; + } + + if (speed) { + lpc_eth->supp |= ETH_SUPP_SPEED; + } else { + lpc_eth->supp &= ~ETH_SUPP_SPEED; + } } - } - ifp->if_timer = WATCHDOG_TIMEOUT; + ifp->if_timer = WATCHDOG_TIMEOUT; + } } static unsigned lpc_eth_fixup_unit_count(int count, int default_value, int max) -- cgit v1.2.3 From 50233d370c9a2121106f192b556a8aa0501ffa37 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 17 Dec 2012 11:12:20 +0100 Subject: bsps/arm: Add PHY timeout detection --- .../libbsp/arm/shared/lpc/network/lpc-ethernet.c | 29 +++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c index fd7effd869..824d2a4fba 100644 --- a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c +++ b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c @@ -1078,17 +1078,24 @@ static void lpc_eth_transmit_task(void *arg) } } -static void lpc_eth_mdio_wait_for_not_busy(void) +static int lpc_eth_mdio_wait_for_not_busy(void) { - while ((lpc_eth->mind & ETH_MIND_BUSY) != 0) { - rtems_task_wake_after(2); + rtems_interval one_second = rtems_clock_get_ticks_per_second(); + rtems_interval i = 0; + + while ((lpc_eth->mind & ETH_MIND_BUSY) != 0 && i < one_second) { + rtems_task_wake_after(1); + ++i; } + + return i != one_second ? 0 : ETIMEDOUT; } static uint32_t lpc_eth_mdio_read_anlpar(void) { uint32_t madr = ETH_MADR_REG(MII_ANLPAR) | ETH_MADR_PHY(DEFAULT_PHY); uint32_t anlpar = 0; + int eno = 0; if (lpc_eth->madr != madr) { lpc_eth->madr = madr; @@ -1099,9 +1106,10 @@ static uint32_t lpc_eth_mdio_read_anlpar(void) lpc_eth->mcmd = ETH_MCMD_READ; } - lpc_eth_mdio_wait_for_not_busy(); - - anlpar = lpc_eth->mrdd; + eno = lpc_eth_mdio_wait_for_not_busy(); + if (eno == 0) { + anlpar = lpc_eth->mrdd; + } /* Start next read */ lpc_eth->mcmd = 0; @@ -1123,8 +1131,11 @@ static int lpc_eth_mdio_read( lpc_eth->madr = ETH_MADR_REG(reg) | ETH_MADR_PHY(DEFAULT_PHY); lpc_eth->mcmd = 0; lpc_eth->mcmd = ETH_MCMD_READ; - lpc_eth_mdio_wait_for_not_busy(); - *val = lpc_eth->mrdd; + eno = lpc_eth_mdio_wait_for_not_busy(); + + if (eno == 0) { + *val = lpc_eth->mrdd; + } } else { eno = EINVAL; } @@ -1144,7 +1155,7 @@ static int lpc_eth_mdio_write( if (phy == -1 || phy == 0) { lpc_eth->madr = ETH_MADR_REG(reg) | ETH_MADR_PHY(DEFAULT_PHY); lpc_eth->mwtd = val; - lpc_eth_mdio_wait_for_not_busy(); + eno = lpc_eth_mdio_wait_for_not_busy(); } else { eno = EINVAL; } -- cgit v1.2.3 From 3f58ac7add7adef88729c214d60ee359f4825f61 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 17 Dec 2012 15:41:53 +0100 Subject: bsps/arm: Add PHY up/down All PHYs will be set to power up/down state with the BMCR[BMCR_PDOWN] setting. The KSZ80X1RNL will use the energy detect power down (EDPD) mode with PLL automatically turned in the up state. It will use the slow oscillator mode in the down state. To prevent system bus lock-ups the PHY is set to the up state before Ethernet module initialization. In case of a communication failure with the PHY or weird PHY identifiers the initialization will be aborted. --- .../libbsp/arm/shared/lpc/network/lpc-ethernet.c | 264 ++++++++++++++++----- 1 file changed, 211 insertions(+), 53 deletions(-) diff --git a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c index 824d2a4fba..b545800137 100644 --- a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c +++ b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c @@ -333,6 +333,7 @@ typedef struct { unsigned transmit_no_descriptor_errors; unsigned transmit_overflow_errors; unsigned transmit_fatal_errors; + uint32_t phy_id; rtems_vector_number interrupt_number; rtems_id control_task; } lpc_eth_driver_entry; @@ -1163,6 +1164,148 @@ static int lpc_eth_mdio_write( return eno; } +static int lpc_eth_phy_get_id(uint32_t *id) +{ + uint32_t id1 = 0; + int eno = lpc_eth_mdio_read(DEFAULT_PHY, NULL, MII_PHYIDR1, &id1); + + if (eno == 0) { + uint32_t id2 = 0; + + eno = lpc_eth_mdio_read(DEFAULT_PHY, NULL, MII_PHYIDR2, &id2); + if (eno == 0) { + *id = (id1 << 16) | (id2 & 0xfff0); + } + } + + return eno; +} + +#define PHY_KSZ80X1RNL 0x221550 + +typedef struct { + unsigned reg; + uint32_t set; + uint32_t clear; +} lpc_eth_phy_action; + +static int lpc_eth_phy_set_and_clear( + const lpc_eth_phy_action *actions, + size_t n +) +{ + int eno = 0; + size_t i; + + for (i = 0; eno == 0 && i < n; ++i) { + const lpc_eth_phy_action *action = &actions [i]; + uint32_t val; + + eno = lpc_eth_mdio_read(DEFAULT_PHY, NULL, action->reg, &val); + if (eno == 0) { + val |= action->set; + val &= ~action->clear; + eno = lpc_eth_mdio_write(DEFAULT_PHY, NULL, action->reg, val); + } + } + + return eno; +} + +static const lpc_eth_phy_action lpc_eth_phy_up_action_default [] = { + { MII_BMCR, 0, BMCR_PDOWN }, + { MII_BMCR, BMCR_RESET, 0 }, + { MII_BMCR, BMCR_AUTOEN, 0 } +}; + +static const lpc_eth_phy_action lpc_eth_phy_up_pre_action_KSZ80X1RNL [] = { + /* Disable slow oscillator mode */ + { 0x11, 0, 0x10 } +}; + +static const lpc_eth_phy_action lpc_eth_phy_up_post_action_KSZ80X1RNL [] = { + /* Enable energy detect power down (EDPD) mode */ + { 0x18, 0x0800, 0 }, + /* Turn PLL of automatically in EDPD mode */ + { 0x10, 0x10, 0 } +}; + +static int lpc_eth_phy_up(lpc_eth_driver_entry *e) +{ + int eno = lpc_eth_phy_get_id(&e->phy_id); + + if (eno == 0) { + switch (e->phy_id) { + case PHY_KSZ80X1RNL: + eno = lpc_eth_phy_set_and_clear( + &lpc_eth_phy_up_pre_action_KSZ80X1RNL [0], + RTEMS_ARRAY_SIZE(lpc_eth_phy_up_pre_action_KSZ80X1RNL) + ); + break; + case 0: + case 0xfffffff0: + eno = EIO; + break; + default: + break; + } + + if (eno == 0) { + eno = lpc_eth_phy_set_and_clear( + &lpc_eth_phy_up_action_default [0], + RTEMS_ARRAY_SIZE(lpc_eth_phy_up_action_default) + ); + } + + if (eno == 0) { + switch (e->phy_id) { + case PHY_KSZ80X1RNL: + eno = lpc_eth_phy_set_and_clear( + &lpc_eth_phy_up_post_action_KSZ80X1RNL [0], + RTEMS_ARRAY_SIZE(lpc_eth_phy_up_post_action_KSZ80X1RNL) + ); + break; + default: + break; + } + } + } else { + e->phy_id = 0; + } + + return eno; +} + +static const lpc_eth_phy_action lpc_eth_phy_down_action_default [] = { + { MII_BMCR, BMCR_PDOWN, 0 } +}; + +static const lpc_eth_phy_action lpc_eth_phy_down_post_action_KSZ80X1RNL [] = { + /* Enable slow oscillator mode */ + { 0x11, 0x10, 0 } +}; + +static void lpc_eth_phy_down(lpc_eth_driver_entry *e) +{ + int eno = lpc_eth_phy_set_and_clear( + &lpc_eth_phy_down_action_default [0], + RTEMS_ARRAY_SIZE(lpc_eth_phy_down_action_default) + ); + + if (eno == 0) { + switch (e->phy_id) { + case PHY_KSZ80X1RNL: + eno = lpc_eth_phy_set_and_clear( + &lpc_eth_phy_down_post_action_KSZ80X1RNL [0], + RTEMS_ARRAY_SIZE(lpc_eth_phy_down_post_action_KSZ80X1RNL) + ); + break; + default: + break; + } + } +} + static void lpc_eth_soft_reset(void) { lpc_eth->command = 0x38; @@ -1170,69 +1313,81 @@ static void lpc_eth_soft_reset(void) lpc_eth->mac1 = 0x0; } -static void lpc_eth_up_or_down(lpc_eth_driver_entry *e, bool up) +static int lpc_eth_up_or_down(lpc_eth_driver_entry *e, bool up) { + int eno = 0; rtems_status_code sc = RTEMS_SUCCESSFUL; struct ifnet *ifp = &e->arpcom.ac_if; if (up && e->state == LPC_ETH_STATE_DOWN) { - lpc_eth_config_module_enable(); - lpc_eth_soft_reset(); + lpc_eth_config_module_enable(); /* Initialize PHY */ lpc_eth->mcfg = ETH_MCFG_CLOCK_SELECT(0x7); - /* TODO */ - - /* Reinitialize registers */ - lpc_eth->mac2 = 0x31; - lpc_eth->ipgt = 0x15; - lpc_eth->ipgr = 0x12; - lpc_eth->clrt = 0x370f; - lpc_eth->maxf = 0x0600; - lpc_eth->supp = ETH_SUPP_SPEED; - lpc_eth->test = 0; - #ifdef LPC_ETH_CONFIG_RMII - lpc_eth->command = 0x0600; - #else - lpc_eth->command = 0x0400; - #endif - lpc_eth->intenable = ETH_INT_RX_OVERRUN | ETH_INT_TX_UNDERRUN; - lpc_eth->intclear = 0x30ff; - lpc_eth->powerdown = 0; - - /* MAC address */ - lpc_eth->sa0 = ((uint32_t) e->arpcom.ac_enaddr [5] << 8) - | (uint32_t) e->arpcom.ac_enaddr [4]; - lpc_eth->sa1 = ((uint32_t) e->arpcom.ac_enaddr [3] << 8) - | (uint32_t) e->arpcom.ac_enaddr [2]; - lpc_eth->sa2 = ((uint32_t) e->arpcom.ac_enaddr [1] << 8) - | (uint32_t) e->arpcom.ac_enaddr [0]; - - lpc_eth_enable_promiscous_mode((ifp->if_flags & IFF_PROMISC) != 0); - - /* Enable receiver */ - lpc_eth->mac1 = 0x03; - - /* Initialize tasks */ - lpc_eth_control_request(e, e->receive_task, LPC_ETH_EVENT_INITIALIZE); - lpc_eth_control_request(e, e->transmit_task, LPC_ETH_EVENT_INITIALIZE); - - /* Install interrupt handler */ - sc = rtems_interrupt_handler_install( - e->interrupt_number, - "Ethernet", - RTEMS_INTERRUPT_UNIQUE, - lpc_eth_interrupt_handler, - e - ); - assert(sc == RTEMS_SUCCESSFUL); + eno = lpc_eth_phy_up(e); + + if (eno == 0) { + /* + * We must have a valid external clock from the PHY at this point, + * otherwise the system bus hangs and only a watchdog reset helps. + */ + lpc_eth_soft_reset(); + + /* Reinitialize registers */ + lpc_eth->mac2 = 0x31; + lpc_eth->ipgt = 0x15; + lpc_eth->ipgr = 0x12; + lpc_eth->clrt = 0x370f; + lpc_eth->maxf = 0x0600; + lpc_eth->supp = ETH_SUPP_SPEED; + lpc_eth->test = 0; + #ifdef LPC_ETH_CONFIG_RMII + lpc_eth->command = 0x0600; + #else + lpc_eth->command = 0x0400; + #endif + lpc_eth->intenable = ETH_INT_RX_OVERRUN | ETH_INT_TX_UNDERRUN; + lpc_eth->intclear = 0x30ff; + lpc_eth->powerdown = 0; - /* Start watchdog timer */ - ifp->if_timer = 1; + /* MAC address */ + lpc_eth->sa0 = ((uint32_t) e->arpcom.ac_enaddr [5] << 8) + | (uint32_t) e->arpcom.ac_enaddr [4]; + lpc_eth->sa1 = ((uint32_t) e->arpcom.ac_enaddr [3] << 8) + | (uint32_t) e->arpcom.ac_enaddr [2]; + lpc_eth->sa2 = ((uint32_t) e->arpcom.ac_enaddr [1] << 8) + | (uint32_t) e->arpcom.ac_enaddr [0]; - /* Change state */ - e->state = LPC_ETH_STATE_UP; + lpc_eth_enable_promiscous_mode((ifp->if_flags & IFF_PROMISC) != 0); + + /* Enable receiver */ + lpc_eth->mac1 = 0x03; + + /* Initialize tasks */ + lpc_eth_control_request(e, e->receive_task, LPC_ETH_EVENT_INITIALIZE); + lpc_eth_control_request(e, e->transmit_task, LPC_ETH_EVENT_INITIALIZE); + + /* Install interrupt handler */ + sc = rtems_interrupt_handler_install( + e->interrupt_number, + "Ethernet", + RTEMS_INTERRUPT_UNIQUE, + lpc_eth_interrupt_handler, + e + ); + assert(sc == RTEMS_SUCCESSFUL); + + /* Start watchdog timer */ + ifp->if_timer = 1; + + /* Change state */ + e->state = LPC_ETH_STATE_UP; + } + + if (eno != 0) { + ifp->if_flags &= ~IFF_UP; + } } else if (!up && e->state == LPC_ETH_STATE_UP) { /* Remove interrupt handler */ sc = rtems_interrupt_handler_remove( @@ -1247,6 +1402,7 @@ static void lpc_eth_up_or_down(lpc_eth_driver_entry *e, bool up) lpc_eth_control_request(e, e->transmit_task, LPC_ETH_EVENT_STOP); lpc_eth_soft_reset(); + lpc_eth_phy_down(e); lpc_eth_config_module_disable(); /* Stop watchdog timer */ @@ -1255,6 +1411,8 @@ static void lpc_eth_up_or_down(lpc_eth_driver_entry *e, bool up) /* Change state */ e->state = LPC_ETH_STATE_DOWN; } + + return eno; } static void lpc_eth_interface_init(void *arg) @@ -1374,7 +1532,7 @@ static int lpc_eth_interface_ioctl( ether_ioctl(ifp, cmd, data); break; case SIOCSIFFLAGS: - lpc_eth_up_or_down(e, (ifp->if_flags & IFF_UP) != 0); + eno = lpc_eth_up_or_down(e, (ifp->if_flags & IFF_UP) != 0); break; case SIOCADDMULTI: case SIOCDELMULTI: -- cgit v1.2.3 From 4592658b700b4b261901146c89b7c8042c669988 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 18 Dec 2012 09:24:56 +0100 Subject: bsps/arm: Move promiscuous mode setting --- c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c index b545800137..3b2d5b6fa5 100644 --- a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c +++ b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c @@ -1359,8 +1359,6 @@ static int lpc_eth_up_or_down(lpc_eth_driver_entry *e, bool up) lpc_eth->sa2 = ((uint32_t) e->arpcom.ac_enaddr [1] << 8) | (uint32_t) e->arpcom.ac_enaddr [0]; - lpc_eth_enable_promiscous_mode((ifp->if_flags & IFF_PROMISC) != 0); - /* Enable receiver */ lpc_eth->mac1 = 0x03; @@ -1533,6 +1531,9 @@ static int lpc_eth_interface_ioctl( break; case SIOCSIFFLAGS: eno = lpc_eth_up_or_down(e, (ifp->if_flags & IFF_UP) != 0); + if (eno == 0 && (ifp->if_flags & IFF_UP) != 0) { + lpc_eth_enable_promiscous_mode((ifp->if_flags & IFF_PROMISC) != 0); + } break; case SIOCADDMULTI: case SIOCDELMULTI: -- cgit v1.2.3 From 7b5513f04fa4aee88936cd6cd3c3fc5e0fc4e8f2 Mon Sep 17 00:00:00 2001 From: Andreas Heinig Date: Tue, 18 Dec 2012 11:27:49 -0500 Subject: PR2083 Wrong return value in _RBTree_Has_only_one_node The function _RBTree_Has_only_one_node shall return a boolean value, but returns NULL. NULL, however, is defined as: (void *)0. Hence it does not match the scalar bool type. Return false instead. --- cpukit/score/inline/rtems/score/rbtree.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpukit/score/inline/rtems/score/rbtree.inl b/cpukit/score/inline/rtems/score/rbtree.inl index c5187a02ae..439b40a0ba 100644 --- a/cpukit/score/inline/rtems/score/rbtree.inl +++ b/cpukit/score/inline/rtems/score/rbtree.inl @@ -221,7 +221,7 @@ RTEMS_INLINE_ROUTINE bool _RBTree_Has_only_one_node( const RBTree_Control *the_rbtree ) { - if(!the_rbtree) return NULL; /* TODO: expected behavior? */ + if(!the_rbtree) return false; /* TODO: expected behavior? */ return (the_rbtree->root->child[RBT_LEFT] == NULL && the_rbtree->root->child[RBT_RIGHT] == NULL); } -- cgit v1.2.3 From f0bd30c4953b5804131d5e23e1c1d4b4b4564339 Mon Sep 17 00:00:00 2001 From: Ayush Awasthi Date: Tue, 18 Dec 2012 11:55:40 -0500 Subject: posix: Doxygen Enhancement Task #12 http://www.google-melange.com/gci/task/view/google/gci2012/8003214 --- cpukit/posix/src/cancel.c | 7 +++++++ cpukit/posix/src/mqueuegetattr.c | 7 +++++++ cpukit/posix/src/psxnametoid.c | 7 +++++++ cpukit/posix/src/setitimer.c | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/cpukit/posix/src/cancel.c b/cpukit/posix/src/cancel.c index acf13524b8..42321ce93b 100644 --- a/cpukit/posix/src/cancel.c +++ b/cpukit/posix/src/cancel.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Canceling Execution of a Thread + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/mqueuegetattr.c b/cpukit/posix/src/mqueuegetattr.c index 267eed1951..cfcc51af1e 100644 --- a/cpukit/posix/src/mqueuegetattr.c +++ b/cpukit/posix/src/mqueuegetattr.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Message Queue Attributes + * @ingroup POSIX + */ + /* * NOTE: The structure of the routines is identical to that of POSIX * Message_queues to leave the option of having unnamed message diff --git a/cpukit/posix/src/psxnametoid.c b/cpukit/posix/src/psxnametoid.c index f35eed3cc4..d75d5d43df 100644 --- a/cpukit/posix/src/psxnametoid.c +++ b/cpukit/posix/src/psxnametoid.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Name to ID + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/setitimer.c b/cpukit/posix/src/setitimer.c index 7a40419463..f8ab9efa56 100644 --- a/cpukit/posix/src/setitimer.c +++ b/cpukit/posix/src/setitimer.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Set the Timer + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). -- cgit v1.2.3 From d527562eee32b766b7aa3babeb50842b011bddb6 Mon Sep 17 00:00:00 2001 From: Ayush Awasthi Date: Tue, 18 Dec 2012 15:42:30 -0500 Subject: posix: Doxygen Enhancement Task #11 http://www.google-melange.com/gci/task/view/google/gci2012/7987221 --- cpukit/posix/src/aio_read.c | 7 +++++++ cpukit/posix/src/aio_suspend.c | 7 +++++++ cpukit/posix/src/clockgettime.c | 7 +++++++ cpukit/posix/src/clocksetenableattr.c | 7 +++++++ cpukit/posix/src/condattrdestroy.c | 7 +++++++ cpukit/posix/src/condattrinit.c | 7 +++++++ cpukit/posix/src/keysetspecific.c | 7 +++++++ cpukit/posix/src/mqueuetimedreceive.c | 7 +++++++ cpukit/posix/src/mutexattrgetprotocol.c | 7 +++++++ cpukit/posix/src/nanosleep.c | 7 +++++++ cpukit/posix/src/prwlockwrlock.c | 7 +++++++ cpukit/posix/src/psignalclearprocesssignals.c | 7 +++++++ cpukit/posix/src/pthreadattrsetschedpolicy.c | 7 +++++++ cpukit/posix/src/pthreadgetcpuclockid.c | 7 +++++++ cpukit/posix/src/pthreadkill.c | 7 +++++++ cpukit/posix/src/rwlockattrsetpshared.c | 7 +++++++ cpukit/posix/src/sched_getprioritymax.c | 7 +++++++ cpukit/posix/src/sigdelset.c | 7 +++++++ cpukit/posix/src/timerdelete.c | 7 +++++++ cpukit/posix/src/vfork.c | 7 +++++++ 20 files changed, 140 insertions(+) diff --git a/cpukit/posix/src/aio_read.c b/cpukit/posix/src/aio_read.c index 63bbac9c1b..f339752525 100644 --- a/cpukit/posix/src/aio_read.c +++ b/cpukit/posix/src/aio_read.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Asynchronously reads Data from a File + * @ingroup POSIX + */ + /* * Copyright 2010, Alin Rus * diff --git a/cpukit/posix/src/aio_suspend.c b/cpukit/posix/src/aio_suspend.c index c42ee83be5..60c4af1389 100644 --- a/cpukit/posix/src/aio_suspend.c +++ b/cpukit/posix/src/aio_suspend.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Suspends Process until Asynchronous I/O Operation completes + * @ingroup POSIX + */ + /* * 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164 * diff --git a/cpukit/posix/src/clockgettime.c b/cpukit/posix/src/clockgettime.c index 2c5a9da5fa..46c1d46811 100644 --- a/cpukit/posix/src/clockgettime.c +++ b/cpukit/posix/src/clockgettime.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Retrieves the Specified Clock Time + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/clocksetenableattr.c b/cpukit/posix/src/clocksetenableattr.c index 9719147415..592b82341e 100644 --- a/cpukit/posix/src/clocksetenableattr.c +++ b/cpukit/posix/src/clocksetenableattr.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Clock set Enable Attribute Access + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/condattrdestroy.c b/cpukit/posix/src/condattrdestroy.c index 9f4a3949b6..6f686fe1df 100644 --- a/cpukit/posix/src/condattrdestroy.c +++ b/cpukit/posix/src/condattrdestroy.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Destroy Condition Attribute + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/condattrinit.c b/cpukit/posix/src/condattrinit.c index 83728bcdae..89b806cb7e 100644 --- a/cpukit/posix/src/condattrinit.c +++ b/cpukit/posix/src/condattrinit.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Initialization of Conditional Attributes + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/keysetspecific.c b/cpukit/posix/src/keysetspecific.c index 5b7fb8bc96..e631127fba 100644 --- a/cpukit/posix/src/keysetspecific.c +++ b/cpukit/posix/src/keysetspecific.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Set Specific Key + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/mqueuetimedreceive.c b/cpukit/posix/src/mqueuetimedreceive.c index ba79ce16d9..58f796160c 100644 --- a/cpukit/posix/src/mqueuetimedreceive.c +++ b/cpukit/posix/src/mqueuetimedreceive.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Receive Message from Message Queue + * @ingroup POSIX + */ + /* * NOTE: The structure of the routines is identical to that of POSIX * Message_queues to leave the option of having unnamed message diff --git a/cpukit/posix/src/mutexattrgetprotocol.c b/cpukit/posix/src/mutexattrgetprotocol.c index 584a38085b..1824b3fff9 100644 --- a/cpukit/posix/src/mutexattrgetprotocol.c +++ b/cpukit/posix/src/mutexattrgetprotocol.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Get protocol Attribute of Mutex Attribute Obect + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/nanosleep.c b/cpukit/posix/src/nanosleep.c index d97112605d..02abe55cec 100644 --- a/cpukit/posix/src/nanosleep.c +++ b/cpukit/posix/src/nanosleep.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Suspends Execution of calling thread until Time elaps + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/prwlockwrlock.c b/cpukit/posix/src/prwlockwrlock.c index fffdbea3a8..16e5ecd6f1 100644 --- a/cpukit/posix/src/prwlockwrlock.c +++ b/cpukit/posix/src/prwlockwrlock.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Obtain a Write Lock on a RWlock Instance + * @ingroup POSIX + */ + /* * POSIX RWLock Manager -- Obtain a Write Lock on a RWLock Instance * diff --git a/cpukit/posix/src/psignalclearprocesssignals.c b/cpukit/posix/src/psignalclearprocesssignals.c index 3c3cdf4e68..3d1d16b5aa 100644 --- a/cpukit/posix/src/psignalclearprocesssignals.c +++ b/cpukit/posix/src/psignalclearprocesssignals.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX_signals clear_process_signals + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/pthreadattrsetschedpolicy.c b/cpukit/posix/src/pthreadattrsetschedpolicy.c index e095d719b9..ee7fe1fce3 100644 --- a/cpukit/posix/src/pthreadattrsetschedpolicy.c +++ b/cpukit/posix/src/pthreadattrsetschedpolicy.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Sets Scheduling policy Attributes of Thread Attributes Object + * @ingroup POSIX + */ + /* * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 * diff --git a/cpukit/posix/src/pthreadgetcpuclockid.c b/cpukit/posix/src/pthreadgetcpuclockid.c index 51776f046e..0b7e3bbd28 100644 --- a/cpukit/posix/src/pthreadgetcpuclockid.c +++ b/cpukit/posix/src/pthreadgetcpuclockid.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Returns Clock ID for CPU time clock of the thread + * @ingroup POSIX + */ + /* * 20.1.6 Accessing a Thread CPU-time Clock, P1003.4b/Draft 8, p. 58 * diff --git a/cpukit/posix/src/pthreadkill.c b/cpukit/posix/src/pthreadkill.c index 67ef0c7005..420aaa567f 100644 --- a/cpukit/posix/src/pthreadkill.c +++ b/cpukit/posix/src/pthreadkill.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Sends a signal Asynchronously directed to a thread + * @ingroup POSIX + */ + /* * 3.3.10 Send a Signal to a Thread, P1003.1c/D10, p. 43 * diff --git a/cpukit/posix/src/rwlockattrsetpshared.c b/cpukit/posix/src/rwlockattrsetpshared.c index f27a5b56fe..5a32530e1e 100644 --- a/cpukit/posix/src/rwlockattrsetpshared.c +++ b/cpukit/posix/src/rwlockattrsetpshared.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief RWLock Attributes Set Process Shared + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/sched_getprioritymax.c b/cpukit/posix/src/sched_getprioritymax.c index a85f02b250..5a77e258f1 100644 --- a/cpukit/posix/src/sched_getprioritymax.c +++ b/cpukit/posix/src/sched_getprioritymax.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Returns the Appropriate Maximum for Scheduling policy + * @ingroup POSIX + */ + /* * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 * diff --git a/cpukit/posix/src/sigdelset.c b/cpukit/posix/src/sigdelset.c index a559e64bbb..7567689ccd 100644 --- a/cpukit/posix/src/sigdelset.c +++ b/cpukit/posix/src/sigdelset.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Deleted Signal from Set + * @ingroup POSIX + */ + /* * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69 * diff --git a/cpukit/posix/src/timerdelete.c b/cpukit/posix/src/timerdelete.c index 89cfe2f056..473c0df3fe 100644 --- a/cpukit/posix/src/timerdelete.c +++ b/cpukit/posix/src/timerdelete.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Deletes a POSIX Interval Timer + * @ingroup POSIX + */ + /* * 14.2.3 Delete a Per_process Timer, P1003.1b-1993, p. 266 * diff --git a/cpukit/posix/src/vfork.c b/cpukit/posix/src/vfork.c index 64838c8d87..3bb0f31b83 100644 --- a/cpukit/posix/src/vfork.c +++ b/cpukit/posix/src/vfork.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Creates Child process Of The Calling process + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). -- cgit v1.2.3 From 11109ea227913904ae24b68ada25a9a18d73ec4c Mon Sep 17 00:00:00 2001 From: Alex Ivanov Date: Tue, 18 Dec 2012 15:46:38 -0500 Subject: libfs: Doxygen Enhancement Task #2 http://www.google-melange.com/gci/task/view/google/gci2012/8032207 --- cpukit/libfs/src/imfs/deviceio.c | 12 +++-- cpukit/libfs/src/imfs/imfs.h | 79 +++++++++++++++++++++++++++++- cpukit/libfs/src/imfs/imfs_creat.c | 14 +++--- cpukit/libfs/src/imfs/imfs_eval.c | 9 +++- cpukit/libfs/src/imfs/imfs_fchmod.c | 9 +++- cpukit/libfs/src/imfs/imfs_initsupp.c | 9 +++- cpukit/libfs/src/imfs/imfs_mount.c | 9 +++- cpukit/libfs/src/imfs/imfs_ntype.c | 12 +++-- cpukit/libfs/src/imfs/imfs_stat.c | 11 +++-- cpukit/libfs/src/imfs/imfs_utime.c | 12 +++-- cpukit/libfs/src/imfs/ioman.c | 16 +++--- cpukit/libfs/src/pipe/fifo.c | 31 +++--------- cpukit/libfs/src/pipe/pipe.c | 12 +++-- cpukit/libfs/src/pipe/pipe.h | 29 ++++++++--- cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c | 20 ++++---- cpukit/libfs/src/rfs/rtems-rfs-block.c | 30 ++++++------ cpukit/libfs/src/rfs/rtems-rfs-dir-hash.c | 3 +- cpukit/libfs/src/rfs/rtems-rfs-inode.c | 19 ++++--- cpukit/libfs/src/rfs/rtems-rfs-link.c | 20 ++++---- cpukit/libfs/src/rfs/rtems-rfs-mutex.c | 13 +++-- cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c | 19 ++++--- cpukit/libfs/src/rfs/rtems-rfs-rtems.c | 14 +++--- cpukit/sapi/include/rtems/io.h | 7 ++- 23 files changed, 257 insertions(+), 152 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..6615b1b157 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 #include +/** + * @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,6 +313,9 @@ 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, @@ -322,21 +340,44 @@ extern void IMFS_dump( void ); */ 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 ); @@ -362,6 +403,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 +417,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, @@ -391,6 +443,9 @@ 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 */ ); @@ -433,6 +488,16 @@ extern ssize_t memfile_write( 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,12 +532,24 @@ 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 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_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_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_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_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_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_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/pipe/fifo.c b/cpukit/libfs/src/pipe/fifo.c index 06eacd712f..ba5e7b7e40 100644 --- a/cpukit/libfs/src/pipe/fifo.c +++ b/cpukit/libfs/src/pipe/fifo.c @@ -1,6 +1,11 @@ -/* - * fifo.c: POSIX FIFO/pipe for RTEMS +/** + * @file * + * @brief FIFO/Pipe Support + * @ingroup FIFO_PIPE + */ + +/* * Author: Wei Shen * * The license and distribution terms for this file may be @@ -236,12 +241,6 @@ out: return err; } -/* - * Interface to file system close. - * - * *pipep points to pipe control structure. When the last user releases pipe, - * it will be set to NULL. - */ void pipe_release( pipe_control_t **pipep, rtems_libio_t *iop @@ -299,13 +298,6 @@ void pipe_release( } -/* - * Interface to file system open. - * - * *pipep points to pipe control structure. If called with *pipep = NULL, - * fifo_open will try allocating and initializing a control structure. If the - * call succeeds, *pipep will be set to address of new control structure. - */ int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop @@ -387,9 +379,6 @@ out_error: return err; } -/* - * Interface to file system read. - */ ssize_t pipe_read( pipe_control_t *pipe, void *buffer, @@ -459,9 +448,6 @@ out_nolock: return ret; } -/* - * Interface to file system write. - */ ssize_t pipe_write( pipe_control_t *pipe, const void *buffer, @@ -545,9 +531,6 @@ out_nolock: return ret; } -/* - * Interface to file system ioctl. - */ int pipe_ioctl( pipe_control_t *pipe, ioctl_command_t cmd, diff --git a/cpukit/libfs/src/pipe/pipe.c b/cpukit/libfs/src/pipe/pipe.c index 2fc9952cac..ed64dbb1aa 100644 --- a/cpukit/libfs/src/pipe/pipe.c +++ b/cpukit/libfs/src/pipe/pipe.c @@ -1,6 +1,11 @@ -/* - * pipe.c: anonymous pipe +/** + * @file * + * @brief Create an Anonymous Pipe + * @ingroup FIFO_PIPE + */ + +/* * Author: Wei Shen * * The license and distribution terms for this file may be @@ -22,9 +27,6 @@ /* FIXME: This approach is questionable */ static uint16_t rtems_pipe_no = 0; -/* - * Called by pipe() to create an anonymous pipe. - */ int pipe_create( int filsdes[2] ) diff --git a/cpukit/libfs/src/pipe/pipe.h b/cpukit/libfs/src/pipe/pipe.h index 29e7542b43..6ba3c5ef42 100644 --- a/cpukit/libfs/src/pipe/pipe.h +++ b/cpukit/libfs/src/pipe/pipe.h @@ -22,6 +22,12 @@ extern "C" { #endif +/** + * @defgroup FIFO_PIPE FIFO/pipe File System Support + * + * @brief Interface to the POSIX FIFO/pipe File System + */ + /* Control block to manage each pipe */ typedef struct pipe_control { char *Buffer; @@ -42,14 +48,18 @@ typedef struct pipe_control { #endif } pipe_control_t; -/* +/** + * @brief Create an Anonymous Pipe + * * Called by pipe() to create an anonymous pipe. */ extern int pipe_create( int filsdes[2] ); -/* +/** + * @brief Release a Pipe + * * Interface to file system close. * * *pipep points to pipe control structure. When the last user releases pipe, @@ -60,7 +70,8 @@ extern void pipe_release( rtems_libio_t *iop ); -/* +/** + * @brief FIFO Open * Interface to file system open. * * *pipep points to pipe control structure. If called with *pipep = NULL, @@ -72,7 +83,9 @@ extern int fifo_open( rtems_libio_t *iop ); -/* +/** + * @brief Pipe Read + * * Interface to file system read. */ extern ssize_t pipe_read( @@ -82,7 +95,9 @@ extern ssize_t pipe_read( rtems_libio_t *iop ); -/* +/** + * @brief Pipe Write + * * Interface to file system write. */ extern ssize_t pipe_write( @@ -92,7 +107,9 @@ extern ssize_t pipe_write( rtems_libio_t *iop ); -/* +/** + * @brief Pipe IO Control + * * Interface to file system ioctl. */ extern int pipe_ioctl( diff --git a/cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c b/cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c index 85837b0009..c14c69d1fe 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c @@ -1,23 +1,23 @@ -/* - * COPYRIGHT (c) 2010 Chris Johns - * - * 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. - */ /** * @file * + * @brief RTEMS File Systems Bitmap Routines * @ingroup rtems-rfs - * - * RTEMS File Systems Bitmap Routines. - * + * * These functions manage bit maps. A bit map consists of the map of bit * allocated in a block and a search map where a bit represents 32 actual * bits. The search map allows for a faster search for an available bit as 32 * search bits can checked in a test. */ +/* + * COPYRIGHT (c) 2010 Chris Johns + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + #if HAVE_CONFIG_H #include "config.h" #endif diff --git a/cpukit/libfs/src/rfs/rtems-rfs-block.c b/cpukit/libfs/src/rfs/rtems-rfs-block.c index 7ebc4d76a6..4ad73b2ee3 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-block.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-block.c @@ -1,21 +1,13 @@ -/* - * COPYRIGHT (c) 2010 Chris Johns - * - * 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. - */ /** * @file * + * @brief RTEMS File Systems Block Routines * @ingroup rtems-rfs - * - * RTEMS File Systems Block Routines. - * + * * These functions manage blocks in the RFS file system. A block is an area of * the media and its size is set for a each specific media. The block size is - * set when the file system is set up and needs to be matched for it to be read - * correctly. + * set when the file system is set up and needs to be matched for it to be + * read correctly. * * Blocks are managed as groups. A block group or "group" is part of the total * number of blocks being managed by the file system and exist to allow @@ -26,12 +18,20 @@ * A group consist of a block bitmap, inodes and data blocks. The first block * of the file system will hold the superblock. The block bitmap is a * collection of blocks that hold a map of bits, one bit per block for each - * block in the group. When a file system is mounted the block bitmaps are read - * and a summary bit map is made. The summary bitmap has a single bit for 32 - * bits in the bitmap and is set when all 32 bits it maps to are set. This + * block in the group. When a file system is mounted the block bitmaps are + * read and a summary bit map is made. The summary bitmap has a single bit for + * 32 bits in the bitmap and is set when all 32 bits it maps to are set. This * speeds up the search for a free block by a factor of 32. */ +/* + * COPYRIGHT (c) 2010 Chris Johns + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + #if HAVE_CONFIG_H #include "config.h" #endif diff --git a/cpukit/libfs/src/rfs/rtems-rfs-dir-hash.c b/cpukit/libfs/src/rfs/rtems-rfs-dir-hash.c index 951bce1a0a..db8f21a8b0 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-dir-hash.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-dir-hash.c @@ -1,9 +1,8 @@ /** * @file * + * @brief RTEMS File Systems Directory Hash function * @ingroup rtems-rfs - * - * RTEMS File Systems Directory Hash function. */ #if HAVE_CONFIG_H diff --git a/cpukit/libfs/src/rfs/rtems-rfs-inode.c b/cpukit/libfs/src/rfs/rtems-rfs-inode.c index 6c49b2ac7a..51129e9378 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-inode.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-inode.c @@ -1,20 +1,19 @@ -/* - * COPYRIGHT (c) 2010 Chris Johns - * - * 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. - */ /** * @file * + * @brief RTEMS File Systems Inode Routines * @ingroup rtems-rfs - * - * RTEMS File Systems Inode Routines. - * + * * These functions manage inodes in the RFS file system. An inode is part of a * block that reside after the bitmaps in the group. */ +/* + * COPYRIGHT (c) 2010 Chris Johns + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ #if HAVE_CONFIG_H #include "config.h" diff --git a/cpukit/libfs/src/rfs/rtems-rfs-link.c b/cpukit/libfs/src/rfs/rtems-rfs-link.c index 7211e3ad59..225a37fac9 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-link.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-link.c @@ -1,3 +1,13 @@ +/** + * @file + * + * @brief RTEMS File Systems Link Routines + * @ingroup rtems-rfs + * + * These functions manage links. A link is the addition of a directory entry + * in a parent directory and incrementing the links count in the inode. + */ + /* * COPYRIGHT (c) 2010 Chris Johns * @@ -5,16 +15,6 @@ * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. */ -/** - * @file - * - * @ingroup rtems-rfs - * - * RTEMS File Systems Link Routines. - * - * These functions manage links. A link is the addition of a directory entry in - * a parent directory and incrementing the links count in the inode. - */ #if HAVE_CONFIG_H #include "config.h" diff --git a/cpukit/libfs/src/rfs/rtems-rfs-mutex.c b/cpukit/libfs/src/rfs/rtems-rfs-mutex.c index 4fd6f384fe..7bf92f7cd5 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-mutex.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-mutex.c @@ -1,3 +1,9 @@ +/** + * @file + * + * @brief RTEMS File System Mutex + * @ingroup rtems-rfs + */ /* * COPYRIGHT (c) 2010 Chris Johns * @@ -5,13 +11,6 @@ * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. */ -/** - * @file - * - * @ingroup rtems-rfs - * - * RTEMS File System Mutex. - */ #if HAVE_CONFIG_H #include "config.h" diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c index ced234a796..97d0104cdd 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c @@ -1,20 +1,19 @@ -/* - * COPYRIGHT (c) 2010 Chris Johns - * - * 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. - */ /** * @file * + * @brief RTEMS RFS Device Interface * @ingroup rtems-rfs - * - * RTEMS RFS Device Interface. - * + * * This file contains the set of handlers used to map operations on RFS device * nodes onto calls to the RTEMS Classic API IO Manager. + */ + +/* + * COPYRIGHT (c) 2010 Chris Johns * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. */ #if HAVE_CONFIG_H diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c index 6ff9793911..d2aac56429 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief RTEMS File System Interface for RTEMS + * @ingroup rtems-rfs + */ + /* * COPYRIGHT (c) 2010 Chris Johns * @@ -8,13 +15,6 @@ * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. */ -/** - * @file - * - * @ingroup rtems-rfs - * - * RTEMS File System Interface for RTEMS. - */ #if HAVE_CONFIG_H #include "config.h" diff --git a/cpukit/sapi/include/rtems/io.h b/cpukit/sapi/include/rtems/io.h index f4e7d49edc..2a268fa51e 100644 --- a/cpukit/sapi/include/rtems/io.h +++ b/cpukit/sapi/include/rtems/io.h @@ -4,6 +4,9 @@ * @ingroup ClassicIO * * @brief Classic Input/Output Manager API. + * + * This file emulates the old Classic RTEMS IO manager directives + * which register and lookup names using the in-memory filesystem. */ /* @@ -115,9 +118,11 @@ rtems_status_code rtems_io_unregister_driver( /** * @brief Registers the name @a device_name in the file system for the device * with number tuple @a major and @a minor. + * + * This assumes that all registered devices are character devices. * * @retval RTEMS_SUCCESSFUL Name successfully registered. - * @retval RTEMS_TOO_MANY Name already in use or other errors. + * @retval RTEMS_TOO_MANY Name already in use or other errors. */ rtems_status_code rtems_io_register_name( const char *device_name, -- cgit v1.2.3 From b1efb2fab7163ec7caf95fe8cc78b31cb359e2d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20Cors=C3=A9pius?= Date: Wed, 19 Dec 2012 14:13:48 +0100 Subject: Update from automake-1.12.6. --- config.sub | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config.sub b/config.sub index 89b1286300..8df5511094 100755 --- a/config.sub +++ b/config.sub @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. -timestamp='2012-10-10' +timestamp='2012-12-06' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -1026,7 +1026,11 @@ case $basic_machine in basic_machine=i586-unknown os=-pw32 ;; - rdos) + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) basic_machine=i386-pc os=-rdos ;; -- cgit v1.2.3 From 9889d5172446acbc69b97fc74a44449c4d2b5351 Mon Sep 17 00:00:00 2001 From: Ayush Awasthi Date: Wed, 19 Dec 2012 09:49:08 -0500 Subject: posix: Doxygen Enhancement Task #3 http://www.google-melange.com/gci/task/view/google/gci2012/8022219 --- cpukit/posix/src/aio_error.c | 7 +++++++ cpukit/posix/src/aio_fsync.c | 7 +++++++ cpukit/posix/src/cancelrun.c | 7 +++++++ cpukit/posix/src/condattrsetpshared.c | 7 +++++++ cpukit/posix/src/conddefaultattributes.c | 7 +++++++ cpukit/posix/src/fork.c | 7 +++++++ cpukit/posix/src/kill_r.c | 7 +++++++ cpukit/posix/src/killinfo.c | 7 +++++++ cpukit/posix/src/mutexattrgetpshared.c | 7 +++++++ cpukit/posix/src/mutexgetprioceiling.c | 7 +++++++ cpukit/posix/src/mutexsetprioceiling.c | 7 +++++++ cpukit/posix/src/prwlockinit.c | 7 +++++++ cpukit/posix/src/pthreadattrgetschedparam.c | 7 +++++++ cpukit/posix/src/pthreadattrsetstackaddr.c | 7 +++++++ cpukit/posix/src/pthreadsigmask.c | 7 +++++++ cpukit/posix/src/ptimer.c | 7 +++++++ cpukit/posix/src/sched_rr_get_interval.c | 7 +++++++ cpukit/posix/src/semaphoretranslatereturncode.c | 7 +++++++ cpukit/posix/src/seminit.c | 7 +++++++ cpukit/posix/src/sigaction.c | 7 +++++++ 20 files changed, 140 insertions(+) diff --git a/cpukit/posix/src/aio_error.c b/cpukit/posix/src/aio_error.c index 1765f21622..e29c8361b1 100644 --- a/cpukit/posix/src/aio_error.c +++ b/cpukit/posix/src/aio_error.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Returns the error status for the Asynchronous I/O request + * @ingroup POSIX + */ + /* * Copyright 2010, Alin Rus * diff --git a/cpukit/posix/src/aio_fsync.c b/cpukit/posix/src/aio_fsync.c index 7021082930..0330076696 100644 --- a/cpukit/posix/src/aio_fsync.c +++ b/cpukit/posix/src/aio_fsync.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Syncing of all Outstanding Asynchronous I/O Operations + * @ingroup POSIX + */ + /* * Copyright 2010, Alin Rus * diff --git a/cpukit/posix/src/cancelrun.c b/cpukit/posix/src/cancelrun.c index 91749281d8..39a8de763d 100644 --- a/cpukit/posix/src/cancelrun.c +++ b/cpukit/posix/src/cancelrun.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Executes a thread's cancellation handlers + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/condattrsetpshared.c b/cpukit/posix/src/condattrsetpshared.c index f010038cbc..4e00c920c5 100644 --- a/cpukit/posix/src/condattrsetpshared.c +++ b/cpukit/posix/src/condattrsetpshared.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Initialize Condition Variable Attributes + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/conddefaultattributes.c b/cpukit/posix/src/conddefaultattributes.c index 7cca0bcb64..32ec64d69a 100644 --- a/cpukit/posix/src/conddefaultattributes.c +++ b/cpukit/posix/src/conddefaultattributes.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Condition variable Attributes structure + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/fork.c b/cpukit/posix/src/fork.c index ec24f051d7..4cfccf4a02 100644 --- a/cpukit/posix/src/fork.c +++ b/cpukit/posix/src/fork.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Inoperable implementation of fork() for POSIX threads + * @ingroup POSIX + */ + /* * fork() - POSIX 1003.1b 3.1.1 * diff --git a/cpukit/posix/src/kill_r.c b/cpukit/posix/src/kill_r.c index 301c0603cf..739fed7358 100644 --- a/cpukit/posix/src/kill_r.c +++ b/cpukit/posix/src/kill_r.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Send a Signal to a Process + * @ingroup POSIX + */ + /* * 3.3.2 Send a Signal to a Process, P1003.1b-1993, p. 68 * diff --git a/cpukit/posix/src/killinfo.c b/cpukit/posix/src/killinfo.c index 95a2459100..b7b556de39 100644 --- a/cpukit/posix/src/killinfo.c +++ b/cpukit/posix/src/killinfo.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Send a Signal to a Process + * @ingroup POSIX + */ + /* * kill() support routine * diff --git a/cpukit/posix/src/mutexattrgetpshared.c b/cpukit/posix/src/mutexattrgetpshared.c index beeae9bc87..d32ef838b6 100644 --- a/cpukit/posix/src/mutexattrgetpshared.c +++ b/cpukit/posix/src/mutexattrgetpshared.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Obtaining process-shared Attribute Value from the Attributes Object + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/mutexgetprioceiling.c b/cpukit/posix/src/mutexgetprioceiling.c index a0390b99f5..21287e2c38 100644 --- a/cpukit/posix/src/mutexgetprioceiling.c +++ b/cpukit/posix/src/mutexgetprioceiling.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Returns the Current Priority Ceiling of the Mutex + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/mutexsetprioceiling.c b/cpukit/posix/src/mutexsetprioceiling.c index d873805e21..b11c4570ab 100644 --- a/cpukit/posix/src/mutexsetprioceiling.c +++ b/cpukit/posix/src/mutexsetprioceiling.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Changes the Priority Ceiling of a Mutex and Releases it + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/prwlockinit.c b/cpukit/posix/src/prwlockinit.c index 2cba7d66aa..61825fe1d5 100644 --- a/cpukit/posix/src/prwlockinit.c +++ b/cpukit/posix/src/prwlockinit.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Allocate resources to use the read-write lock and Initialize it + * @ingroup POSIX + */ + /* * POSIX RWLock Manager -- Destroy a RWLock Instance * diff --git a/cpukit/posix/src/pthreadattrgetschedparam.c b/cpukit/posix/src/pthreadattrgetschedparam.c index 7ec55a305d..eee962f854 100644 --- a/cpukit/posix/src/pthreadattrgetschedparam.c +++ b/cpukit/posix/src/pthreadattrgetschedparam.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Returns Scheduling Parameter Attributes of Thread Attributes Object + * @ingroup POSIX + */ + /* * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 * diff --git a/cpukit/posix/src/pthreadattrsetstackaddr.c b/cpukit/posix/src/pthreadattrsetstackaddr.c index 3c3b2b05d3..1696bb95ac 100644 --- a/cpukit/posix/src/pthreadattrsetstackaddr.c +++ b/cpukit/posix/src/pthreadattrsetstackaddr.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Sets the Thread Creation stackaddr Attribute in the attr Object + * @ingroup POSIX + */ + /* * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 * diff --git a/cpukit/posix/src/pthreadsigmask.c b/cpukit/posix/src/pthreadsigmask.c index b424daba78..9d47e44865 100644 --- a/cpukit/posix/src/pthreadsigmask.c +++ b/cpukit/posix/src/pthreadsigmask.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Examine and/or change the calling thread's signal mask + * @ingroup POSIX + */ + /* * 3.3.5 Examine and Change Blocked Signals, P1003.1b-1993, p. 73 * diff --git a/cpukit/posix/src/ptimer.c b/cpukit/posix/src/ptimer.c index 2e3526730a..1d5ac6245e 100644 --- a/cpukit/posix/src/ptimer.c +++ b/cpukit/posix/src/ptimer.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Process Timer + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/sched_rr_get_interval.c b/cpukit/posix/src/sched_rr_get_interval.c index 5fb2774ccf..b73f60f229 100644 --- a/cpukit/posix/src/sched_rr_get_interval.c +++ b/cpukit/posix/src/sched_rr_get_interval.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Limits for Scheduling Parameter + * @ingroup POSIX + */ + /* * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 * diff --git a/cpukit/posix/src/semaphoretranslatereturncode.c b/cpukit/posix/src/semaphoretranslatereturncode.c index 2f1af1dd1b..2c54b9fb49 100644 --- a/cpukit/posix/src/semaphoretranslatereturncode.c +++ b/cpukit/posix/src/semaphoretranslatereturncode.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Semaphore Code Translation Error + * @ingroup POSIX + */ + /* * POSIX Semaphore Error Translation * diff --git a/cpukit/posix/src/seminit.c b/cpukit/posix/src/seminit.c index 42dd0405d1..be7056dcad 100644 --- a/cpukit/posix/src/seminit.c +++ b/cpukit/posix/src/seminit.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Initializing of an Unnamed Semaphore + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/sigaction.c b/cpukit/posix/src/sigaction.c index 9fb04a042d..b2906558e0 100644 --- a/cpukit/posix/src/sigaction.c +++ b/cpukit/posix/src/sigaction.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Allows calling process to examine action of a Specific Signal + * @ingroup POSIX + */ + /* * 3.3.4 Examine and Change Signal Action, P1003.1b-1993, p. 70 * -- cgit v1.2.3 From 148e3de629fff11c7598ff178cb125ae3f8b5d12 Mon Sep 17 00:00:00 2001 From: Mathew Kallada Date: Wed, 19 Dec 2012 09:51:38 -0500 Subject: libmisc: Doxygen Enhancement Task #2 http://www.google-melange.com/gci/task/view/google/gci2012/7959228 --- cpukit/libmisc/stringto/stringto.h | 7 +++++++ cpukit/libmisc/stringto/stringtodouble.c | 9 ++++++++- cpukit/libmisc/stringto/stringtoint.c | 9 ++++++++- cpukit/libmisc/stringto/stringtolong.c | 9 ++++++++- cpukit/libmisc/stringto/stringtolonglong.c | 9 ++++++++- cpukit/libmisc/stringto/stringtopointer.c | 7 +++++++ cpukit/libmisc/stringto/stringtounsignedint.c | 9 ++++++++- cpukit/libmisc/stringto/stringtounsignedlong.c | 9 ++++++++- cpukit/libmisc/untar/untar.c | 13 +++++++++++-- cpukit/libmisc/untar/untar.h | 8 +++++++- 10 files changed, 80 insertions(+), 9 deletions(-) diff --git a/cpukit/libmisc/stringto/stringto.h b/cpukit/libmisc/stringto/stringto.h index c8ed6b49ef..d4611518c7 100644 --- a/cpukit/libmisc/stringto/stringto.h +++ b/cpukit/libmisc/stringto/stringto.h @@ -15,6 +15,12 @@ #ifndef _RTEMS_STRINGTO_H #define _RTEMS_STRINGTO_H +/** + * @defgroup libmisc_conv_help Conversion Helpers + * + * @ingroup libmisc + */ +/**@{*/ #include @@ -248,3 +254,4 @@ rtems_status_code rtems_string_to_long_double( ); #endif +/**@}*/ \ No newline at end of file diff --git a/cpukit/libmisc/stringto/stringtodouble.c b/cpukit/libmisc/stringto/stringtodouble.c index 4ef94ab435..09605ce528 100644 --- a/cpukit/libmisc/stringto/stringtodouble.c +++ b/cpukit/libmisc/stringto/stringtodouble.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Convert String to Double (with validation) + * @ingroup libmisc_conv_help Conversion Helpers + */ + /* * COPYRIGHT (c) 2009. * On-Line Applications Research Corporation (OAR). @@ -46,7 +53,7 @@ rtems_status_code rtems_string_to_double ( if ( end == s ) return RTEMS_NOT_DEFINED; - if ( ( errno == ERANGE ) && + if ( ( errno == ERANGE ) && (( result == 0 ) || ( result == HUGE_VAL ) || ( result == -HUGE_VAL ))) return RTEMS_INVALID_NUMBER; diff --git a/cpukit/libmisc/stringto/stringtoint.c b/cpukit/libmisc/stringto/stringtoint.c index ee2e31f2f8..df3de2b39f 100644 --- a/cpukit/libmisc/stringto/stringtoint.c +++ b/cpukit/libmisc/stringto/stringtoint.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Convert String to Int (with validation) + * @ingroup libmisc_conv_help Conversion Helpers + */ + /* * COPYRIGHT (c) 2009. * On-Line Applications Research Corporation (OAR). @@ -47,7 +54,7 @@ rtems_status_code rtems_string_to_int ( if ( end == s ) return RTEMS_NOT_DEFINED; - if ( ( errno == ERANGE ) && + if ( ( errno == ERANGE ) && (( result == 0 ) || ( result == LONG_MAX ) || ( result == LONG_MIN ))) return RTEMS_INVALID_NUMBER; diff --git a/cpukit/libmisc/stringto/stringtolong.c b/cpukit/libmisc/stringto/stringtolong.c index 15e7e4d747..ab830c5a83 100644 --- a/cpukit/libmisc/stringto/stringtolong.c +++ b/cpukit/libmisc/stringto/stringtolong.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Convert String to Long (with validation) + * @ingroup libmisc_conv_help Conversion Helpers + */ + /* * COPYRIGHT (c) 2009. * On-Line Applications Research Corporation (OAR). @@ -47,7 +54,7 @@ rtems_status_code rtems_string_to_long ( if ( end == s ) return RTEMS_NOT_DEFINED; - if ( ( errno == ERANGE ) && + if ( ( errno == ERANGE ) && (( result == 0 ) || ( result == LONG_MAX ) || ( result == LONG_MIN ))) return RTEMS_INVALID_NUMBER; diff --git a/cpukit/libmisc/stringto/stringtolonglong.c b/cpukit/libmisc/stringto/stringtolonglong.c index 8f70f0e172..64df7cfeb1 100644 --- a/cpukit/libmisc/stringto/stringtolonglong.c +++ b/cpukit/libmisc/stringto/stringtolonglong.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Convert String to Long Long (with validation) + * @ingroup libmisc_conv_help Conversion Helpers + */ + /* * COPYRIGHT (c) 2009. * On-Line Applications Research Corporation (OAR). @@ -56,7 +63,7 @@ rtems_status_code rtems_string_to_long_long ( if ( end == s ) return RTEMS_NOT_DEFINED; - if ( ( errno == ERANGE ) && + if ( ( errno == ERANGE ) && (( result == 0 ) || ( result == LONG_LONG_MAX ) || ( result == LONG_LONG_MIN ))) return RTEMS_INVALID_NUMBER; diff --git a/cpukit/libmisc/stringto/stringtopointer.c b/cpukit/libmisc/stringto/stringtopointer.c index 13e68475b9..6cf5bff08a 100644 --- a/cpukit/libmisc/stringto/stringtopointer.c +++ b/cpukit/libmisc/stringto/stringtopointer.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Convert String to Pointer (with validation) + * @ingroup libmisc_conv_help Conversion Helpers + */ + /* * COPYRIGHT (c) 2009. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/libmisc/stringto/stringtounsignedint.c b/cpukit/libmisc/stringto/stringtounsignedint.c index b7a24be54d..53aaf10bf8 100644 --- a/cpukit/libmisc/stringto/stringtounsignedint.c +++ b/cpukit/libmisc/stringto/stringtounsignedint.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Convert String to Unsigned Int (with validation) + * @ingroup libmisc_conv_help Conversion Helpers + */ + /* * COPYRIGHT (c) 2009. * On-Line Applications Research Corporation (OAR). @@ -47,7 +54,7 @@ rtems_status_code rtems_string_to_unsigned_int ( if ( end == s ) return RTEMS_NOT_DEFINED; - if ( ( errno == ERANGE ) && + if ( ( errno == ERANGE ) && (( result == 0 ) || ( result == ULONG_MAX ))) return RTEMS_INVALID_NUMBER; diff --git a/cpukit/libmisc/stringto/stringtounsignedlong.c b/cpukit/libmisc/stringto/stringtounsignedlong.c index 305f23f327..4e5ae94089 100644 --- a/cpukit/libmisc/stringto/stringtounsignedlong.c +++ b/cpukit/libmisc/stringto/stringtounsignedlong.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Convert String to Unsigned Long Long (with validation) + * @ingroup libmisc_conv_help Conversion Helpers + */ + /* * COPYRIGHT (c) 2009. * On-Line Applications Research Corporation (OAR). @@ -47,7 +54,7 @@ rtems_status_code rtems_string_to_unsigned_long ( if ( end == s ) return RTEMS_NOT_DEFINED; - if ( ( errno == ERANGE ) && + if ( ( errno == ERANGE ) && (( result == 0 ) || ( result == ULONG_MAX ))) return RTEMS_INVALID_NUMBER; diff --git a/cpukit/libmisc/untar/untar.c b/cpukit/libmisc/untar/untar.c index 337782b5c1..5cebc2d9ed 100644 --- a/cpukit/libmisc/untar/untar.c +++ b/cpukit/libmisc/untar/untar.c @@ -1,8 +1,17 @@ -/* FIXME: +/** + * @file + * + * @brief Untar an Image + * @ingroup libmisc_untar_img Untar Image + * + * FIXME: * 1. Symbolic links are not created. * 2. Untar_FromMemory uses FILE *fp. * 3. How to determine end of archive? * + */ + +/* * Written by: Jake Janovetz * * The license and distribution terms for this file may be @@ -274,7 +283,7 @@ Untar_FromFile( if (bufr == NULL) { return(UNTAR_FAIL); } - + while (1) { /* Read the header */ diff --git a/cpukit/libmisc/untar/untar.h b/cpukit/libmisc/untar/untar.h index dca8216644..81cbd0e8ba 100644 --- a/cpukit/libmisc/untar/untar.h +++ b/cpukit/libmisc/untar/untar.h @@ -18,6 +18,12 @@ #include #include +/** + * @defgroup libmisc_untar_img Untar Image + * + * @ingroup libmisc + */ +/**@{*/ #ifdef __cplusplus extern "C" { #endif @@ -49,5 +55,5 @@ _rtems_tar_header_checksum(const char *bufr); #ifdef __cplusplus } #endif - +/**@}*/ #endif /* _RTEMS_UNTAR_H */ -- cgit v1.2.3 From ab8721996a0b529adb629e602406bf54d387eb39 Mon Sep 17 00:00:00 2001 From: Alex Ivanov Date: Wed, 19 Dec 2012 09:53:08 -0500 Subject: posix: Doxygen Enhancement Task #10 http://www.google-melange.com/gci/task/view/google/gci2012/7997223 --- cpukit/posix/src/aio_write.c | 7 +++++++ cpukit/posix/src/canceleval.c | 7 +++++++ cpukit/posix/src/clockgetcpuclockid.c | 7 +++++++ cpukit/posix/src/getitimer.c | 7 +++++++ cpukit/posix/src/mqueueclose.c | 7 +++++++ cpukit/posix/src/mqueueopen.c | 7 +++++++ cpukit/posix/src/mqueuetranslatereturncode.c | 7 +++++++ cpukit/posix/src/mutexattrsetpshared.c | 7 +++++++ cpukit/posix/src/pbarriertranslatereturncode.c | 7 +++++++ cpukit/posix/src/prwlockunlock.c | 7 +++++++ cpukit/posix/src/pthreadattrgetdetachstate.c | 7 +++++++ cpukit/posix/src/pthreadattrsetscope.c | 7 +++++++ cpukit/posix/src/pthreadattrsetstack.c | 7 +++++++ cpukit/posix/src/pthreadgetschedparam.c | 7 +++++++ cpukit/posix/src/pthreadself.c | 7 +++++++ cpukit/posix/src/pthreadsetschedparam.c | 7 +++++++ cpukit/posix/src/sigaddset.c | 7 +++++++ cpukit/posix/src/sigwaitinfo.c | 6 ++++++ cpukit/posix/src/testcancel.c | 7 +++++++ cpukit/posix/src/timerinserthelper.c | 7 +++++++ 20 files changed, 139 insertions(+) diff --git a/cpukit/posix/src/aio_write.c b/cpukit/posix/src/aio_write.c index 7895c8c218..a510946837 100644 --- a/cpukit/posix/src/aio_write.c +++ b/cpukit/posix/src/aio_write.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function queues I/O request described by buffer pointed by aiocb + * @ingroup POSIX + */ + /* * Copyright 2010, Alin Rus * diff --git a/cpukit/posix/src/canceleval.c b/cpukit/posix/src/canceleval.c index be7400289c..804efb4726 100644 --- a/cpukit/posix/src/canceleval.c +++ b/cpukit/posix/src/canceleval.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Function Evaluates Thread Cancellation and Enables Dispatch + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/clockgetcpuclockid.c b/cpukit/posix/src/clockgetcpuclockid.c index 8908ab6801..fb04e174aa 100644 --- a/cpukit/posix/src/clockgetcpuclockid.c +++ b/cpukit/posix/src/clockgetcpuclockid.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Returns Clock ID of CPU-time Clock of process specified + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/getitimer.c b/cpukit/posix/src/getitimer.c index 316d43ea77..a7ee836b04 100644 --- a/cpukit/posix/src/getitimer.c +++ b/cpukit/posix/src/getitimer.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Gets Value of an Interval Timer + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-20089 * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/mqueueclose.c b/cpukit/posix/src/mqueueclose.c index 7fe1cebd33..8492c90705 100644 --- a/cpukit/posix/src/mqueueclose.c +++ b/cpukit/posix/src/mqueueclose.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function closes the Message Queue + * @ingroup POSIX + */ + /* * NOTE: The structure of the routines is identical to that of POSIX * Message_queues to leave the option of having unnamed message diff --git a/cpukit/posix/src/mqueueopen.c b/cpukit/posix/src/mqueueopen.c index b822978bc9..d5f783990e 100644 --- a/cpukit/posix/src/mqueueopen.c +++ b/cpukit/posix/src/mqueueopen.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Creates a new POSIX Message Queue or Opens an Existing Queue + * @ingroup POSIX + */ + /* * NOTE: The structure of the routines is identical to that of POSIX * Message_queues to leave the option of having unnamed message diff --git a/cpukit/posix/src/mqueuetranslatereturncode.c b/cpukit/posix/src/mqueuetranslatereturncode.c index b088eef179..34edf80a24 100644 --- a/cpukit/posix/src/mqueuetranslatereturncode.c +++ b/cpukit/posix/src/mqueuetranslatereturncode.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Error Translation in Message Queue + * @ingroup POSIX + */ + /* * POSIX Message Queue Error Translation * diff --git a/cpukit/posix/src/mutexattrsetpshared.c b/cpukit/posix/src/mutexattrsetpshared.c index 6f9f9b4f9a..87e8b52f2b 100644 --- a/cpukit/posix/src/mutexattrsetpshared.c +++ b/cpukit/posix/src/mutexattrsetpshared.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function sets Current pshared Attribute for Mutex Attributes Object + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/pbarriertranslatereturncode.c b/cpukit/posix/src/pbarriertranslatereturncode.c index b7d1999d93..e8a53ec459 100644 --- a/cpukit/posix/src/pbarriertranslatereturncode.c +++ b/cpukit/posix/src/pbarriertranslatereturncode.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Translates POSIX Barrier Status Code + * @ingroup POSIX + */ + /* * Barrier Manager -- Translate SuperCore Status * diff --git a/cpukit/posix/src/prwlockunlock.c b/cpukit/posix/src/prwlockunlock.c index 86f26d7a23..79042b259d 100644 --- a/cpukit/posix/src/prwlockunlock.c +++ b/cpukit/posix/src/prwlockunlock.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Releases a lock held on RWLock object referenced by rwlock + * @ingroup POSIX + */ + /* * POSIX RWLock Manager -- Release a lock held on a RWLock Instance * diff --git a/cpukit/posix/src/pthreadattrgetdetachstate.c b/cpukit/posix/src/pthreadattrgetdetachstate.c index e9b225d23c..bd23cb7f30 100644 --- a/cpukit/posix/src/pthreadattrgetdetachstate.c +++ b/cpukit/posix/src/pthreadattrgetdetachstate.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function gets the detachstate Attribute in the attr Object + * @ingroup POSIX + */ + /* * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 * diff --git a/cpukit/posix/src/pthreadattrsetscope.c b/cpukit/posix/src/pthreadattrsetscope.c index 53a00a268b..d468524086 100644 --- a/cpukit/posix/src/pthreadattrsetscope.c +++ b/cpukit/posix/src/pthreadattrsetscope.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Sets the Contentionscope Attribute in the attr Object + * @ingroup POSIX + */ + /* * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 * diff --git a/cpukit/posix/src/pthreadattrsetstack.c b/cpukit/posix/src/pthreadattrsetstack.c index 3eb4181842..04231ed791 100644 --- a/cpukit/posix/src/pthreadattrsetstack.c +++ b/cpukit/posix/src/pthreadattrsetstack.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Sets Thread Creation Stack Attributes in the attr object + * @ingroup POSIX + */ + /* * 16.1.1 Thread Creation Attributes * diff --git a/cpukit/posix/src/pthreadgetschedparam.c b/cpukit/posix/src/pthreadgetschedparam.c index 5311e3f5e0..8c78ccca52 100644 --- a/cpukit/posix/src/pthreadgetschedparam.c +++ b/cpukit/posix/src/pthreadgetschedparam.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Gets Scheduling Policy and Parameters of Individual Threads + * @ingroup POSIX + */ + /* * 13.5.2 Dynamic Thread Scheduling Parameters Access, * P1003.1c/Draft 10, p. 124 diff --git a/cpukit/posix/src/pthreadself.c b/cpukit/posix/src/pthreadself.c index 9400b4b7fe..0ed68be515 100644 --- a/cpukit/posix/src/pthreadself.c +++ b/cpukit/posix/src/pthreadself.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function returns the ID of the Calling Thread + * @ingroup POSIX + */ + /* * 16.1.6 Get Calling Thread's ID, p1003.1c/Draft 10, p. 152 * diff --git a/cpukit/posix/src/pthreadsetschedparam.c b/cpukit/posix/src/pthreadsetschedparam.c index 231b4f930f..d574811ae0 100644 --- a/cpukit/posix/src/pthreadsetschedparam.c +++ b/cpukit/posix/src/pthreadsetschedparam.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function sets scheduling policy and parameters of the thread + * @ingroup POSIX + */ + /* * 13.5.2 Dynamic Thread Scheduling Parameters Access, * P1003.1c/Draft 10, p. 124 diff --git a/cpukit/posix/src/sigaddset.c b/cpukit/posix/src/sigaddset.c index dac1cda520..d4e324fe5e 100644 --- a/cpukit/posix/src/sigaddset.c +++ b/cpukit/posix/src/sigaddset.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Adds Signal from Set + * @ingroup POSIX + */ + /* * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69 * diff --git a/cpukit/posix/src/sigwaitinfo.c b/cpukit/posix/src/sigwaitinfo.c index 0b2045bcad..4538f5df07 100644 --- a/cpukit/posix/src/sigwaitinfo.c +++ b/cpukit/posix/src/sigwaitinfo.c @@ -1,3 +1,9 @@ +/** + * @file + * + * @brief Suspends Execution of Calling Thread until Signals in set Deleivered + */ + /* * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 * diff --git a/cpukit/posix/src/testcancel.c b/cpukit/posix/src/testcancel.c index 400ab7efe5..6228af6165 100644 --- a/cpukit/posix/src/testcancel.c +++ b/cpukit/posix/src/testcancel.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Setting test on Cancelability State + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/timerinserthelper.c b/cpukit/posix/src/timerinserthelper.c index 9e2aa6a437..a1726770d9 100644 --- a/cpukit/posix/src/timerinserthelper.c +++ b/cpukit/posix/src/timerinserthelper.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Helper Routine for POSIX TIMERS + * @ingroup POSIX + */ + /* * Helper routine for POSIX timers * -- cgit v1.2.3 From 65f6d3ce56e0a8ebe5c998f5f26ebcbceb77d54c Mon Sep 17 00:00:00 2001 From: Ayush Awasthi Date: Wed, 19 Dec 2012 09:57:03 -0500 Subject: posix: Doxygen Enhancement Task #9 http://www.google-melange.com/gci/task/view/google/gci2012/7948216 --- cpukit/posix/src/aio_misc.c | 7 +++++++ cpukit/posix/src/aio_return.c | 7 +++++++ cpukit/posix/src/alarm.c | 7 +++++++ cpukit/posix/src/barrierattrdestroy.c | 7 +++++++ cpukit/posix/src/clockgetenableattr.c | 7 +++++++ cpukit/posix/src/clockgetres.c | 7 +++++++ cpukit/posix/src/execv.c | 7 +++++++ cpukit/posix/src/keydelete.c | 7 +++++++ cpukit/posix/src/mqueuesendsupp.c | 7 +++++++ cpukit/posix/src/mutexattrgettype.c | 7 +++++++ cpukit/posix/src/mutexlock.c | 7 +++++++ cpukit/posix/src/pbarrierinit.c | 7 +++++++ cpukit/posix/src/pspininit.c | 7 +++++++ cpukit/posix/src/pthreadattrsetinheritsched.c | 7 +++++++ cpukit/posix/src/pthreadcreate.c | 7 +++++++ cpukit/posix/src/rwlockattrinit.c | 7 +++++++ cpukit/posix/src/sched_getscheduler.c | 7 +++++++ cpukit/posix/src/semaphore.c | 7 +++++++ cpukit/posix/src/semopen.c | 7 +++++++ cpukit/posix/src/sigsuspend.c | 7 +++++++ 20 files changed, 140 insertions(+) diff --git a/cpukit/posix/src/aio_misc.c b/cpukit/posix/src/aio_misc.c index 80e95636ad..12bec2eb7d 100644 --- a/cpukit/posix/src/aio_misc.c +++ b/cpukit/posix/src/aio_misc.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Actual request being processed + * @ingroup POSIX + */ + /* * Copyright 2010-2011, Alin Rus * diff --git a/cpukit/posix/src/aio_return.c b/cpukit/posix/src/aio_return.c index da10ebffa6..87c3af1f3e 100644 --- a/cpukit/posix/src/aio_return.c +++ b/cpukit/posix/src/aio_return.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Final return status for Asynchronous I/O request pointed to by aiobcp + * @ingroup POSIX + */ + /* * Copyright 2010, Alin Rus * diff --git a/cpukit/posix/src/alarm.c b/cpukit/posix/src/alarm.c index b3c902cbab..22ffcae5c3 100644 --- a/cpukit/posix/src/alarm.c +++ b/cpukit/posix/src/alarm.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief System Generates Signal for process after realtime seconds elapsed + * @ingroup POSIX + */ + /* * 3.4.1 Schedule Alarm, P1003.1b-1993, p. 79 */ diff --git a/cpukit/posix/src/barrierattrdestroy.c b/cpukit/posix/src/barrierattrdestroy.c index f8c1a99355..c0a6fada2c 100644 --- a/cpukit/posix/src/barrierattrdestroy.c +++ b/cpukit/posix/src/barrierattrdestroy.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function shall Destroy a Barrier Attribues Object + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/clockgetenableattr.c b/cpukit/posix/src/clockgetenableattr.c index 7d7bf895cb..8420c2be88 100644 --- a/cpukit/posix/src/clockgetenableattr.c +++ b/cpukit/posix/src/clockgetenableattr.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Clock get Enable Attribute Access + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/clockgetres.c b/cpukit/posix/src/clockgetres.c index 623fa2433a..60d516d26e 100644 --- a/cpukit/posix/src/clockgetres.c +++ b/cpukit/posix/src/clockgetres.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Returns the Resolution of any Clock + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/execv.c b/cpukit/posix/src/execv.c index 8c56274698..26d62b123d 100644 --- a/cpukit/posix/src/execv.c +++ b/cpukit/posix/src/execv.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Inoperable implementation of execv for POSIX threads + * @ingroup POSIX + */ + /* * execv() - POSIX 1003.1b 3.1.2 * diff --git a/cpukit/posix/src/keydelete.c b/cpukit/posix/src/keydelete.c index b0b5daa3be..41d57772bf 100644 --- a/cpukit/posix/src/keydelete.c +++ b/cpukit/posix/src/keydelete.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Deletes Thread-specific Data Key Previously Returned by keycreate.c + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/mqueuesendsupp.c b/cpukit/posix/src/mqueuesendsupp.c index dc70c471e0..3fbe0fb164 100644 --- a/cpukit/posix/src/mqueuesendsupp.c +++ b/cpukit/posix/src/mqueuesendsupp.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Message Queue and Send Support + * @ingroup POSIX + */ + /* * NOTE: The structure of the routines is identical to that of POSIX * Message_queues to leave the option of having unnamed message diff --git a/cpukit/posix/src/mutexattrgettype.c b/cpukit/posix/src/mutexattrgettype.c index 23d0bb875f..9137271d9d 100644 --- a/cpukit/posix/src/mutexattrgettype.c +++ b/cpukit/posix/src/mutexattrgettype.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function gets the Mutex Type Attribute + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/mutexlock.c b/cpukit/posix/src/mutexlock.c index 0e3125f06f..be5e4d56df 100644 --- a/cpukit/posix/src/mutexlock.c +++ b/cpukit/posix/src/mutexlock.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Call to function enables locking of Mutex Object referenced by mutex + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/pbarrierinit.c b/cpukit/posix/src/pbarrierinit.c index 077d63289c..c3077cb903 100644 --- a/cpukit/posix/src/pbarrierinit.c +++ b/cpukit/posix/src/pbarrierinit.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Call to Function Enables Reinitializing of the Barrier + * @ingroup POSIX + */ + /* * POSIX Barrier Manager -- Initialize a Barrier Instance * diff --git a/cpukit/posix/src/pspininit.c b/cpukit/posix/src/pspininit.c index 4a1019abaa..030bb50ae2 100644 --- a/cpukit/posix/src/pspininit.c +++ b/cpukit/posix/src/pspininit.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Function Initializes a Spinlock Instance + * @ingroup POSIX + */ + /* * POSIX Spinlock Manager -- Initialize a Spinlock Instance * diff --git a/cpukit/posix/src/pthreadattrsetinheritsched.c b/cpukit/posix/src/pthreadattrsetinheritsched.c index 65c43dd24a..2951444fcf 100644 --- a/cpukit/posix/src/pthreadattrsetinheritsched.c +++ b/cpukit/posix/src/pthreadattrsetinheritsched.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function sets the inheritsched Attribute in the attr Argument + * @ingroup POSIX + */ + /* * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 * diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c index c320f40660..30551ac64c 100644 --- a/cpukit/posix/src/pthreadcreate.c +++ b/cpukit/posix/src/pthreadcreate.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Starts a New Thread in The Calling Process + * @ingroup POSIX + */ + /* * 16.1.2 Thread Creation, P1003.1c/Draft 10, p. 144 */ diff --git a/cpukit/posix/src/rwlockattrinit.c b/cpukit/posix/src/rwlockattrinit.c index ea88e002b2..381cd52b0d 100644 --- a/cpukit/posix/src/rwlockattrinit.c +++ b/cpukit/posix/src/rwlockattrinit.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Initialises a RWLock Attributes object attr with the default value + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/sched_getscheduler.c b/cpukit/posix/src/sched_getscheduler.c index 755b38e2a6..6f12cd7868 100644 --- a/cpukit/posix/src/sched_getscheduler.c +++ b/cpukit/posix/src/sched_getscheduler.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Returns Scheduling Policy of the process specified by pid + * @ingroup POSIX + */ + /* * 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256 * diff --git a/cpukit/posix/src/semaphore.c b/cpukit/posix/src/semaphore.c index a64fe81206..b214a3c302 100644 --- a/cpukit/posix/src/semaphore.c +++ b/cpukit/posix/src/semaphore.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Function Initializes Semaphore Manager + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/semopen.c b/cpukit/posix/src/semopen.c index 3354369936..1ecd75105b 100644 --- a/cpukit/posix/src/semopen.c +++ b/cpukit/posix/src/semopen.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Creates New POSIX semaphore or Opens an existing Semaphore + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/sigsuspend.c b/cpukit/posix/src/sigsuspend.c index f84d11f119..b1f1c4cc77 100644 --- a/cpukit/posix/src/sigsuspend.c +++ b/cpukit/posix/src/sigsuspend.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Replacing signal mask with *sigmask and suspending calling process + * @ingroup POSIX + */ + /* * 3.3.7 Wait for a Signal, P1003.1b-1993, p. 75 * -- cgit v1.2.3 From 1be3fad9b473831c83ef2ded0125d402880b7e45 Mon Sep 17 00:00:00 2001 From: Ayush Awasthi Date: Wed, 19 Dec 2012 22:23:52 -0500 Subject: posix: Doxygen Enhancement Task #6 http://www.google-melange.com/gci/task/view/google/gci2012/7945218 --- cpukit/posix/src/cleanuppop.c | 7 +++++++ cpukit/posix/src/execl.c | 7 +++++++ cpukit/posix/src/keyfreememory.c | 7 +++++++ cpukit/posix/src/lio_listio.c | 7 +++++++ cpukit/posix/src/mqueuesend.c | 7 +++++++ cpukit/posix/src/mutexlocksupp.c | 7 +++++++ cpukit/posix/src/prwlocktimedwrlock.c | 7 +++++++ cpukit/posix/src/pspinunlock.c | 7 +++++++ cpukit/posix/src/pthreadattrgetscope.c | 7 +++++++ cpukit/posix/src/pthreadattrgetstack.c | 7 +++++++ cpukit/posix/src/pthreadattrsetstacksize.c | 7 +++++++ cpukit/posix/src/pthreadjoin.c | 7 +++++++ cpukit/posix/src/pthreadonce.c | 7 +++++++ cpukit/posix/src/rwlockattrdestroy.c | 7 +++++++ cpukit/posix/src/sched_setparam.c | 7 +++++++ cpukit/posix/src/semaphorecreatesupp.c | 7 +++++++ cpukit/posix/src/setcanceltype.c | 7 +++++++ cpukit/posix/src/signal_2.c | 7 +++++++ cpukit/posix/src/timergettime.c | 7 +++++++ cpukit/posix/src/timersettime.c | 7 +++++++ 20 files changed, 140 insertions(+) diff --git a/cpukit/posix/src/cleanuppop.c b/cpukit/posix/src/cleanuppop.c index 06e56509b6..9e198f74c9 100644 --- a/cpukit/posix/src/cleanuppop.c +++ b/cpukit/posix/src/cleanuppop.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Removes Routine from Top of Calling Thread's stack and Invoke it + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/execl.c b/cpukit/posix/src/execl.c index d329e5f7c9..61b9a74fce 100644 --- a/cpukit/posix/src/execl.c +++ b/cpukit/posix/src/execl.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Process will get Executed and then Terminated by execl + * @ingroup POSIX + */ + /* * execl() - POSIX 1003.1b 3.1.2 * diff --git a/cpukit/posix/src/keyfreememory.c b/cpukit/posix/src/keyfreememory.c index d5ef5ee989..35e8a36918 100644 --- a/cpukit/posix/src/keyfreememory.c +++ b/cpukit/posix/src/keyfreememory.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Function Keys Free Memory + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2010. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/lio_listio.c b/cpukit/posix/src/lio_listio.c index 235e689a63..9b53b4d858 100644 --- a/cpukit/posix/src/lio_listio.c +++ b/cpukit/posix/src/lio_listio.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Initiates a List of I/O Requests with Single Function Call + * @ingroup POSIX + */ + /* * 6.7.4 List Directed I/O, P1003.1b-1993, p. 158 * diff --git a/cpukit/posix/src/mqueuesend.c b/cpukit/posix/src/mqueuesend.c index 9448dbbe7b..0d67b6d337 100644 --- a/cpukit/posix/src/mqueuesend.c +++ b/cpukit/posix/src/mqueuesend.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Adds Message Pointed by msg_ptr to Message Queue Reffered by mqdes + * @ingroup POSIX + */ + /* * NOTE: The structure of the routines is identical to that of POSIX * Message_queues to leave the option of having unnamed message diff --git a/cpukit/posix/src/mutexlocksupp.c b/cpukit/posix/src/mutexlocksupp.c index 299aaa162b..6b5d7bd92f 100644 --- a/cpukit/posix/src/mutexlocksupp.c +++ b/cpukit/posix/src/mutexlocksupp.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Support Call to function Enables Locking of Mutex Object + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/prwlocktimedwrlock.c b/cpukit/posix/src/prwlocktimedwrlock.c index 5e6e4ba419..ca435373ff 100644 --- a/cpukit/posix/src/prwlocktimedwrlock.c +++ b/cpukit/posix/src/prwlocktimedwrlock.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function applies a Write lock to RWLock referenced by rwlock + * @ingroup POSIX + */ + /* * POSIX RWLock Manager -- Attempt to Obtain a Write Lock on a RWLock Instance * diff --git a/cpukit/posix/src/pspinunlock.c b/cpukit/posix/src/pspinunlock.c index 4fb1391977..67a69cbc02 100644 --- a/cpukit/posix/src/pspinunlock.c +++ b/cpukit/posix/src/pspinunlock.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Unlocks a Spin Lock Object + * @ingroup POSIX + */ + /* * POSIX Spinlock Manager -- Wait at a Spinlock * diff --git a/cpukit/posix/src/pthreadattrgetscope.c b/cpukit/posix/src/pthreadattrgetscope.c index e7eb7f8344..ee5ed4c044 100644 --- a/cpukit/posix/src/pthreadattrgetscope.c +++ b/cpukit/posix/src/pthreadattrgetscope.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function gets the Contentionscope Attribute in the attr object + * @ingroup POSIX + */ + /* * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 * diff --git a/cpukit/posix/src/pthreadattrgetstack.c b/cpukit/posix/src/pthreadattrgetstack.c index e035ee4b62..a1254ae7a1 100644 --- a/cpukit/posix/src/pthreadattrgetstack.c +++ b/cpukit/posix/src/pthreadattrgetstack.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Gets the Thread Creation Stack Attributes in the attr + * @ingroup POSIX + */ + /* * 16.1.1 Thread Creation Attributes * diff --git a/cpukit/posix/src/pthreadattrsetstacksize.c b/cpukit/posix/src/pthreadattrsetstacksize.c index d6a2050a53..eb269e3df9 100644 --- a/cpukit/posix/src/pthreadattrsetstacksize.c +++ b/cpukit/posix/src/pthreadattrsetstacksize.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Sets the Thread Creation Stacksize Attribute in the attr object + * @ingroup POSIX + */ + /* * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 * diff --git a/cpukit/posix/src/pthreadjoin.c b/cpukit/posix/src/pthreadjoin.c index ac48612505..115f39d103 100644 --- a/cpukit/posix/src/pthreadjoin.c +++ b/cpukit/posix/src/pthreadjoin.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Suspends Execution of Calling Thread until Target Thread Terminates + * @ingroup POSIX + */ + /* * 16.1.3 Wait for Thread Termination, P1003.1c/Draft 10, p. 147 * diff --git a/cpukit/posix/src/pthreadonce.c b/cpukit/posix/src/pthreadonce.c index 5f598a787a..651e4d0539 100644 --- a/cpukit/posix/src/pthreadonce.c +++ b/cpukit/posix/src/pthreadonce.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Call to function by Thread will call init_routine with no Arguments + * @ingroup POSIX + */ + /* * 16.1.8 Dynamic Package Initialization, P1003.1c/Draft 10, p. 154 * diff --git a/cpukit/posix/src/rwlockattrdestroy.c b/cpukit/posix/src/rwlockattrdestroy.c index 022fe79864..102b141704 100644 --- a/cpukit/posix/src/rwlockattrdestroy.c +++ b/cpukit/posix/src/rwlockattrdestroy.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Destroys a read-write lock Attributes object + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/sched_setparam.c b/cpukit/posix/src/sched_setparam.c index d31a29fa14..8e894e0978 100644 --- a/cpukit/posix/src/sched_setparam.c +++ b/cpukit/posix/src/sched_setparam.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Sets Scheduling Parameters Associated with Scheduling Policies + * @ingroup POSIX + */ + /* * 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252 * diff --git a/cpukit/posix/src/semaphorecreatesupp.c b/cpukit/posix/src/semaphorecreatesupp.c index 6460da8526..18fef72a03 100644 --- a/cpukit/posix/src/semaphorecreatesupp.c +++ b/cpukit/posix/src/semaphorecreatesupp.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function does Actual creation and Initialization of POSIX Semaphore + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/setcanceltype.c b/cpukit/posix/src/setcanceltype.c index c0278dd10a..6a82374229 100644 --- a/cpukit/posix/src/setcanceltype.c +++ b/cpukit/posix/src/setcanceltype.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Sets the Cancelability Type of Calling Thread to value given in type + * @ingroup POSIX + */ + /* * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). diff --git a/cpukit/posix/src/signal_2.c b/cpukit/posix/src/signal_2.c index b1bf93cc79..75f13d8f92 100644 --- a/cpukit/posix/src/signal_2.c +++ b/cpukit/posix/src/signal_2.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief POSIX Function Installs signal Handler + * @ingroup POSIX + */ + /* * signal(2) - Install signal handler * diff --git a/cpukit/posix/src/timergettime.c b/cpukit/posix/src/timergettime.c index 3aa63e32f7..823989a4e4 100644 --- a/cpukit/posix/src/timergettime.c +++ b/cpukit/posix/src/timergettime.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Fetches State of POSIX Per-Process Timers + * @ingroup POSIX + */ + /* * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 * diff --git a/cpukit/posix/src/timersettime.c b/cpukit/posix/src/timersettime.c index b0c3061023..00cce57b59 100644 --- a/cpukit/posix/src/timersettime.c +++ b/cpukit/posix/src/timersettime.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Function Arms or Disarms the Timer Identified by timerid + * @ingroup POSIX + */ + /* * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 * -- cgit v1.2.3 From d883ce2eff04beda2b061edf29bd0b5455ce9b02 Mon Sep 17 00:00:00 2001 From: Mathew Kallada Date: Thu, 20 Dec 2012 08:22:52 -0600 Subject: libfs: Doxygen Enhancement Task #6" --- cpukit/libfs/src/devfs/devclose.c | 7 +++++ cpukit/libfs/src/devfs/devfs.h | 6 ++++ cpukit/libfs/src/devfs/devfs_show.c | 7 +++++ cpukit/libfs/src/devfs/devstat.c | 7 +++++ cpukit/libfs/src/dosfs/fat_fat_operations.c | 11 ++++--- cpukit/libfs/src/dosfs/fat_fat_operations.h | 8 ++++- cpukit/libfs/src/dosfs/fat_file.c | 11 ++++--- cpukit/libfs/src/dosfs/fat_file.h | 8 ++++- cpukit/libfs/src/dosfs/msdos.h | 46 ++++++++++++++++++++++++++-- cpukit/libfs/src/dosfs/msdos_conv.c | 12 ++++++-- cpukit/libfs/src/dosfs/msdos_create.c | 9 ++++-- cpukit/libfs/src/dosfs/msdos_dir.c | 9 ++++-- cpukit/libfs/src/dosfs/msdos_file.c | 9 ++++-- cpukit/libfs/src/dosfs/msdos_format.c | 42 ++++++++++++------------- cpukit/libfs/src/dosfs/msdos_free.c | 10 ++++-- cpukit/libfs/src/dosfs/msdos_fsunmount.c | 9 ++++-- cpukit/libfs/src/dosfs/msdos_handlers_dir.c | 9 ++++-- cpukit/libfs/src/dosfs/msdos_handlers_file.c | 9 ++++-- cpukit/libfs/src/dosfs/msdos_init.c | 9 ++++-- cpukit/libfs/src/dosfs/msdos_initsupp.c | 9 ++++-- cpukit/libfs/src/dosfs/msdos_misc.c | 9 ++++-- cpukit/libfs/src/dosfs/msdos_node_type.c | 9 ++++-- cpukit/libfs/src/dosfs/msdos_rename.c | 9 ++++-- cpukit/libfs/src/dosfs/msdos_rmnod.c | 9 ++++-- 24 files changed, 219 insertions(+), 64 deletions(-) diff --git a/cpukit/libfs/src/devfs/devclose.c b/cpukit/libfs/src/devfs/devclose.c index 83646c7619..505554f216 100644 --- a/cpukit/libfs/src/devfs/devclose.c +++ b/cpukit/libfs/src/devfs/devclose.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Maps Close Operation to rtems_io_close + * @ingroup DevFsDeviceTable Define Device Table Type + */ + /* * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at diff --git a/cpukit/libfs/src/devfs/devfs.h b/cpukit/libfs/src/devfs/devfs.h index 3fd1fab036..2317b10852 100644 --- a/cpukit/libfs/src/devfs/devfs.h +++ b/cpukit/libfs/src/devfs/devfs.h @@ -88,6 +88,8 @@ extern int devFS_open( /** + * @brief Maps Close Operation to rtems_io_close + * * This handler maps close operation to rtems_io_close. * @param iop This is the RTEMS's internal representation of file * @retval the same as close @@ -153,6 +155,8 @@ extern int devFS_ioctl( /** + * @brief Gets the Device File Information + * * This handler gets the device file information. This routine only set the following member of struct stat: * st_dev : device number * st_mode: device file creation mode, only two mode are accepted: @@ -227,6 +231,8 @@ extern int devFS_initialize( /** + * @brief Retrieves and Prints all the Device Registered in System + * * This routine retrieves all the device registered in system, and * prints out their detail information. For example, on one system, * devFS_show will print out following message: diff --git a/cpukit/libfs/src/devfs/devfs_show.c b/cpukit/libfs/src/devfs/devfs_show.c index 56badb1207..43cb02dfea 100644 --- a/cpukit/libfs/src/devfs/devfs_show.c +++ b/cpukit/libfs/src/devfs/devfs_show.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Retrieves and Prints all the Device Registered in System + * @ingroup DevFsDeviceTable Define Device Table Type + */ + /* * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at diff --git a/cpukit/libfs/src/devfs/devstat.c b/cpukit/libfs/src/devfs/devstat.c index f988448f70..f2b3de1840 100644 --- a/cpukit/libfs/src/devfs/devstat.c +++ b/cpukit/libfs/src/devfs/devstat.c @@ -1,3 +1,10 @@ +/** + * @file + * + * @brief Gets the Device File Information + * @ingroup DevFsDeviceTable Define Device Table Type + */ + /* * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at diff --git a/cpukit/libfs/src/dosfs/fat_fat_operations.c b/cpukit/libfs/src/dosfs/fat_fat_operations.c index 7496c09272..e558cec427 100644 --- a/cpukit/libfs/src/dosfs/fat_fat_operations.c +++ b/cpukit/libfs/src/dosfs/fat_fat_operations.c @@ -1,8 +1,11 @@ -/* - * fat_fat_operations.c - * - * General operations on File Allocation Table +/** + * @file * + * @brief General operations on File Allocation Table + * @ingroup libfs_ffo Fat Fat Operations + */ + +/* * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia * Author: Eugeny S. Mints */ diff --git a/cpukit/libfs/src/dosfs/fat_fat_operations.h b/cpukit/libfs/src/dosfs/fat_fat_operations.h index f9c124d055..278947ffca 100644 --- a/cpukit/libfs/src/dosfs/fat_fat_operations.h +++ b/cpukit/libfs/src/dosfs/fat_fat_operations.h @@ -19,6 +19,12 @@ #include +/** + * @defgroup libfs_ffo Fat Fat Operations + * + * @ingroup libfs + */ +/**@{*/ #ifdef __cplusplus extern "C" { #endif @@ -54,5 +60,5 @@ fat_free_fat_clusters_chain( #ifdef __cplusplus } #endif - +/**@}*/ #endif /* __DOSFS_FAT_FAT_OPERATIONS_H__ */ diff --git a/cpukit/libfs/src/dosfs/fat_file.c b/cpukit/libfs/src/dosfs/fat_file.c index 43826c9205..3e2d60967c 100644 --- a/cpukit/libfs/src/dosfs/fat_file.c +++ b/cpukit/libfs/src/dosfs/fat_file.c @@ -1,8 +1,11 @@ -/* - * fat_file.c - * - * General operations on "fat-file" +/** + * @file * + * @brief General operations on "fat-file" + * @ingroup libfs_ff Fat File + */ + +/* * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia * Author: Eugeny S. Mints * diff --git a/cpukit/libfs/src/dosfs/fat_file.h b/cpukit/libfs/src/dosfs/fat_file.h index 2018e995d7..0e22c90e60 100644 --- a/cpukit/libfs/src/dosfs/fat_file.h +++ b/cpukit/libfs/src/dosfs/fat_file.h @@ -20,6 +20,12 @@ #include "fat.h" +/** + * @defgroup libfs_ff Fat File + * + * @ingroup libfs + */ +/**@{*/ #ifdef __cplusplus extern "C" { #endif @@ -182,5 +188,5 @@ fat_file_mark_removed(fat_fs_info_t *fs_info, #ifdef __cplusplus } #endif - +/**@}*/ #endif /* __DOSFS_FAT_FILE_H__ */ diff --git a/cpukit/libfs/src/dosfs/msdos.h b/cpukit/libfs/src/dosfs/msdos.h index 26bf906173..ad0841297c 100644 --- a/cpukit/libfs/src/dosfs/msdos.h +++ b/cpukit/libfs/src/dosfs/msdos.h @@ -19,6 +19,12 @@ #include "fat.h" #include "fat_file.h" +/** + * @defgroup libfs_msdos MSDOS FileSystem + * + * @ingroup libfs + */ +/**@{*/ #ifdef __cplusplus extern "C" { #endif @@ -73,6 +79,12 @@ extern const rtems_filesystem_file_handlers_r msdos_file_handlers; #define MSDOS_REGULAR_FILE RTEMS_FILESYSTEM_MEMORY_FILE #define MSDOS_HARD_LINK RTEMS_FILESYSTEM_HARD_LINK /* pseudo type */ +/** + * @brief Type of Node that Loc Refers To + * + * The following returns the type of node that the loc refers to. + * + */ typedef rtems_filesystem_node_types_t msdos_node_type_t; /* @@ -220,11 +232,20 @@ typedef enum msdos_token_types_e */ #define MSDOS_DPS512_NUM 16 -/* Prototypes */ +/** + * @brief Shut Down MSDOS FileSystem + * + * MSDOS shut down handler implementation + */ void msdos_shut_down(rtems_filesystem_mount_table_entry_t *temp_mt_entry); void msdos_eval_path(rtems_filesystem_eval_path_context_t *ctx); +/** + * @brief Call Fat-File Close Routine + * + * Free node handler implementation for the filesystem operations table. + */ void msdos_free_node_info(const rtems_filesystem_location_info_t *pathloc); rtems_filesystem_node_types_t msdos_node_type( @@ -239,11 +260,21 @@ int msdos_mknod( dev_t dev ); +/** + * @brief Remove Node from MSDOS Directory + * + * MSDOS Directory Handlers Implementation + */ int msdos_rmnod( const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *loc ); +/** + * @brief Rename a MSDOS FileSystem Node + * + * Routine to rename a MSDOS filesystem node + */ int msdos_rename( const rtems_filesystem_location_info_t *old_parent_loc, const rtems_filesystem_location_info_t *old_loc, @@ -256,6 +287,11 @@ void msdos_lock(const rtems_filesystem_mount_table_entry_t *mt_entry); void msdos_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry); +/** + * @brief MSDOS Filesystem Initialization + * + * MSDOS Initialization support routine implementation + */ int msdos_initialize_support( rtems_filesystem_mount_table_entry_t *temp_mt_entry, const rtems_filesystem_operations_table *op_table, @@ -305,6 +341,12 @@ int msdos_dir_stat( struct stat *buf ); +/** + * @brief Implements wake up version of the "signal" operation + * + * Routine to create a new MSDOS filesystem node + * + */ int msdos_creat_node(const rtems_filesystem_location_info_t *parent_loc, msdos_node_type_t type, const char *name, @@ -402,5 +444,5 @@ int msdos_sync(rtems_libio_t *iop); #ifdef __cplusplus } #endif - +/**@}*/ #endif /* __DOSFS_MSDOS_H__ */ diff --git a/cpukit/libfs/src/dosfs/msdos_conv.c b/cpukit/libfs/src/dosfs/msdos_conv.c index 95b25814db..7549c42e56 100644 --- a/cpukit/libfs/src/dosfs/msdos_conv.c +++ b/cpukit/libfs/src/dosfs/msdos_conv.c @@ -1,7 +1,10 @@ -/* - * Adaptation of NetBSD code for RTEMS by Victor V. Vengerov +/** + * @file + * + * @brief MDOS Date Conversion + * @ingroup libfs_msdos MSDOS FileSystem */ -/* $NetBSD: msdosfs_conv.c,v 1.10 1994/12/27 18:36:24 mycroft Exp $ */ + /* * Written by Paul Popelka (paulp@uts.amdahl.com) * @@ -15,6 +18,9 @@ * functioning of this software in any circumstances and is not liable for * any damages caused by this software. * + * Adaptation of NetBSD code for RTEMS by Victor V. Vengerov + * $NetBSD: msdosfs_conv.c,v 1.10 1994/12/27 18:36:24 mycroft Exp $ + * * October 1992 */ diff --git a/cpukit/libfs/src/dosfs/msdos_create.c b/cpukit/libfs/src/dosfs/msdos_create.c index f8e1a9e19d..886dd404cc 100644 --- a/cpukit/libfs/src/dosfs/msdos_create.c +++ b/cpukit/libfs/src/dosfs/msdos_create.c @@ -1,6 +1,11 @@ -/* - * Routine to create a new MSDOS filesystem node +/** + * @file * + * @brief Create a new MSDOS FileSystem node + * @ingroup libfs_msdos MSDOS FileSystem + */ + +/* * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia * Author: Eugeny S. Mints * diff --git a/cpukit/libfs/src/dosfs/msdos_dir.c b/cpukit/libfs/src/dosfs/msdos_dir.c index 961568e47d..fd9ca40461 100644 --- a/cpukit/libfs/src/dosfs/msdos_dir.c +++ b/cpukit/libfs/src/dosfs/msdos_dir.c @@ -1,6 +1,11 @@ -/* - * MSDOS directory handlers implementation +/** + * @file * + * @brief MSDOS Directory Handlers Implementation + * @ingroup libfs_msdos MSDOS FileSystem + */ + +/* * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia * Author: Eugeny S. Mints * diff --git a/cpukit/libfs/src/dosfs/msdos_file.c b/cpukit/libfs/src/dosfs/msdos_file.c index a5b9c7abb2..b19b848786 100644 --- a/cpukit/libfs/src/dosfs/msdos_file.c +++ b/cpukit/libfs/src/dosfs/msdos_file.c @@ -1,6 +1,11 @@ -/* - * MSDOS file handlers implementation +/** + * @file * + * @brief MSDOS File Handlers Implementation + * @ingroup libfs + */ + +/* * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia * Author: Eugeny S. Mints * diff --git a/cpukit/libfs/src/dosfs/msdos_format.c b/cpukit/libfs/src/dosfs/msdos_format.c index 0b30caf030..49015e8fbd 100644 --- a/cpukit/libfs/src/dosfs/msdos_format.c +++ b/cpukit/libfs/src/dosfs/msdos_format.c @@ -1,25 +1,23 @@ -/*===============================================================*\ -| Project: RTEMS msdos format functionality | -+-----------------------------------------------------------------+ -| File: msdos_format.c | -+-----------------------------------------------------------------+ -| Copyright (c) 2004 IMD | -| Ingenieurbuero fuer Microcomputertechnik Th. Doerfler | -| | -| all rights reserved | -+-----------------------------------------------------------------+ -| this file contains msdos_format function. This function | -| formats a disk partition conforming to MS-DOS conventions | -| | -| 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. | -| | -+-----------------------------------------------------------------+ -| date history ID | -| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | -| 29.10.04 creation doe | -\*===============================================================*/ +/** + * @file + * + * @brief RTEMS MSDOS Format Functionality + * @ingroup libfs + * + * This function formats a disk partition conforming to MS-DOS conventions + */ + +/* + * Copyright (C) 2004 IMD + * Ingenieurbuero fuer Microcomputertechnik Th. Doerfler + * + * + * All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ #if HAVE_CONFIG_H #include "config.h" diff --git a/cpukit/libfs/src/dosfs/msdos_free.c b/cpukit/libfs/src/dosfs/msdos_free.c index 4dc26b7e9e..44db35d3ee 100644 --- a/cpukit/libfs/src/dosfs/msdos_free.c +++ b/cpukit/libfs/src/dosfs/msdos_free.c @@ -1,7 +1,11 @@ -/* - * Free node handler implementation for the filesystem - * operations table. +/** + * @file * + * @brief Call Fat-File Close Routine + * @ingroup libfs_msdos MSDOS FileSystem + */ + +/* * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia * Author: Eugeny S. Mints * diff --git a/cpukit/libfs/src/dosfs/msdos_fsunmount.c b/cpukit/libfs/src/dosfs/msdos_fsunmount.c index e23daaab4e..90a8073bf8 100644 --- a/cpukit/libfs/src/dosfs/msdos_fsunmount.c +++ b/cpukit/libfs/src/dosfs/msdos_fsunmount.c @@ -1,6 +1,11 @@ -/* - * MSDOS shut down handler implementation +/** + * @file * + * @brief Shut Down MSDOS FileSystem + * @ingroup libfs_msdos MSDOS FileSystem + */ + +/* * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia * Author: Eugeny S. Mints * diff --git a/cpukit/libfs/src/dosfs/msdos_handlers_dir.c b/cpukit/libfs/src/dosfs/msdos_handlers_dir.c index a56353b5fd..41efdb439d 100644 --- a/cpukit/libfs/src/dosfs/msdos_handlers_dir.c +++ b/cpukit/libfs/src/dosfs/msdos_handlers_dir.c @@ -1,6 +1,11 @@ -/* - * Directory Handlers Table for MSDOS filesystem +/** + * @file * + * @brief Directory Handlers Table for MSDOS FileSystem + * @ingroup libfs + */ + +/* * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia * Author: Eugeny S. Mints * diff --git a/cpukit/libfs/src/dosfs/msdos_handlers_file.c b/cpukit/libfs/src/dosfs/msdos_handlers_file.c index e6edae0636..2a3938d02a 100644 --- a/cpukit/libfs/src/dosfs/msdos_handlers_file.c +++ b/cpukit/libfs/src/dosfs/msdos_handlers_file.c @@ -1,6 +1,11 @@ -/* - * File Operations Table for MSDOS filesystem +/** + * @file * + * @brief File Operations Table for MSDOS FileSystem + * @ingroup libfs + */ + +/* * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia * Author: Eugeny S. Mints * diff --git a/cpukit/libfs/src/dosfs/msdos_init.c b/cpukit/libfs/src/dosfs/msdos_init.c index 544fef49be..eb46141503 100644 --- a/cpukit/libfs/src/dosfs/msdos_init.c +++ b/cpukit/libfs/src/dosfs/msdos_init.c @@ -1,6 +1,11 @@ -/* - * Init routine for MSDOS +/** + * @file * + * @brief Init Routine for MSDOS + * @ingroup libfs + */ + +/* * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia * Author: Eugeny S. Mints * diff --git a/cpukit/libfs/src/dosfs/msdos_initsupp.c b/cpukit/libfs/src/dosfs/msdos_initsupp.c index cf24d4bb64..08441869b4 100644 --- a/cpukit/libfs/src/dosfs/msdos_initsupp.c +++ b/cpukit/libfs/src/dosfs/msdos_initsupp.c @@ -1,6 +1,11 @@ -/* - * MSDOS Initialization support routine implementation +/** + * @file * + * @brief MSDOS Filesystem Initialization + * @ingroup libfs_msdos MSDOS FileSystem + */ + +/* * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia * Author: Eugeny S. Mints * diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c index 5ebf257b5a..a1979b1e2c 100644 --- a/cpukit/libfs/src/dosfs/msdos_misc.c +++ b/cpukit/libfs/src/dosfs/msdos_misc.c @@ -1,6 +1,11 @@ -/* - * Miscellaneous routines implementation for MSDOS filesystem +/** + * @file * + * @brief Miscellaneous Routines Implementation for MSDOS FileSystem + * @ingroup libfs + */ + +/* * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia * Author: Eugeny S. Mints * diff --git a/cpukit/libfs/src/dosfs/msdos_node_type.c b/cpukit/libfs/src/dosfs/msdos_node_type.c index 27b5189af4..c1b83d0709 100644 --- a/cpukit/libfs/src/dosfs/msdos_node_type.c +++ b/cpukit/libfs/src/dosfs/msdos_node_type.c @@ -1,6 +1,11 @@ -/* - * The following returns the type of node that the loc refers to. +/** + * @file * + * @brief Type of Node that Loc Refers To + * @ingroup libfs_msdos MSDOS FileSystem + */ + +/* * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia * Author: Eugeny S. Mints * diff --git a/cpukit/libfs/src/dosfs/msdos_rename.c b/cpukit/libfs/src/dosfs/msdos_rename.c index 5423cdbf77..c6d1f560f3 100644 --- a/cpukit/libfs/src/dosfs/msdos_rename.c +++ b/cpukit/libfs/src/dosfs/msdos_rename.c @@ -1,6 +1,11 @@ -/* - * Routine to rename a MSDOS filesystem node +/** + * @file * + * @brief Rename a MSDOS FileSystem Node + * @ingroup libfs_msdos MSDOS FileSystem + */ + +/* * Copyright (C) 2010 Chris Johns * * The license and distribution terms for this file may be diff --git a/cpukit/libfs/src/dosfs/msdos_rmnod.c b/cpukit/libfs/src/dosfs/msdos_rmnod.c index 099b9287e5..36408e15a1 100644 --- a/cpukit/libfs/src/dosfs/msdos_rmnod.c +++ b/cpukit/libfs/src/dosfs/msdos_rmnod.c @@ -1,6 +1,11 @@ -/* - * MSDOS directory handlers implementation +/** + * @file * + * @brief Remove Node from MSDOS Directory + * @ingroup libfs_msdos MSDOS FileSystem + */ + +/* * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia * Author: Eugeny S. Mints * -- cgit v1.2.3 From ef5e4526dcc5e0ad8a33ededb031b55ec1fb604e Mon Sep 17 00:00:00 2001 From: Alex Ivanov Date: Thu, 20 Dec 2012 09:45:31 -0600 Subject: libfs: Doxygen Enhancement Task #1 --- cpukit/libfs/src/imfs/imfs.h | 164 +++++++++++++++++++++++- cpukit/libfs/src/imfs/imfs_chown.c | 12 +- cpukit/libfs/src/imfs/imfs_config.c | 7 + cpukit/libfs/src/imfs/imfs_debug.c | 26 +--- cpukit/libfs/src/imfs/imfs_directory.c | 24 +--- cpukit/libfs/src/imfs/imfs_fifo.c | 9 +- cpukit/libfs/src/imfs/imfs_fsunmount.c | 13 +- cpukit/libfs/src/imfs/imfs_handlers_device.c | 9 +- cpukit/libfs/src/imfs/imfs_handlers_directory.c | 9 +- cpukit/libfs/src/imfs/imfs_handlers_link.c | 9 +- cpukit/libfs/src/imfs/imfs_handlers_memfile.c | 9 +- cpukit/libfs/src/imfs/imfs_link.c | 13 +- cpukit/libfs/src/imfs/imfs_load_tar.c | 57 +------- cpukit/libfs/src/imfs/imfs_make_generic_node.c | 7 + cpukit/libfs/src/imfs/imfs_mknod.c | 11 +- cpukit/libfs/src/imfs/imfs_readlink.c | 12 +- cpukit/libfs/src/imfs/imfs_rename.c | 12 +- cpukit/libfs/src/imfs/imfs_rmnod.c | 12 +- cpukit/libfs/src/imfs/imfs_symlink.c | 13 +- cpukit/libfs/src/imfs/imfs_unmount.c | 9 +- cpukit/libfs/src/imfs/memfile.c | 36 +----- 21 files changed, 301 insertions(+), 172 deletions(-) diff --git a/cpukit/libfs/src/imfs/imfs.h b/cpukit/libfs/src/imfs/imfs.h index 6615b1b157..646e988ca2 100644 --- a/cpukit/libfs/src/imfs/imfs.h +++ b/cpukit/libfs/src/imfs/imfs.h @@ -321,20 +321,79 @@ extern int IMFS_initialize_support( 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. */ @@ -382,6 +441,13 @@ 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, @@ -389,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, @@ -436,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, @@ -450,6 +530,9 @@ 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 */ ); @@ -458,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 */ @@ -476,18 +596,31 @@ 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 * @@ -555,6 +688,13 @@ extern int IMFS_fchmod( 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, @@ -562,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, @@ -575,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_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 #include -/* - * 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_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 * * 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_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 @@ -27,52 +26,10 @@ #include -/* - * 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_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_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/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 -- cgit v1.2.3