Loading...
Searching...
No Matches
dma_space
Go to the documentation of this file.
// -*- Mode: C++ -*-
// vim:ft=cpp
/*
* (c) 2014 Alexander Warg <alexander.warg@kernkonzept.com>
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/sys/types.h>
#include <l4/sys/l4int.h>
#include <l4/sys/capability>
#include <l4/re/dataspace>
#include <l4/re/protocols.h>
#include <l4/sys/cxx/types>
#include <l4/sys/cxx/ipc_types>
#include <l4/sys/cxx/ipc_iface>
namespace L4Re
{
class Dma_space :
public L4::Kobject_0t< Dma_space,
L4RE_PROTO_DMA_SPACE,
L4::Type_info::Demand_t<1> >
{
public:
typedef l4_uint64_t Dma_addr;
enum Direction
{
Bidirectional,
To_device,
From_device,
None
};
enum Attribute
{
No_sync
};
typedef L4::Types::Flags<Attribute> Attributes;
enum Space_attrib
{
Coherent,
Phys_space
};
typedef L4::Types::Flags<Space_attrib> Space_attribs;
L4_INLINE_RPC(
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));
L4_INLINE_RPC(
long, unmap, (Dma_addr dma_addr,
l4_size_t size, Attributes attrs, Direction dir));
L4_INLINE_RPC(
long, associate, (L4::Ipc::Opt<L4::Ipc::Cap<L4::Task> > dma_task,
Space_attribs attr),
L4::Ipc::Call_t<L4_CAP_FPAGE_RW>);
L4_INLINE_RPC(
long, disassociate, (),
L4::Ipc::Call_t<L4_CAP_FPAGE_RW>);
typedef L4::Typeid::Rpcs<map_t, unmap_t, associate_t, disassociate_t> Rpcs;
};
}
capability
L4::Cap related definitions.
L4Re::Dma_space
Managed DMA Address Space.
Definition dma_space:56
L4Re::Dma_space::disassociate
long disassociate()
Disassociate the (kernel) DMA space from this Dma_space.
L4Re::Dma_space::map
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.
L4Re::Dma_space::Attribute
Attribute
Attributes used for the memory region during the transfer.
Definition dma_space:77
L4Re::Dma_space::No_sync
@ No_sync
Do not sync the memory hierarchy.
Definition dma_space:89
L4Re::Dma_space::Space_attrib
Space_attrib
Attributes assigned to the DMA space when associated with a specific device.
Definition dma_space:105
L4Re::Dma_space::Phys_space
@ Phys_space
The DMA space has no DMA task assigned and uses the CPUs physical memory.
Definition dma_space:118
L4Re::Dma_space::Coherent
@ Coherent
The device is connected coherently with the cache.
Definition dma_space:112
L4Re::Dma_space::Attributes
L4::Types::Flags< Attribute > Attributes
Attributes for DMA mappings.
Definition dma_space:97
L4Re::Dma_space::associate
long associate(L4::Ipc::Opt< L4::Ipc::Cap< L4::Task > > dma_task, Space_attribs attr)
Associate a (kernel) DMA space for a device to this Dma_space.
L4Re::Dma_space::unmap
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.
L4Re::Dma_space::Dma_addr
l4_uint64_t Dma_addr
Data type for DMA addresses.
Definition dma_space:59
L4Re::Dma_space::Direction
Direction
Direction of the DMA transfers.
Definition dma_space:65
L4Re::Dma_space::Bidirectional
@ Bidirectional
device reads and writes to the memory
Definition dma_space:66
L4Re::Dma_space::To_device
@ To_device
device reads the memory
Definition dma_space:67
L4Re::Dma_space::None
@ None
device is coherently connected to the memory
Definition dma_space:69
L4Re::Dma_space::From_device
@ From_device
device writes to the memory
Definition dma_space:68
L4Re::Dma_space::Space_attribs
L4::Types::Flags< Space_attrib > Space_attribs
Attributes used when configuring the DMA space.
Definition dma_space:122
L4::Ipc::Cap
Capability type for RPC interfaces (see L4::Cap<T>).
Definition ipc_types:699
L4::Types::Flags
Template for defining typical Flags bitmaps.
Definition types:53
dataspace
Dataspace interface.
l4_size_t
unsigned int l4_size_t
Unsigned size type.
Definition l4int.h:24
l4_uint64_t
unsigned long long l4_uint64_t
Unsigned 64bit value.
Definition l4int.h:31
ipc_iface
Interface Definition Language.
L4_INLINE_RPC
#define L4_INLINE_RPC(res, name, args, attr...)
Define an inline RPC call (type and callable).
Definition ipc_iface:482
ipc_types
l4int.h
Fixed sized integer types, generic version.
types.h
Common L4 ABI Data Types.
L4Re
L4Re C++ Interfaces.
Definition cmd_control:14
protocols.h
L4Re Protocol Constants (C version).
L4::Ipc::Call_t
RPC attribute for an RPC call with required rights.
Definition ipc_iface:271
L4::Ipc::In_out
Mark an argument as in-out argument.
Definition ipc_types:42
L4::Ipc::Opt
Attribute for defining an optional RPC argument.
Definition ipc_types:137
L4::Typeid::Rpcs
Standard list of RPCs of an interface.
Definition __typeinfo.h:428
types