Loading...
Searching...
No Matches
dma_space.h
Go to the documentation of this file.
/*
* (c) 2014 Alexander Warg <alexander.warg@kernkonzept.com>
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/sys/compiler.h>
#include <l4/sys/types.h>
#include <l4/re/c/dataspace.h>
L4_BEGIN_DECLS
enum l4re_dma_space_direction
{
L4RE_DMA_SPACE_BIDIRECTIONAL,
L4RE_DMA_SPACE_TO_DEVICE,
L4RE_DMA_SPACE_FROM_DEVICE,
L4RE_DMA_SPACE_NONE
};
enum l4re_dma_space_space_attribs
{
L4RE_DMA_SPACE_COHERENT = 1 << 0,
L4RE_DMA_SPACE_PHYS_SPACE = 1 << 1,
};
typedef l4_cap_idx_t l4re_dma_space_t;
typedef l4_uint64_t l4re_dma_space_dma_addr_t;
L4_CV long
l4re_dma_space_map(l4re_dma_space_t dma, l4re_ds_t src,
l4re_ds_offset_t offset,
l4_size_t * size, unsigned long attrs,
enum l4re_dma_space_direction dir,
l4re_dma_space_dma_addr_t *dma_addr) L4_NOTHROW;
L4_CV long
l4re_dma_space_unmap(l4re_dma_space_t dma, l4re_dma_space_dma_addr_t dma_addr,
l4_size_t size, unsigned long attrs,
enum l4re_dma_space_direction dir) L4_NOTHROW;
L4_CV long
l4re_dma_space_associate(l4re_dma_space_t dma, l4_cap_idx_t dma_task,
unsigned long attr) L4_NOTHROW;
L4_CV long
l4re_dma_space_disassociate(l4re_dma_space_t dma);
L4_END_DECLS
compiler.h
L4 compiler related defines.
dataspace.h
Data space C interface.
l4re_dma_space_dma_addr_t
l4_uint64_t l4re_dma_space_dma_addr_t
Data type for DMA addresses.
Definition dma_space.h:52
l4re_dma_space_direction
l4re_dma_space_direction
Direction of the DMA transfers.
Definition dma_space.h:28
L4RE_DMA_SPACE_BIDIRECTIONAL
@ L4RE_DMA_SPACE_BIDIRECTIONAL
device reads and writes to the memory
Definition dma_space.h:29
L4RE_DMA_SPACE_NONE
@ L4RE_DMA_SPACE_NONE
device is coherently connected
Definition dma_space.h:32
L4RE_DMA_SPACE_TO_DEVICE
@ L4RE_DMA_SPACE_TO_DEVICE
device reads the memory
Definition dma_space.h:30
L4RE_DMA_SPACE_FROM_DEVICE
@ L4RE_DMA_SPACE_FROM_DEVICE
device writes to the memory
Definition dma_space.h:31
l4re_dma_space_space_attribs
l4re_dma_space_space_attribs
Attributes assigned to the DMA space when associated with a specific device.
Definition dma_space.h:39
L4RE_DMA_SPACE_PHYS_SPACE
@ L4RE_DMA_SPACE_PHYS_SPACE
The DMA space has no DMA task assigned and uses the CPUs physical memory.
Definition dma_space.h:41
L4RE_DMA_SPACE_COHERENT
@ L4RE_DMA_SPACE_COHERENT
The device is connected coherently with the cache.
Definition dma_space.h:40
l4re_dma_space_disassociate
long l4re_dma_space_disassociate(l4re_dma_space_t dma)
Disassociate the (kernel) DMA space from this Dma_space.
l4re_dma_space_unmap
long l4re_dma_space_unmap(l4re_dma_space_t dma, l4re_dma_space_dma_addr_t dma_addr, l4_size_t size, unsigned long attrs, enum l4re_dma_space_direction dir) L4_NOTHROW
Unmap the given part of this data space from the DMA address space.
l4re_dma_space_t
l4_cap_idx_t l4re_dma_space_t
DMA space capability type.
Definition dma_space.h:49
l4re_dma_space_associate
long l4re_dma_space_associate(l4re_dma_space_t dma, l4_cap_idx_t dma_task, unsigned long attr) L4_NOTHROW
Associate a (kernel) DMA space for a device to this Dma_space.
l4re_dma_space_map
long l4re_dma_space_map(l4re_dma_space_t dma, l4re_ds_t src, l4re_ds_offset_t offset, l4_size_t *size, unsigned long attrs, enum l4re_dma_space_direction dir, l4re_dma_space_dma_addr_t *dma_addr) L4_NOTHROW
Map the given part of this data space into the DMA address space.
l4re_ds_t
L4_BEGIN_DECLS typedef l4_cap_idx_t l4re_ds_t
Dataspace type.
Definition dataspace.h:29
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
l4_cap_idx_t
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:336
L4_CV
#define L4_CV
Define calling convention.
Definition linkage.h:33
L4_NOTHROW
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition compiler.h:161
L4_BEGIN_DECLS
#define L4_BEGIN_DECLS
Start section with C types and functions.
Definition compiler.h:165
L4_END_DECLS
#define L4_END_DECLS
End section with C types and functions.
Definition compiler.h:166
types.h
Common L4 ABI Data Types.