L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
types.h
1/*
2 * Copyright (C) 2018-2019 Kernkonzept GmbH.
3 * Author(s): Sarah Hoffmann <sarah.hoffmann@kernkonzept.com>
4 *
5 * This file is distributed under the terms of the GNU General Public
6 * License, version 2. Please see the COPYING-GPL-2 file for details.
7 */
8#pragma once
9
10#include <functional>
11
12#include <l4/cxx/unique_ptr>
13#include <l4/re/dma_space>
14#include <l4/l4virtio/server/l4virtio>
15
16namespace Block_device {
17
19enum Inout_flags
20 {
21 Inout_f_wb = 1,
22 Inout_f_unmap = 2,
23 };
24
25enum Shutdown_type
26{
28 Running = 0,
30 // client had crashed.
31 Client_gone,
33 Client_shutdown,
35 System_shutdown,
37 System_suspend
38};
39
45{
46 virtual ~Dma_region_info() = default;
47};
48
54{
55 cxx::unique_ptr<Dma_region_info> dma_info;
56};
57
58using Mem_region =
60
68{
69 L4Re::Dma_space::Dma_addr dma_addr = 0;
70 void *virt_addr = nullptr;
73 l4_uint32_t num_sectors = 0;
76 cxx::unique_ptr<Inout_block> next;
77};
78
79typedef std::function<void(int, l4_size_t)> Inout_callback;
80
81} // name space
l4_uint64_t Dma_addr
Data type for DMA addresses.
Definition dma_space:70
Region of driver memory, that shall be managed locally.
Definition l4virtio:451
unsigned int l4_size_t
Unsigned size type.
Definition l4int.h:35
unsigned int l4_uint32_t
Unsigned 32bit value.
Definition l4int.h:40
unsigned long long l4_uint64_t
Unsigned 64bit value.
Definition l4int.h:42
Base class used by the driver implementation to derive its own DMA mapping tracking structure.
Definition types.h:45
Description of an inout block to be sent to the device.
Definition types.h:68
l4_uint64_t sector
Initial sector. Used only by DISCARD / WRITE_ZEROES requests.
Definition types.h:72
l4_uint32_t flags
Flags from Inout_flags.
Definition types.h:75
Additional info stored in each L4virtio::Svr::Driver_mem_region_t used for tracking dataspace-wide DM...
Definition types.h:54