L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
virtio_block.h
1/* SPDX-License-Identifier: MIT */
2/*
3 * (c) 2014 Sarah Hoffmann <sarah.hoffmann@kernkonzept.com>
4 */
5
6#pragma once
7
14#include <l4/sys/types.h>
15
28
38
48
49enum L4virtio_block_discard_flags_t
50{
51 L4VIRTIO_BLOCK_DISCARD_F_UNMAP = 0x00000001UL,
52 L4VIRTIO_BLOCK_DISCARD_F_RESERVED = 0xFFFFFFFEUL,
53};
54
59{
60 l4_uint64_t sector;
61 l4_uint32_t num_sectors;
62 l4_uint32_t flags;
64
69{
73 struct l4virtio_block_config_geometry_t
74 {
75 l4_uint16_t cylinders;
76 l4_uint8_t heads;
77 l4_uint8_t sectors;
78 } geometry;
80 struct l4virtio_block_config_topology_t
81 {
83 l4_uint8_t physical_block_exp;
85 l4_uint8_t alignment_offset;
87 l4_uint16_t min_io_size;
89 l4_uint32_t opt_io_size;
90 } topology;
91 l4_uint8_t writeback;
92 l4_uint8_t unused0[3];
93 l4_uint32_t max_discard_sectors;
94 l4_uint32_t max_discard_seg;
95 l4_uint32_t discard_sector_alignment;
96 l4_uint32_t max_write_zeroes_sectors;
97 l4_uint32_t max_write_zeroes_seg;
98 l4_uint8_t write_zeroes_may_unmap;
99 l4_uint8_t unused1[3];
101
unsigned char l4_uint8_t
Unsigned 8bit value.
Definition l4int.h:36
unsigned int l4_uint32_t
Unsigned 32bit value.
Definition l4int.h:40
unsigned short int l4_uint16_t
Unsigned 16bit value.
Definition l4int.h:38
unsigned long long l4_uint64_t
Unsigned 64bit value.
Definition l4int.h:42
L4virtio_block_operations
Kinds of operation over a block device.
L4virtio_block_status
Status of a finished block request.
@ L4VIRTIO_BLOCK_T_DISCARD
Discard a range of sectors.
@ L4VIRTIO_BLOCK_T_GET_ID
Get device ID.
@ L4VIRTIO_BLOCK_T_FLUSH
Flush data to disk.
@ L4VIRTIO_BLOCK_T_IN
Read from device.
@ L4VIRTIO_BLOCK_T_OUT
Write to device.
@ L4VIRTIO_BLOCK_T_WRITE_ZEROES
Write zeroes to a range of sectors.
@ L4VIRTIO_BLOCK_S_IOERR
IO error on device.
@ L4VIRTIO_BLOCK_S_UNSUPP
Operation is not supported.
@ L4VIRTIO_BLOCK_S_OK
Request finished successfully.
Common L4 ABI Data Types.
Device configuration for block devices.
l4_uint32_t seg_max
Maximum number of segments per request.
l4_uint32_t blk_size
Block size of underlying disk.
l4_uint32_t size_max
Maximum size of a single segment.
l4_uint64_t capacity
Capacity of device in 512-byte sectors.
Structure used for the write zeroes and discard commands.
Header structure of a request for a block device.
l4_uint32_t type
Kind of request, see L4virtio_block_operations.
l4_uint32_t ioprio
Priority (unused)
l4_uint64_t sector
First sector to read/write.