7 #ifndef __KOS_BLOCKDEV_H
8 #define __KOS_BLOCKDEV_H
10 #include <sys/cdefs.h>
14 #include <sys/types.h>
A simple block device.
Definition: blockdev.h:46
int(* flush)(struct kos_blockdev *d)
Flush the write cache (if any) of the device.
Definition: blockdev.h:123
uint64_t(* count_blocks)(struct kos_blockdev *d)
Count the number of blocks on the device.
Definition: blockdev.h:111
int(* write_blocks)(struct kos_blockdev *d, uint64_t block, size_t count, const void *buf)
Write a number of blocks to the device.
Definition: blockdev.h:99
uint32_t l_block_size
Log base 2 of the bytes per block.
Definition: blockdev.h:48
int(* shutdown)(struct kos_blockdev *d)
Shut down the block device.
Definition: blockdev.h:70
int(* read_blocks)(struct kos_blockdev *d, uint64_t block, size_t count, void *buf)
Read a number of blocks from the device.
Definition: blockdev.h:84
int(* init)(struct kos_blockdev *d)
Initialize the block device.
Definition: blockdev.h:59
void * dev_data
Internal device data.
Definition: blockdev.h:47
struct kos_blockdev kos_blockdev_t
A simple block device.