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/types.h>
15#include <l4/sys/linkage.h>
16#include <l4/io/types.h>
17
19
37l4io_request_irq(int irqnum, l4_cap_idx_t irqcap);
38
47
60l4io_release_irq(int irqnum, l4_cap_idx_t irq_cap);
61
87l4io_request_iomem(l4_addr_t phys, unsigned long size, int flags,
88 l4_addr_t *virt);
89
111L4_CV long L4_EXPORT
113 unsigned long size, int flags);
114
122L4_CV long L4_EXPORT
123l4io_release_iomem(l4_addr_t virt, unsigned long size);
124
134L4_CV long L4_EXPORT
135l4io_request_ioport(unsigned portnum, unsigned len);
136
146L4_CV long L4_EXPORT
147l4io_release_ioport(unsigned portnum, unsigned len);
148
149
150/* -------------- Device handling --------------------- */
151
158l4io_device_handle_t l4io_get_root_device(void);
159
171l4io_iterate_devices(l4io_device_handle_t *devhandle,
172 l4io_device_t *dev, l4io_resource_handle_t *reshandle);
173
187l4io_lookup_device(const char *devname,
188 l4io_device_handle_t *dev_handle,
189 l4io_device_t *dev, l4io_resource_handle_t *res_handle);
190
207l4io_lookup_resource(l4io_device_handle_t devhandle,
208 enum l4io_resource_types_t type,
209 l4io_resource_handle_t *reshandle,
210 l4io_resource_t *res);
211
212
213/* --------------- Convenience functions ----------------- */
214
228l4io_request_resource_iomem(l4io_device_handle_t devhandle,
229 l4io_resource_handle_t *reshandle);
230
237L4_CV void L4_EXPORT
238l4io_request_all_ioports(void (*res_cb)(l4vbus_resource_t const *res));
239
250 l4vbus_paddr_t start, l4vbus_paddr_t end);
251
252/* ------------------------------------------------------- */
253/* Implementations */
254
256l4io_device_handle_t l4io_get_root_device(void)
257{ return 0; }
258
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:335
#define __END_DECLS
End section with C types and functions.
Definition compiler.h:167
#define L4_CV
Define calling convention.
Definition linkage.h:33
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
#define __BEGIN_DECLS
Start section with C types and functions.
Definition compiler.h:164
#define L4_EXPORT
Attribute to mark functions, variables, and data types as being exported from a library.
Definition compiler.h:210
l4io_device_handle_t l4io_get_root_device(void)
Get root device handle of the device bus.
Definition io.h:256
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:68
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