Generic block device interface. More...
#include <stdbool.h>#include <stddef.h>#include <stdint.h>

Go to the source code of this file.
Macros | |
| #define | BLOCK_MAX_CAPACITY 4u |
| Maximum number of concurrently active block handles. More... | |
| #define | BLOCK_CONTEXT_SIZE 32u |
| Size in bytes of backend-private state embedded in each block handle. More... | |
Typedefs | |
| typedef struct hw_block_t | hw_block_t |
Functions | |
Properties | |
| size_t | hw_block_count (const hw_block_t *block) |
| Return the number of addressable blocks. More... | |
| size_t | hw_block_size (const hw_block_t *block) |
| Return the block size in bytes. More... | |
Methods | |
| bool | hw_block_read (const hw_block_t *block, size_t index, void *dst) |
Read one block into dst. More... | |
| bool | hw_block_erase (hw_block_t *block, size_t index) |
| Erase one block. More... | |
| bool | hw_block_write (hw_block_t *block, size_t index, const void *src) |
Write one block from src. More... | |
| void | hw_block_deinit (hw_block_t *block) |
| Deinitialize a block handle. More... | |
Generic block device interface.
Definition in file block.h.