Loading...
Searching...
No Matches
vbus.h
Go to the documentation of this file.
/*
* (c) 2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
* Alexander Warg <warg@os.inf.tu-dresden.de>,
* Torsten Frenzel <frenzel@os.inf.tu-dresden.de>
* economic rights: Technische Universität Dresden (Germany)
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/sys/compiler.h>
#include <l4/vbus/vbus_types.h>
#include <l4/sys/types.h>
enum {
L4VBUS_NULL = -1L,
L4VBUS_ROOT_BUS = 0,
};
enum l4vbus_icu_src_types {
L4VBUS_ICU_SRC_DEV_HANDLE = 1ULL << 63
};
L4_BEGIN_DECLS
int L4_CV
l4vbus_get_device_by_hid(l4_cap_idx_t vbus, l4vbus_device_handle_t parent,
l4vbus_device_handle_t *child, char const *hid,
int depth, l4vbus_device_t *devinfo);
int L4_CV
l4vbus_get_next_device(l4_cap_idx_t vbus, l4vbus_device_handle_t parent,
l4vbus_device_handle_t *child, int depth,
l4vbus_device_t *devinfo);
int L4_CV
l4vbus_get_device(l4_cap_idx_t vbus, l4vbus_device_handle_t dev,
l4vbus_device_t *devinfo);
int L4_CV
l4vbus_get_resource(l4_cap_idx_t vbus, l4vbus_device_handle_t dev,
unsigned res_idx, l4vbus_resource_t *res);
int L4_CV
l4vbus_is_compatible(l4_cap_idx_t vbus, l4vbus_device_handle_t dev,
char const *cid);
int L4_CV
l4vbus_get_hid(l4_cap_idx_t vbus, l4vbus_device_handle_t dev, char *hid,
unsigned long max_len);
int L4_CV
l4vbus_get_adr(l4_cap_idx_t vbus, l4vbus_device_handle_t dev, l4_uint32_t *adr);
int L4_CV
l4vbus_request_ioport(l4_cap_idx_t vbus, l4vbus_resource_t const *res);
enum L4vbus_dma_domain_assign_flags
{
L4VBUS_DMAD_UNBIND = 0,
L4VBUS_DMAD_BIND = 1,
L4VBUS_DMAD_L4RE_DMA_SPACE = 0,
L4VBUS_DMAD_KERNEL_DMA_SPACE = 2,
};
int L4_CV
l4vbus_assign_dma_domain(l4_cap_idx_t vbus, unsigned domain_id,
unsigned flags, l4_cap_idx_t dma_space);
int L4_CV
l4vbus_release_ioport(l4_cap_idx_t vbus, l4vbus_resource_t const *res);
int L4_CV
l4vbus_vicu_get_cap(l4_cap_idx_t vbus, l4vbus_device_handle_t icu,
l4_cap_idx_t cap);
L4_END_DECLS
compiler.h
L4 compiler related defines.
l4_uint32_t
unsigned int l4_uint32_t
Unsigned 32bit value.
Definition l4int.h:29
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_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
l4vbus_get_next_device
int l4vbus_get_next_device(l4_cap_idx_t vbus, l4vbus_device_handle_t parent, l4vbus_device_handle_t *child, int depth, l4vbus_device_t *devinfo)
Find next child following child.
l4vbus_assign_dma_domain
int l4vbus_assign_dma_domain(l4_cap_idx_t vbus, unsigned domain_id, unsigned flags, l4_cap_idx_t dma_space)
Bind or unbind a kernel DMA space or a L4Re::Dma_space to a DMA domain.
l4vbus_get_adr
int l4vbus_get_adr(l4_cap_idx_t vbus, l4vbus_device_handle_t dev, l4_uint32_t *adr)
Get the bus-specific address of a device.
l4vbus_get_hid
int l4vbus_get_hid(l4_cap_idx_t vbus, l4vbus_device_handle_t dev, char *hid, unsigned long max_len)
Get the HID (hardware identifier) of a device.
l4vbus_get_device
int l4vbus_get_device(l4_cap_idx_t vbus, l4vbus_device_handle_t dev, l4vbus_device_t *devinfo)
Obtain detailed information about a Vbus device.
l4vbus_get_resource
int l4vbus_get_resource(l4_cap_idx_t vbus, l4vbus_device_handle_t dev, unsigned res_idx, l4vbus_resource_t *res)
Obtain the resource description of an individual device resource.
l4vbus_request_ioport
int l4vbus_request_ioport(l4_cap_idx_t vbus, l4vbus_resource_t const *res)
Request an IO port resource.
L4vbus_dma_domain_assign_flags
L4vbus_dma_domain_assign_flags
Flags for l4vbus_assign_dma_domain().
Definition vbus.h:175
l4vbus_is_compatible
int l4vbus_is_compatible(l4_cap_idx_t vbus, l4vbus_device_handle_t dev, char const *cid)
Check if the given device has a compatibility ID (CID) or HID that matches cid.
l4vbus_vicu_get_cap
int l4vbus_vicu_get_cap(l4_cap_idx_t vbus, l4vbus_device_handle_t icu, l4_cap_idx_t cap)
Get capability of ICU.
l4vbus_release_ioport
int l4vbus_release_ioport(l4_cap_idx_t vbus, l4vbus_resource_t const *res)
Release a previously requested IO port resource.
l4vbus_get_device_by_hid
L4_BEGIN_DECLS int l4vbus_get_device_by_hid(l4_cap_idx_t vbus, l4vbus_device_handle_t parent, l4vbus_device_handle_t *child, char const *hid, int depth, l4vbus_device_t *devinfo)
Find a device by the hardware interface identifier (HID).
L4VBUS_DMAD_BIND
@ L4VBUS_DMAD_BIND
Bind the given DMA space to the DMA domain.
Definition vbus.h:179
L4VBUS_DMAD_L4RE_DMA_SPACE
@ L4VBUS_DMAD_L4RE_DMA_SPACE
The given DMA space is an L4Re::Dma_space.
Definition vbus.h:181
L4VBUS_DMAD_UNBIND
@ L4VBUS_DMAD_UNBIND
Unbind the given DMA space from the DMA domain.
Definition vbus.h:177
L4VBUS_DMAD_KERNEL_DMA_SPACE
@ L4VBUS_DMAD_KERNEL_DMA_SPACE
The given DMA space is a kernel DMA space (L4::Task).
Definition vbus.h:183
types.h
Common L4 ABI Data Types.
l4vbus_device_t
Detailed information about a vbus device.
Definition vbus_types.h:80
l4vbus_resource_t
Description of a single vbus resource.
Definition vbus_types.h:23
L4VBUS_NULL
@ L4VBUS_NULL
NULL device.
Definition vbus.h:21
L4VBUS_ROOT_BUS
@ L4VBUS_ROOT_BUS
Root device on the vbus.
Definition vbus.h:22
l4vbus_icu_src_types
l4vbus_icu_src_types
Flags that can be used with the ICU on a vbus device.
Definition vbus.h:26
L4VBUS_ICU_SRC_DEV_HANDLE
@ L4VBUS_ICU_SRC_DEV_HANDLE
Flag to denote that the value should be interpreted as a device handle.
Definition vbus.h:33
vbus_types.h
This header file contains descriptions of vbus related data types and constants.
l4vbus_device_handle_t
l4_mword_t l4vbus_device_handle_t
Device handle for a device on the vbus.
Definition vbus_types.h:18