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 
61 class Dma_space :
62  public L4::Kobject_0t< Dma_space,
63  L4RE_PROTO_DMA_SPACE,
64  L4::Type_info::Demand_t<1> >
65 {
66 public:
69 
73  enum Direction
74  {
79  };
80 
85  enum Attribute
86  {
99  };
100 
107 
114  {
122 
128  };
129 
132 
158  long, map, (L4::Ipc::Cap<L4Re::Dataspace> src, l4_addr_t offset,
160  Attributes attrs, Direction dir,
161  Dma_addr *dma_addr));
162 
172  long, unmap, (Dma_addr dma_addr,
173  l4_size_t size, Attributes attrs, Direction dir));
174 
187  long, associate, (L4::Ipc::Opt<L4::Ipc::Cap<L4::Task> > dma_task,
188  Space_attribs attr),
190 
197  long, disassociate, (),
199 
201 };
202 
203 }
204 
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:127
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:85
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:113
device reads the memory
Definition: dma_space:76
The device is connected coherently with the cache.
Definition: dma_space:121
DMA Address Space.
Definition: dma_space:61
L4Re C++ Interfaces.
Definition: cmd_control:15
l4_uint64_t Dma_addr
Data type for DMA addresses.
Definition: dma_space:68
L4::Types::Flags< Space_attrib > Space_attribs
Attributes used when configuring the DMA space.
Definition: dma_space:131
L4::Cap related definitions.
device reads and writes to the memory
Definition: dma_space:75
L4::Types::Flags< Attribute > Attributes
Attributes for DMA mappings.
Definition: dma_space:106
#define L4_INLINE_RPC(res, name, args, attr...)
Define an inline RPC call (type and callable).
Definition: ipc_iface:458
long map(L4::Ipc::Cap< L4Re::Dataspace > src, l4_addr_t 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.
device writes to the memory
Definition: dma_space:77
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:246
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:78
L4Re Protocol Constants (C version)
unsigned long l4_addr_t
Address type.
Definition: l4int.h:45
Do not sync the memory hierarchy.
Definition: dma_space:98
Direction
Direction of the DMA transfers.
Definition: dma_space:73