Changeset 0b038bd4 in rtems


Ignore:
Timestamp:
Aug 4, 2018, 8:38:48 AM (16 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
97417bb
Parents:
b152d33
git-author:
Sebastian Huber <sebastian.huber@…> (08/04/18 08:38:48)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/07/18 05:17:19)
Message:

libblock: Add RTEMS_DEPRECATED

Close #3358.

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/blkdev.h

    rb152d33 r0b038bd4  
    388388  rtems_blkdev_generic_ioctl
    389389
    390 /**
    391  * Generic block device read primitive.
    392  *
    393  * Implemented using block device buffer management primitives.
    394  */
    395 rtems_device_driver
     390/* Use rtems_blkdev_create() instead */
     391RTEMS_DEPRECATED rtems_device_driver
    396392rtems_blkdev_generic_read(
    397393    rtems_device_major_number major,
     
    400396);
    401397
    402 /**
    403  * Generic block device write primitive.
    404  *
    405  * Implemented using block device buffer management primitives.
    406  */
    407 rtems_device_driver
     398/* Use rtems_blkdev_create() instead */
     399RTEMS_DEPRECATED rtems_device_driver
    408400rtems_blkdev_generic_write(
    409401    rtems_device_major_number major,
     
    412404);
    413405
    414 /**
    415  * Generic block device open primitive.
    416  *
    417  * Implemented using block device buffer management primitives.
    418  */
    419 rtems_device_driver
     406/* Use rtems_blkdev_create() instead */
     407RTEMS_DEPRECATED rtems_device_driver
    420408rtems_blkdev_generic_open(
    421409    rtems_device_major_number major,
     
    424412);
    425413
    426 /**
    427  * Generic block device close primitive.
    428  *
    429  * Implemented using block device buffer management primitives.
    430  */
    431 rtems_device_driver
     414/* Use rtems_blkdev_create() instead */
     415RTEMS_DEPRECATED rtems_device_driver
    432416rtems_blkdev_generic_close(
    433417    rtems_device_major_number major,
     
    436420);
    437421
    438 /**
    439  * Generic block device IO control primitive.
    440  *
    441  * Implemented using block device buffer management primitives.
    442  */
    443 rtems_device_driver
     422/* Use rtems_blkdev_create() instead */
     423RTEMS_DEPRECATED rtems_device_driver
    444424rtems_blkdev_generic_ioctl(
    445425    rtems_device_major_number major,
     
    448428);
    449429
    450 /**
    451  * @brief Generic block operations driver address table.
    452  */
    453 extern const rtems_driver_address_table rtems_blkdev_generic_ops;
     430/* Use rtems_blkdev_create() instead */
     431RTEMS_DEPRECATED extern const rtems_driver_address_table rtems_blkdev_generic_ops;
    454432
    455433/** @} */
  • cpukit/include/rtems/diskdevs.h

    rb152d33 r0b038bd4  
    278278/**@{**/
    279279
    280 static inline dev_t rtems_disk_get_device_identifier(
     280/* Use fstat() instead */
     281RTEMS_DEPRECATED static inline dev_t rtems_disk_get_device_identifier(
    281282  const rtems_disk_device *dd
    282283)
     
    285286}
    286287
    287 static inline rtems_device_major_number rtems_disk_get_major_number(
     288/* Use fstat() instead */
     289RTEMS_DEPRECATED static inline rtems_device_major_number rtems_disk_get_major_number(
    288290  const rtems_disk_device *dd
    289291)
     
    292294}
    293295
    294 static inline rtems_device_minor_number rtems_disk_get_minor_number(
     296/* Use fstat() instead */
     297RTEMS_DEPRECATED static inline rtems_device_minor_number rtems_disk_get_minor_number(
    295298  const rtems_disk_device *dd
    296299)
     
    341344/**@{**/
    342345
    343 /**
    344  * @brief Creates a physical disk with device identifier @a dev.
    345  *
    346  * The block size @a block_size must be positive.  The disk will have
    347  * @a block_count blocks.  The block index starts with zero.  The associated disk
    348  * device driver will be invoked via the IO control handler @a handler.  A
    349  * device node will be registered in the file system with absolute path @a
    350  * name, if @a name is not @c NULL.  This function is usually invoked from a
    351  * block device driver during initialization when a physical device is detected
    352  * in the system.  The device driver provides an IO control handler to allow
    353  * block device operations.
    354  *
    355  * @retval RTEMS_SUCCESSFUL Successful operation.
    356  * @retval RTEMS_NOT_CONFIGURED Cannot lock disk device operation mutex.
    357  * @retval RTEMS_INVALID_ADDRESS IO control handler is @c NULL.
    358  * @retval RTEMS_INVALID_NUMBER Block size is invalid.
    359  * @retval RTEMS_NO_MEMORY Not enough memory.
    360  * @retval RTEMS_RESOURCE_IN_USE Disk device descriptor is already in use.
    361  * @retval RTEMS_UNSATISFIED Cannot create device node.
    362  */
    363 rtems_status_code rtems_disk_create_phys(
     346/* Use rtems_blkdev_create() instead */
     347RTEMS_DEPRECATED rtems_status_code rtems_disk_create_phys(
    364348  dev_t dev,
    365349  uint32_t block_size,
     
    370354);
    371355
    372 /**
    373  * @brief Creates a logical disk with device identifier @a dev.
    374  *
    375  * A logical disk manages a subset of consecutive blocks contained in the
    376  * physical disk with identifier @a phys.  The start block index of the logical
    377  * disk device is @a block_begin.  The block count of the logcal disk will be
    378  * @a block_count.  The blocks must be within the range of blocks managed by
    379  * the associated physical disk device.  A device node will be registered in
    380  * the file system with absolute path @a name, if @a name is not @c NULL.  The
    381  * block size and IO control handler are inherited by the physical disk.
    382  *
    383  * @retval RTEMS_SUCCESSFUL Successful operation.
    384  * @retval RTEMS_NOT_CONFIGURED Cannot lock disk device operation mutex.
    385  * @retval RTEMS_INVALID_ID Specified physical disk identifier does not
    386  * correspond to a physical disk.
    387  * @retval RTEMS_INVALID_NUMBER Begin block or block count are out of range.
    388  * @retval RTEMS_NO_MEMORY Not enough memory.
    389  * @retval RTEMS_RESOURCE_IN_USE Disk device descriptor for logical disk
    390  * identifier is already in use.
    391  * @retval RTEMS_UNSATISFIED Cannot create device node.
    392  */
    393 rtems_status_code rtems_disk_create_log(
     356/* Use rtems_blkdev_create_partition() instead */
     357RTEMS_DEPRECATED rtems_status_code rtems_disk_create_log(
    394358  dev_t dev,
    395359  dev_t phys,
     
    399363);
    400364
    401 /**
    402  * @brief Deletes a physical or logical disk device with identifier @a dev.
    403  *
    404  * Marks the disk device as deleted.  When a physical disk device is deleted,
    405  * all corresponding logical disk devices will marked as deleted too.  Disks
    406  * that are marked as deleted and have a usage counter of zero will be deleted.
    407  * The corresponding device nodes will be removed from the file system.  In
    408  * case of a physical disk deletion the IO control handler will be invoked with
    409  * a RTEMS_BLKIO_DELETED request.  Disks that are still in use will be deleted
    410  * upon release.
    411  *
    412  * @retval RTEMS_SUCCESSFUL Successful operation.
    413  * @retval RTEMS_NOT_CONFIGURED Cannot lock disk device operation mutex.
    414  * @retval RTEMS_INVALID_ID No disk for specified device identifier.
    415  */
    416 rtems_status_code rtems_disk_delete(dev_t dev);
    417 
    418 /**
    419  * @brief Returns the disk device descriptor for the device identifier @a dev.
    420  *
    421  * Increments usage counter by one.  You should release the disk device
    422  * descriptor with rtems_disk_release().
    423  *
    424  * @return Pointer to the disk device descriptor or @c NULL if no corresponding
    425  * disk exists.
    426  */
    427 rtems_disk_device *rtems_disk_obtain(dev_t dev);
    428 
    429 /**
    430  * @brief Releases the disk device descriptor @a dd.
    431  *
    432  * Decrements usage counter by one.
    433  *
    434  * @retval RTEMS_SUCCESSFUL Successful operation.
    435  */
    436 rtems_status_code rtems_disk_release(rtems_disk_device *dd);
     365/*
     366 * Use rtems_blkdev_create() or rtems_blkdev_create_partition and unlink()
     367 * instead.
     368 */
     369RTEMS_DEPRECATED rtems_status_code rtems_disk_delete(dev_t dev);
     370
     371/*
     372 * Use rtems_blkdev_create() or rtems_blkdev_create_partition and open()
     373 * instead.
     374 */
     375RTEMS_DEPRECATED rtems_disk_device *rtems_disk_obtain(dev_t dev);
     376
     377/*
     378 * Use rtems_blkdev_create() or rtems_blkdev_create_partition and close()
     379 * instead.
     380 */
     381RTEMS_DEPRECATED rtems_status_code rtems_disk_release(rtems_disk_device *dd);
    437382
    438383/** @} */
     
    443388/**@{**/
    444389
    445 /**
    446  * @brief Initializes the disk device management.
    447  *
    448  * This functions returns successful if the disk device management is already
    449  * initialized.  There is no protection against concurrent access.
    450  *
    451  * @retval RTEMS_SUCCESSFUL Successful initialization.
    452  * @retval RTEMS_NO_MEMORY Not enough memory or no semaphore available.
    453  * @retval RTEMS_UNSATISFIED Block device buffer initialization failed.
    454  */
    455 rtems_status_code rtems_disk_io_initialize(void);
    456 
    457 /**
    458  * @brief Releases all resources allocated for disk device management.
    459  *
    460  * There is no protection against concurrent access.  If parts of the system
    461  * are still in use the behaviour is undefined.
    462  *
    463  * @retval RTEMS_SUCCESSFUL Successful operation.
    464  */
    465 rtems_status_code rtems_disk_io_done(void);
     390/* Just remove calls to this function */
     391RTEMS_DEPRECATED rtems_status_code rtems_disk_io_initialize(void);
     392
     393/* Just remove calls to this function */
     394RTEMS_DEPRECATED rtems_status_code rtems_disk_io_done(void);
    466395
    467396/** @} */
     
    469398/** @} */
    470399
    471 /**
    472  * @brief Disk device iterator.
    473  *
    474  * Returns the next disk device descriptor with a device identifier larger than
    475  * @a dev.  If there is no such device, @c NULL will be returned.  Use minus
    476  * one to start the search.
    477  *
    478  * @code
    479  * rtems_status_code sc = RTEMS_SUCCESSFUL;
    480  * rtems_disk_device *dd = (dev_t) -1;
    481  *
    482  * while (sc == RTEMS_SUCCESSFUL && (dd = rtems_disk_next(dev)) != NULL) {
    483  *   dev = rtems_disk_get_device_identifier(dd);
    484  *   sc = rtems_disk_release(dd);
    485  * }
    486  * @endcode
    487  */
    488 rtems_disk_device *rtems_disk_next(dev_t dev);
     400/*
     401 * This functionality no longer available.  There is no global registration for
     402 * disk devices.
     403 */
     404RTEMS_DEPRECATED rtems_disk_device *rtems_disk_next(dev_t dev);
    489405
    490406/* Internal function, do not use */
  • cpukit/libblock/src/blkdev-imfs.c

    rb152d33 r0b038bd4  
    182182)
    183183{
    184   rtems_blkdev_imfs_context *ctx =
    185     IMFS_generic_get_context_by_location(loc);
    186   rtems_disk_device *dd = &ctx->dd;
    187 
    188   buf->st_rdev = rtems_disk_get_device_identifier(dd);
     184  rtems_blkdev_imfs_context *ctx;
     185  rtems_disk_device *dd;
     186  IMFS_jnode_t *node;
     187
     188  ctx = IMFS_generic_get_context_by_location(loc);
     189  dd = &ctx->dd;
     190
    189191  buf->st_blksize = rtems_disk_get_block_size(dd);
    190192  buf->st_blocks = rtems_disk_get_block_count(dd);
     193
     194  node = loc->node_access;
     195  buf->st_rdev = IMFS_generic_get_device_identifier_by_node(node);
    191196
    192197  return IMFS_stat(loc, buf);
  • cpukit/libblock/src/blkdev-ops.c

    rb152d33 r0b038bd4  
    2323#include <rtems/blkdev.h>
    2424
     25#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
     26
    2527const rtems_driver_address_table rtems_blkdev_generic_ops = {
    2628        .initialization_entry = NULL,
  • cpukit/libblock/src/blkdev.c

    rb152d33 r0b038bd4  
    2424#include "rtems/diskdevs.h"
    2525#include "rtems/bdbuf.h"
     26
     27#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
    2628
    2729/* rtems_blkdev_generic_read --
  • cpukit/libblock/src/diskdevs.c

    rb152d33 r0b038bd4  
    2828#include <rtems/bdbuf.h>
    2929#include <rtems/thread.h>
     30
     31#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
    3032
    3133#define DISKTAB_INITIAL_SIZE 8
  • testsuites/libtests/block01/init.c

    rb152d33 r0b038bd4  
    3333#include <rtems/ramdisk.h>
    3434#include <rtems/diskdevs.h>
     35
     36#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
    3537
    3638const char rtems_test_name[] = "BLOCK 1";
  • testsuites/libtests/block11/init.c

    rb152d33 r0b038bd4  
    1111 *
    1212 *  embedded brains GmbH
    13  *  Obere Lagerstr. 30
     13 *  Dornierstr. 4
    1414 *  82178 Puchheim
    1515 *  Germany
     
    3838#include <rtems/malloc.h>
    3939
     40#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
     41
    4042const char rtems_test_name[] = "BLOCK 11";
    41 
    42 /* forward declarations to avoid warnings */
    43 static rtems_task Init(rtems_task_argument argument);
    4443
    4544#define ASSERT_SC(sc) rtems_test_assert((sc) == RTEMS_SUCCESSFUL)
Note: See TracChangeset for help on using the changeset viewer.