Changeset 0121172 in rtems


Ignore:
Timestamp:
Mar 5, 2012, 2:06:02 PM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
3ab9c76d
Parents:
291c9264
git-author:
Sebastian Huber <sebastian.huber@…> (03/05/12 14:06:02)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/13/12 11:24:18)
Message:

libblock: Add generic IMFS block device nodes

New functions

o rtems_blkdev_create(), and
o rtems_blkdev_create_partition().

New test libtests/block11.

Files:
5 added
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/Makefile.am

    r291c9264 r0121172  
    99libblock_a_SOURCES = src/bdbuf.c \
    1010    src/blkdev.c \
     11    src/blkdev-imfs.c \
    1112    src/blkdev-ioctl.c \
    1213    src/blkdev-ops.c \
  • cpukit/libblock/include/rtems/blkdev.h

    r291c9264 r0121172  
    308308extern const rtems_driver_address_table rtems_blkdev_generic_ops;
    309309
     310/**
     311 * @brief Creates a block device.
     312 *
     313 * @param[in] device The path for the new block device.
     314 * @param[in] block_size The block size.  Must be positive.
     315 * @param[in] block_count The block count.  Must be positive.
     316 * @param[in] handler The block device IO control handler.  Must not be @c NULL.
     317 * @param[in] driver_data The block device driver data.
     318 *
     319 * @retval RTEMS_SUCCESSFUL Successful operation.
     320 * @retval RTEMS_INVALID_NUMBER Block size or block count is not positive.
     321 * @retval RTEMS_NO_MEMORY Not enough memory.
     322 * @retval RTEMS_UNSATISFIED Cannot create generic device node.
     323 */
     324rtems_status_code rtems_blkdev_create(
     325  const char *device,
     326  uint32_t block_size,
     327  rtems_blkdev_bnum block_count,
     328  rtems_block_device_ioctl handler,
     329  void *driver_data
     330);
     331
     332/**
     333 * @brief Creates a partition within a block device.
     334 *
     335 * A partition manages a subset of consecutive blocks contained in a block
     336 * device.  The blocks must be within the range of blocks managed by the
     337 * associated block device.  The media block size, block size, and IO control
     338 * handler are inherited by the block device.
     339 *
     340 * @param[in] partition The path for the new partition device.
     341 * @param[in] device The block device path.
     342 * @param[in] block_begin The block begin of the partition.
     343 * @param[in] block_count The block count of the partition.
     344 *
     345 * @retval RTEMS_SUCCESSFUL Successful operation.
     346 * @retval RTEMS_INVALID_ID Block device node does not exist.
     347 * @retval RTEMS_INVALID_NODE File system node is not a block device.
     348 * @retval RTEMS_NOT_IMPLEMENTED Block device implementation is incomplete.
     349 * @retval RTEMS_INVALID_NUMBER Block begin or block count is invalid.
     350 * @retval RTEMS_NO_MEMORY Not enough memory.
     351 * @retval RTEMS_UNSATISFIED Cannot create generic device node.
     352 */
     353rtems_status_code rtems_blkdev_create_partition(
     354  const char *partition,
     355  const char *device,
     356  rtems_blkdev_bnum block_begin,
     357  rtems_blkdev_bnum block_count
     358);
     359
    310360/** @} */
    311361
  • testsuites/libtests/Makefile.am

    r291c9264 r0121172  
    1414    termios06 termios07 termios08 \
    1515    rtems++ tztest block01 block02 block03 block04 block05 block06 block07 \
    16     block08 block09 block10 stringto01 \
     16    block08 block09 block10 block11 stringto01 \
    1717    tar01 tar02 tar03 \
    1818    math mathf mathl complex \
  • testsuites/libtests/configure.ac

    r291c9264 r0121172  
    5454block09/Makefile
    5555block10/Makefile
     56block11/Makefile
    5657bspcmdline01/Makefile
    5758cpuuse/Makefile
Note: See TracChangeset for help on using the changeset viewer.