L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
types.h
1/*
2 * Copyright (C) 2018-2019, 2023-2024 Kernkonzept GmbH.
3 * Author(s): Sarah Hoffmann <sarah.hoffmann@kernkonzept.com>
4 *
5 * License: see LICENSE.spdx (in this directory or the directories above)
6 */
7#pragma once
8
9#include <functional>
10
11#include <l4/cxx/unique_ptr>
12#include <l4/re/dma_space>
13#include <l4/l4virtio/server/l4virtio>
14
15namespace Block_device {
16
18enum Inout_flags
19 {
20 Inout_f_wb = 1,
21 Inout_f_unmap = 2,
22 };
23
24enum Shutdown_type
25{
27 Running = 0,
29 // client had crashed.
30 Client_gone,
32 Client_shutdown,
34 System_shutdown,
36 System_suspend
37};
38
44{
45 virtual ~Dma_region_info() = default;
46};
47
53{
54 cxx::unique_ptr<Dma_region_info> dma_info;
55};
56
57using Mem_region =
59
67{
68 L4Re::Dma_space::Dma_addr dma_addr = 0;
69 void *virt_addr = nullptr;
72 l4_uint32_t num_sectors = 0;
75 cxx::unique_ptr<Inout_block> next;
76};
77
78typedef std::function<void(int, l4_size_t)> Inout_callback;
79
80} // name space
l4_uint64_t Dma_addr
Data type for DMA addresses.
Definition dma_space:59
Region of driver memory, that shall be managed locally.
Definition l4virtio:451
unsigned int l4_size_t
Unsigned size type.
Definition l4int.h:24
unsigned int l4_uint32_t
Unsigned 32bit value.
Definition l4int.h:29
unsigned long long l4_uint64_t
Unsigned 64bit value.
Definition l4int.h:31
Base class used by the driver implementation to derive its own DMA mapping tracking structure.
Definition types.h:44
Description of an inout block to be sent to the device.
Definition types.h:67
l4_uint64_t sector
Initial sector. Used only by DISCARD / WRITE_ZEROES requests.
Definition types.h:71
l4_uint32_t flags
Flags from Inout_flags.
Definition types.h:74
Additional info stored in each L4virtio::Svr::Driver_mem_region_t used for tracking dataspace-wide DM...
Definition types.h:53