L4Re – L4 Runtime Environment
vbus.h
Go to the documentation of this file.
1 /*
2  * (c) 2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
3  * Alexander Warg <warg@os.inf.tu-dresden.de>,
4  * Torsten Frenzel <frenzel@os.inf.tu-dresden.de>
5  * economic rights: Technische Universität Dresden (Germany)
6  *
7  * This file is part of TUD:OS and distributed under the terms of the
8  * GNU General Public License 2.
9  * Please see the COPYING-GPL-2 file for details.
10  */
15 #pragma once
16 
17 #include <l4/sys/compiler.h>
18 #include <l4/vbus/vbus_types.h>
19 #include <l4/sys/types.h>
20 
22 enum {
25 };
26 
35  L4VBUS_ICU_SRC_DEV_HANDLE = 1ULL << 63
36 };
37 
56 __BEGIN_DECLS
57 
65 int L4_CV
66 l4vbus_get_device_by_hid(l4_cap_idx_t vbus, l4vbus_device_handle_t parent,
67  l4vbus_device_handle_t *child, char const *hid,
68  int depth, l4vbus_device_t *devinfo);
69 
85 int L4_CV
86 l4vbus_get_next_device(l4_cap_idx_t vbus, l4vbus_device_handle_t parent,
87  l4vbus_device_handle_t *child, int depth,
88  l4vbus_device_t *devinfo);
89 
103 int L4_CV
104 l4vbus_get_device(l4_cap_idx_t vbus, l4vbus_device_handle_t dev,
105  l4vbus_device_t *devinfo);
106 
115 int L4_CV
116 l4vbus_get_resource(l4_cap_idx_t vbus, l4vbus_device_handle_t dev,
117  int res_idx, l4vbus_resource_t *res);
118 
119 
126 int L4_CV
127 l4vbus_is_compatible(l4_cap_idx_t vbus, l4vbus_device_handle_t dev,
128  char const *cid);
129 
140 int L4_CV
141 l4vbus_get_hid(l4_cap_idx_t vbus, l4vbus_device_handle_t dev, char *hid,
142  unsigned long max_len);
143 
157 int L4_CV
159 
175 int L4_CV
176 L4_DEPRECATED("use l4vbus_request_ioport")
178  int flags);
179 
184 {
193 };
194 
215 int L4_CV
216 l4vbus_assign_dma_domain(l4_cap_idx_t vbus, unsigned domain_id,
217  unsigned flags, l4_cap_idx_t dma_space);
218 
227 int L4_CV
229 
241 int L4_CV
242 L4_DEPRECATED("use l4vbus_release_ioport")
244 
254 int L4_CV
255 l4vbus_vicu_get_cap(l4_cap_idx_t vbus, l4vbus_device_handle_t icu,
256  l4_cap_idx_t cap);
257 
259 
L4 compiler related defines.
#define __END_DECLS
End section with C types and functions.
Definition: compiler.h:197
#define L4_DEPRECATED(s)
Mark symbol deprecated.
Definition: compiler.h:243
signed long l4_mword_t
Signed machine word.
Definition: l4int.h:48
unsigned long l4_cap_idx_t
L4 Capability selector Type.
Definition: types.h:342
#define L4_CV
Define calling convention.
Definition: linkage.h:44
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.
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 (L4::Task) or a L4Re::Dma_space to a DMA domain.
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.
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.
int l4vbus_release_resource(l4_cap_idx_t vbus, l4vbus_resource_t const *res)
Release a previously requested resource.
int l4vbus_request_ioport(l4_cap_idx_t vbus, l4vbus_resource_t const *res)
Request an IO port resource.
L4vbus_dma_domain_assign_flags
Flags for l4vbus_assign_dma_domain().
Definition: vbus.h:184
int l4vbus_request_resource(l4_cap_idx_t vbus, l4vbus_resource_t const *res, int flags)
Request a resource of a specific type.
int l4vbus_get_resource(l4_cap_idx_t vbus, l4vbus_device_handle_t dev, int res_idx, l4vbus_resource_t *res)
Obtain the resource description of an individual device resource.
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).
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.
int l4vbus_vicu_get_cap(l4_cap_idx_t vbus, l4vbus_device_handle_t icu, l4_cap_idx_t cap)
Get capability of ICU.
int l4vbus_release_ioport(l4_cap_idx_t vbus, l4vbus_resource_t const *res)
Release a previously requested IO port resource.
@ L4VBUS_DMAD_BIND
Bind the given DMA space to the DMA domain.
Definition: vbus.h:188
@ L4VBUS_DMAD_L4RE_DMA_SPACE
The given DMA space is an L4Re::Dma_space.
Definition: vbus.h:190
@ L4VBUS_DMAD_UNBIND
Unbind the given DMA space from the DMA domain.
Definition: vbus.h:186
@ L4VBUS_DMAD_KERNEL_DMA_SPACE
The given DMA space is a kernel DMA space (L4::Task)
Definition: vbus.h:192
Common L4 ABI Data Types.
Detailed information about a vbus device.
Definition: vbus_types.h:69
Description of a single vbus resource.
Definition: vbus_types.h:23
@ L4VBUS_NULL
NULL device.
Definition: vbus.h:23
@ L4VBUS_ROOT_BUS
Root device on the vbus.
Definition: vbus.h:24
l4vbus_icu_src_types
Flags that can be used with the ICU on a vbus device.
Definition: vbus.h:28
@ L4VBUS_ICU_SRC_DEV_HANDLE
Flag to denote that the value should be interpreted as a device handle.
Definition: vbus.h:35
This header file contains descriptions of vbus related data types and constants.