L4Re - L4 Runtime Environment
dma_space
Go to the documentation of this file.
1 // -*- Mode: C++ -*-
2 // vim:ft=cpp
6 /*
7  * (c) 2014 Alexander Warg <alexander.warg@kernkonzept.com>
8  *
9  * This file is part of TUD:OS and distributed under the terms of the
10  * GNU General Public License 2.
11  * Please see the COPYING-GPL-2 file for details.
12  *
13  * As a special exception, you may use this file as part of a free software
14  * library without restriction. Specifically, if other files instantiate
15  * templates or use macros or inline functions from this file, or you compile
16  * this file and link it with other files to produce an executable, this
17  * file does not by itself cause the resulting executable to be covered by
18  * the GNU General Public License. This exception does not however
19  * invalidate any other reasons why the executable file might be covered by
20  * the GNU General Public License.
21  */
22 
23 #pragma once
24 
25 #include <l4/sys/types.h>
26 #include <l4/sys/l4int.h>
27 #include <l4/sys/capability>
28 #include <l4/re/dataspace>
29 #include <l4/re/protocols.h>
30 #include <l4/sys/cxx/types>
31 #include <l4/sys/cxx/ipc_types>
32 #include <l4/sys/cxx/ipc_iface>
33 
34 namespace L4Re
35 {
36 
57 class Dma_space :
58  public L4::Kobject_0t< Dma_space,
59  L4RE_PROTO_DMA_SPACE,
60  L4::Type_info::Demand_t<1> >
61 {
62 public:
65 
69  enum Direction
70  {
75  };
76 
81  enum Attribute
82  {
95  };
96 
103 
110  {
118 
124  };
125 
128 
155  L4Re::Dataspace::Offset offset,
157  Attributes attrs, Direction dir,
158  Dma_addr *dma_addr));
159 
169  long, unmap, (Dma_addr dma_addr,
170  l4_size_t size, Attributes attrs, Direction dir));
171 
184  long, associate, (L4::Ipc::Opt<L4::Ipc::Cap<L4::Task> > dma_task,
185  Space_attribs attr),
187 
194  long, disassociate, (),
196 
198 };
199 
200 }
201 
unsigned int l4_size_t
Unsigned size type.
Definition: l4int.h:35
The DMA space has no DMA task assigned and uses the CPUs physical memory.
Definition: dma_space:123
Capability type for RPC interfaces (see L4::Cap<T>).
Definition: ipc_types:541
Attribute
Attributes used for the memory region during the transfer.
Definition: dma_space:81
Template for defining typical Flags bitmaps.
Definition: types:63
Standard list of RPCs of an interface.
Definition: __typeinfo.h:438
long disassociate()
Disassociate the DMA task from this Dma_space.
Common L4 ABI Data Types.
long associate(L4::Ipc::Opt< L4::Ipc::Cap< L4::Task > > dma_task, Space_attribs attr)
Associate a DMA task for a device to this Dma_space.
Space_attrib
Attributes assigned to the DMA space when associated with a specific device.
Definition: dma_space:109
device reads the memory
Definition: dma_space:72
The device is connected coherently with the cache.
Definition: dma_space:117
DMA Address Space.
Definition: dma_space:57
L4Re C++ Interfaces.
Definition: cmd_control:15
l4_uint64_t Dma_addr
Data type for DMA addresses.
Definition: dma_space:64
L4::Types::Flags< Space_attrib > Space_attribs
Attributes used when configuring the DMA space.
Definition: dma_space:127
L4::Cap related definitions.
device reads and writes to the memory
Definition: dma_space:71
L4::Types::Flags< Attribute > Attributes
Attributes for DMA mappings.
Definition: dma_space:102
#define L4_INLINE_RPC(res, name, args, attr...)
Define an inline RPC call (type and callable).
Definition: ipc_iface:469
device writes to the memory
Definition: dma_space:73
Mark an argument as in-out argument.
Definition: ipc_types:52
Interface Definition Language.
long unmap(Dma_addr dma_addr, l4_size_t size, Attributes attrs, Direction dir)
Unmap the given part of this data space from the DMA address space.
Attribute for defining an optional RPC argument.
Definition: ipc_types:147
RPC attribute for an RPC call with required rights.
Definition: ipc_iface:257
Dataspace interface.
unsigned long long l4_uint64_t
Unsigned 64bit value.
Definition: l4int.h:42
device is coherently connected to the memory
Definition: dma_space:74
L4Re Protocol Constants (C version)
Do not sync the memory hierarchy.
Definition: dma_space:94
long map(L4::Ipc::Cap< L4Re::Dataspace > src, L4Re::Dataspace::Offset offset, L4::Ipc::In_out< l4_size_t *> size, Attributes attrs, Direction dir, Dma_addr *dma_addr)
Map the given part of this data space into the DMA address space.
Direction
Direction of the DMA transfers.
Definition: dma_space:69