Changeset 0b038bd4 in rtems
- Timestamp:
- Aug 4, 2018, 8:38:48 AM (2 years ago)
- Branches:
- 5, 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)
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/include/rtems/blkdev.h
rb152d33 r0b038bd4 388 388 rtems_blkdev_generic_ioctl 389 389 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 */ 391 RTEMS_DEPRECATED rtems_device_driver 396 392 rtems_blkdev_generic_read( 397 393 rtems_device_major_number major, … … 400 396 ); 401 397 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 */ 399 RTEMS_DEPRECATED rtems_device_driver 408 400 rtems_blkdev_generic_write( 409 401 rtems_device_major_number major, … … 412 404 ); 413 405 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 */ 407 RTEMS_DEPRECATED rtems_device_driver 420 408 rtems_blkdev_generic_open( 421 409 rtems_device_major_number major, … … 424 412 ); 425 413 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 */ 415 RTEMS_DEPRECATED rtems_device_driver 432 416 rtems_blkdev_generic_close( 433 417 rtems_device_major_number major, … … 436 420 ); 437 421 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 */ 423 RTEMS_DEPRECATED rtems_device_driver 444 424 rtems_blkdev_generic_ioctl( 445 425 rtems_device_major_number major, … … 448 428 ); 449 429 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 */ 431 RTEMS_DEPRECATED extern const rtems_driver_address_table rtems_blkdev_generic_ops; 454 432 455 433 /** @} */ -
cpukit/include/rtems/diskdevs.h
rb152d33 r0b038bd4 278 278 /**@{**/ 279 279 280 static inline dev_t rtems_disk_get_device_identifier( 280 /* Use fstat() instead */ 281 RTEMS_DEPRECATED static inline dev_t rtems_disk_get_device_identifier( 281 282 const rtems_disk_device *dd 282 283 ) … … 285 286 } 286 287 287 static inline rtems_device_major_number rtems_disk_get_major_number( 288 /* Use fstat() instead */ 289 RTEMS_DEPRECATED static inline rtems_device_major_number rtems_disk_get_major_number( 288 290 const rtems_disk_device *dd 289 291 ) … … 292 294 } 293 295 294 static inline rtems_device_minor_number rtems_disk_get_minor_number( 296 /* Use fstat() instead */ 297 RTEMS_DEPRECATED static inline rtems_device_minor_number rtems_disk_get_minor_number( 295 298 const rtems_disk_device *dd 296 299 ) … … 341 344 /**@{**/ 342 345 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 */ 347 RTEMS_DEPRECATED rtems_status_code rtems_disk_create_phys( 364 348 dev_t dev, 365 349 uint32_t block_size, … … 370 354 ); 371 355 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 */ 357 RTEMS_DEPRECATED rtems_status_code rtems_disk_create_log( 394 358 dev_t dev, 395 359 dev_t phys, … … 399 363 ); 400 364 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 */ 369 RTEMS_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 */ 375 RTEMS_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 */ 381 RTEMS_DEPRECATED rtems_status_code rtems_disk_release(rtems_disk_device *dd); 437 382 438 383 /** @} */ … … 443 388 /**@{**/ 444 389 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 */ 391 RTEMS_DEPRECATED rtems_status_code rtems_disk_io_initialize(void); 392 393 /* Just remove calls to this function */ 394 RTEMS_DEPRECATED rtems_status_code rtems_disk_io_done(void); 466 395 467 396 /** @} */ … … 469 398 /** @} */ 470 399 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 */ 404 RTEMS_DEPRECATED rtems_disk_device *rtems_disk_next(dev_t dev); 489 405 490 406 /* Internal function, do not use */ -
cpukit/libblock/src/blkdev-imfs.c
rb152d33 r0b038bd4 182 182 ) 183 183 { 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 189 191 buf->st_blksize = rtems_disk_get_block_size(dd); 190 192 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); 191 196 192 197 return IMFS_stat(loc, buf); -
cpukit/libblock/src/blkdev-ops.c
rb152d33 r0b038bd4 23 23 #include <rtems/blkdev.h> 24 24 25 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 26 25 27 const rtems_driver_address_table rtems_blkdev_generic_ops = { 26 28 .initialization_entry = NULL, -
cpukit/libblock/src/blkdev.c
rb152d33 r0b038bd4 24 24 #include "rtems/diskdevs.h" 25 25 #include "rtems/bdbuf.h" 26 27 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 26 28 27 29 /* rtems_blkdev_generic_read -- -
cpukit/libblock/src/diskdevs.c
rb152d33 r0b038bd4 28 28 #include <rtems/bdbuf.h> 29 29 #include <rtems/thread.h> 30 31 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 30 32 31 33 #define DISKTAB_INITIAL_SIZE 8 -
testsuites/libtests/block01/init.c
rb152d33 r0b038bd4 33 33 #include <rtems/ramdisk.h> 34 34 #include <rtems/diskdevs.h> 35 36 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 35 37 36 38 const char rtems_test_name[] = "BLOCK 1"; -
testsuites/libtests/block11/init.c
rb152d33 r0b038bd4 11 11 * 12 12 * embedded brains GmbH 13 * Obere Lagerstr. 3013 * Dornierstr. 4 14 14 * 82178 Puchheim 15 15 * Germany … … 38 38 #include <rtems/malloc.h> 39 39 40 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 41 40 42 const char rtems_test_name[] = "BLOCK 11"; 41 42 /* forward declarations to avoid warnings */43 static rtems_task Init(rtems_task_argument argument);44 43 45 44 #define ASSERT_SC(sc) rtems_test_assert((sc) == RTEMS_SUCCESSFUL)
Note: See TracChangeset
for help on using the changeset viewer.