RTEMS CPU Kit with SuperCore  4.11.3
Data Structures | Macros | Typedefs | Functions

Block Device Disk Management API. More...

#include <rtems.h>
#include <rtems/libio.h>
#include <rtems/chain.h>
#include <stdlib.h>
Include dependency graph for diskdevs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rtems_blkdev_read_ahead
 Block device read-ahead control. More...
 
struct  rtems_blkdev_stats
 Block device statistics. More...
 
struct  rtems_disk_device
 Description of a disk device (logical and physical disks). More...
 

Macros

#define RTEMS_DISK_READ_AHEAD_NO_TRIGGER   ((rtems_blkdev_bnum) -1)
 Trigger value to disable further read-ahead requests.
 

Typedefs

typedef struct rtems_disk_device rtems_disk_device
 
typedef uint32_t rtems_blkdev_bnum
 Block device block index type.
 
typedef int(* rtems_block_device_ioctl) (rtems_disk_device *dd, uint32_t req, void *argp)
 Block device IO control handler type.
 

Functions

rtems_disk_devicertems_disk_next (dev_t dev)
 Disk device iterator. More...
 
rtems_status_code rtems_disk_init_phys (rtems_disk_device *dd, uint32_t block_size, rtems_blkdev_bnum block_count, rtems_block_device_ioctl handler, void *driver_data)
 
rtems_status_code rtems_disk_init_log (rtems_disk_device *dd, rtems_disk_device *phys_dd, rtems_blkdev_bnum block_begin, rtems_blkdev_bnum block_count)
 
Disk Device Data
Disk Device Maintainance
rtems_status_code rtems_disk_create_phys (dev_t dev, uint32_t block_size, rtems_blkdev_bnum block_count, rtems_block_device_ioctl handler, void *driver_data, const char *name)
 Creates a physical disk with device identifier dev. More...
 
rtems_status_code rtems_disk_create_log (dev_t dev, dev_t phys, rtems_blkdev_bnum block_begin, rtems_blkdev_bnum block_count, const char *name)
 Creates a logical disk with device identifier dev. More...
 
rtems_status_code rtems_disk_delete (dev_t dev)
 Deletes a physical or logical disk device with identifier dev. More...
 
rtems_disk_devicertems_disk_obtain (dev_t dev)
 Returns the disk device descriptor for the device identifier dev. More...
 
rtems_status_code rtems_disk_release (rtems_disk_device *dd)
 Releases the disk device descriptor dd. More...
 
Disk Management
rtems_status_code rtems_disk_io_initialize (void)
 Initializes the disk device management. More...
 
rtems_status_code rtems_disk_io_done (void)
 Releases all resources allocated for disk device management. More...
 

Detailed Description

Block Device Disk Management API.

Function Documentation

◆ rtems_disk_next()

rtems_disk_device* rtems_disk_next ( dev_t  dev)

Disk device iterator.

Returns the next disk device descriptor with a device identifier larger than dev. If there is no such device, NULL will be returned. Use minus one to start the search.

rtems_disk_device *dd = (dev_t) -1;
while (sc == RTEMS_SUCCESSFUL && (dd = rtems_disk_next(dev)) != NULL) {
dev = rtems_disk_get_device_identifier(dd);
}

References RTEMS_SUCCESSFUL.