L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
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 * This file is part of TUD:OS and distributed under the terms of the
9 * GNU Lesser General Public License 2.1.
10 * Please see the COPYING-LGPL-2.1 file for details.
11 */
12
13
14#pragma once
15
16#include <l4/sys/types.h>
17#include <l4/sys/linkage.h>
18#include <l4/io/types.h>
19
21
39l4io_request_irq(int irqnum, l4_cap_idx_t irqcap);
40
49
62l4io_release_irq(int irqnum, l4_cap_idx_t irq_cap);
63
89l4io_request_iomem(l4_addr_t phys, unsigned long size, int flags,
90 l4_addr_t *virt);
91
113L4_CV long L4_EXPORT
115 unsigned long size, int flags);
116
124L4_CV long L4_EXPORT
125l4io_release_iomem(l4_addr_t virt, unsigned long size);
126
136L4_CV long L4_EXPORT
137l4io_request_ioport(unsigned portnum, unsigned len);
138
148L4_CV long L4_EXPORT
149l4io_release_ioport(unsigned portnum, unsigned len);
150
151
152/* -------------- Device handling --------------------- */
153
160l4io_device_handle_t l4io_get_root_device(void);
161
173l4io_iterate_devices(l4io_device_handle_t *devhandle,
174 l4io_device_t *dev, l4io_resource_handle_t *reshandle);
175
189l4io_lookup_device(const char *devname,
190 l4io_device_handle_t *dev_handle,
191 l4io_device_t *dev, l4io_resource_handle_t *res_handle);
192
209l4io_lookup_resource(l4io_device_handle_t devhandle,
210 enum l4io_resource_types_t type,
211 l4io_resource_handle_t *reshandle,
212 l4io_resource_t *res);
213
214
215/* --------------- Convenience functions ----------------- */
216
230l4io_request_resource_iomem(l4io_device_handle_t devhandle,
231 l4io_resource_handle_t *reshandle);
232
239L4_CV void L4_EXPORT
240l4io_request_all_ioports(void (*res_cb)(l4vbus_resource_t const *res));
241
252 l4vbus_paddr_t start, l4vbus_paddr_t end);
253
254/* ------------------------------------------------------- */
255/* Implementations */
256
258l4io_device_handle_t l4io_get_root_device(void)
259{ return 0; }
260
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:50
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:45
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:358
#define L4_CV
Define calling convention.
Definition linkage.h:44
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:62
#define L4_EXPORT
Attribute to mark functions, variables, and data types as being exported from a library.
Definition compiler.h:221
#define EXTERN_C_BEGIN
Start section with C types and functions.
Definition compiler.h:192
#define EXTERN_C_END
End section with C types and functions.
Definition compiler.h:193
l4io_device_handle_t l4io_get_root_device(void)
Get root device handle of the device bus.
Definition io.h:258
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:70
Description of a single vbus resource.
Definition vbus_types.h:25
l4_addr_t l4vbus_paddr_t
Address of resources on the vbus.
Definition vbus_types.h:22