L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
io.h
Go to the documentation of this file.
1
4/*
5 * (c) 2008-2010 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
6 * Alexander Warg <warg@os.inf.tu-dresden.de>
7 * economic rights: Technische Universität Dresden (Germany)
8 * License: see LICENSE.spdx (in this directory or the directories above)
9 */
10
11
12#pragma once
13
14#include <l4/sys/compiler.h>
15#include <l4/sys/types.h>
16#include <l4/sys/linkage.h>
17#include <l4/io/types.h>
18
20
38l4io_request_irq(int irqnum, l4_cap_idx_t irqcap);
39
48
61l4io_release_irq(int irqnum, l4_cap_idx_t irq_cap);
62
88l4io_request_iomem(l4_addr_t phys, unsigned long size, int flags,
89 l4_addr_t *virt);
90
112L4_CV long L4_EXPORT
114 unsigned long size, int flags);
115
123L4_CV long L4_EXPORT
124l4io_release_iomem(l4_addr_t virt, unsigned long size);
125
135L4_CV long L4_EXPORT
136l4io_request_ioport(unsigned portnum, unsigned len);
137
147L4_CV long L4_EXPORT
148l4io_release_ioport(unsigned portnum, unsigned len);
149
150
151/* -------------- Device handling --------------------- */
152
159l4io_device_handle_t l4io_get_root_device(void);
160
172l4io_iterate_devices(l4io_device_handle_t *devhandle,
173 l4io_device_t *dev, l4io_resource_handle_t *reshandle);
174
188l4io_lookup_device(const char *devname,
189 l4io_device_handle_t *dev_handle,
190 l4io_device_t *dev, l4io_resource_handle_t *res_handle);
191
208l4io_lookup_resource(l4io_device_handle_t devhandle,
209 enum l4io_resource_types_t type,
210 l4io_resource_handle_t *reshandle,
211 l4io_resource_t *res);
212
213
214/* --------------- Convenience functions ----------------- */
215
229l4io_request_resource_iomem(l4io_device_handle_t devhandle,
230 l4io_resource_handle_t *reshandle);
231
238L4_CV void L4_EXPORT
239l4io_request_all_ioports(void (*res_cb)(l4vbus_resource_t const *res));
240
251 l4vbus_paddr_t start, l4vbus_paddr_t end);
252
253/* ------------------------------------------------------- */
254/* Implementations */
255
257l4io_device_handle_t l4io_get_root_device(void)
258{ return 0; }
259
L4 compiler related defines.
long l4io_request_ioport(unsigned portnum, unsigned len)
Request an IO port region.
long l4io_release_iomem(l4_addr_t virt, unsigned long size)
Release an IO memory region.
long l4io_request_iomem(l4_addr_t phys, unsigned long size, int flags, l4_addr_t *virt)
Request an IO memory region.
int l4io_lookup_resource(l4io_device_handle_t devhandle, enum l4io_resource_types_t type, l4io_resource_handle_t *reshandle, l4io_resource_t *res)
Request a specific resource from a device description.
long l4io_release_ioport(unsigned portnum, unsigned len)
Release an IO port region.
int l4io_lookup_device(const char *devname, l4io_device_handle_t *dev_handle, l4io_device_t *dev, l4io_resource_handle_t *res_handle)
Find a device by name.
int l4io_has_resource(enum l4io_resource_types_t type, l4vbus_paddr_t start, l4vbus_paddr_t end)
Check if a resource is available.
l4_addr_t l4io_request_resource_iomem(l4io_device_handle_t devhandle, l4io_resource_handle_t *reshandle)
Request IO memory.
l4io_resource_types_t
Resource types.
Definition types.h:48
long l4io_request_iomem_region(l4_addr_t phys, l4_addr_t virt, unsigned long size, int flags)
Request an IO memory region and map it to a specified region.
unsigned long l4_addr_t
Address type.
Definition l4int.h:34
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:336
#define L4_CV
Define calling convention.
Definition linkage.h:33
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
#define L4_BEGIN_DECLS
Start section with C types and functions.
Definition compiler.h:165
#define L4_EXPORT
Attribute to mark functions, variables, and data types as being exported from a library.
Definition compiler.h:214
#define L4_END_DECLS
End section with C types and functions.
Definition compiler.h:166
l4io_device_handle_t l4io_get_root_device(void)
Get root device handle of the device bus.
Definition io.h:257
void l4io_request_all_ioports(void(*res_cb)(l4vbus_resource_t const *res))
Request all available IO-port resources.
l4_cap_idx_t l4io_request_icu(void)
Request the ICU object of the client.
int l4io_iterate_devices(l4io_device_handle_t *devhandle, l4io_device_t *dev, l4io_resource_handle_t *reshandle)
Iterate over the device bus.
Common L4 ABI Data Types.
Detailed information about a vbus device.
Definition vbus_types.h:80
Description of a single vbus resource.
Definition vbus_types.h:23
l4_addr_t l4vbus_paddr_t
Address of resources on the vbus.
Definition vbus_types.h:20