Loading...
Searching...
No Matches
io.h
Go to the documentation of this file.
/*
* (c) 2008-2010 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
* Alexander Warg <warg@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/sys/types.h>
#include <l4/sys/linkage.h>
#include <l4/io/types.h>
L4_BEGIN_DECLS
L4_CV long L4_EXPORT
l4io_request_irq(int irqnum, l4_cap_idx_t irqcap);
L4_CV l4_cap_idx_t L4_EXPORT
l4io_request_icu(void);
L4_CV long L4_EXPORT
l4io_release_irq(int irqnum, l4_cap_idx_t irq_cap);
L4_CV long L4_EXPORT
l4io_request_iomem(l4_addr_t phys, unsigned long size, int flags,
l4_addr_t *virt);
L4_CV long L4_EXPORT
l4io_request_iomem_region(l4_addr_t phys, l4_addr_t virt,
unsigned long size, int flags);
L4_CV long L4_EXPORT
l4io_release_iomem(l4_addr_t virt, unsigned long size);
L4_CV long L4_EXPORT
l4io_request_ioport(unsigned portnum, unsigned len);
L4_CV long L4_EXPORT
l4io_release_ioport(unsigned portnum, unsigned len);
/* -------------- Device handling --------------------- */
L4_INLINE
l4io_device_handle_t l4io_get_root_device(void);
L4_CV int L4_EXPORT
l4io_iterate_devices(l4io_device_handle_t *devhandle,
l4io_device_t *dev, l4io_resource_handle_t *reshandle);
L4_CV int L4_EXPORT
l4io_lookup_device(const char *devname,
l4io_device_handle_t *dev_handle,
l4io_device_t *dev, l4io_resource_handle_t *res_handle);
L4_CV int L4_EXPORT
l4io_lookup_resource(l4io_device_handle_t devhandle,
enum l4io_resource_types_t type,
l4io_resource_handle_t *reshandle,
l4io_resource_t *res);
/* --------------- Convenience functions ----------------- */
L4_CV l4_addr_t L4_EXPORT
l4io_request_resource_iomem(l4io_device_handle_t devhandle,
l4io_resource_handle_t *reshandle);
L4_CV void L4_EXPORT
l4io_request_all_ioports(void (*res_cb)(l4vbus_resource_t const *res));
L4_CV int L4_EXPORT
l4io_has_resource(enum l4io_resource_types_t type,
l4vbus_paddr_t start, l4vbus_paddr_t end);
/* ------------------------------------------------------- */
/* Implementations */
L4_INLINE
l4io_device_handle_t l4io_get_root_device(void)
{ return 0; }
L4_END_DECLS
compiler.h
L4 compiler related defines.
l4io_request_ioport
long l4io_request_ioport(unsigned portnum, unsigned len)
Request an IO port region.
l4io_release_iomem
long l4io_release_iomem(l4_addr_t virt, unsigned long size)
Release an IO memory region.
l4io_request_iomem
long l4io_request_iomem(l4_addr_t phys, unsigned long size, int flags, l4_addr_t *virt)
Request an IO memory region.
l4io_resource_t
l4vbus_resource_t l4io_resource_t
Resource descriptor.
Definition types.h:67
l4io_lookup_resource
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.
l4io_release_ioport
long l4io_release_ioport(unsigned portnum, unsigned len)
Release an IO port region.
l4io_lookup_device
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.
l4io_has_resource
int l4io_has_resource(enum l4io_resource_types_t type, l4vbus_paddr_t start, l4vbus_paddr_t end)
Check if a resource is available.
l4io_request_resource_iomem
l4_addr_t l4io_request_resource_iomem(l4io_device_handle_t devhandle, l4io_resource_handle_t *reshandle)
Request IO memory.
l4io_resource_types_t
l4io_resource_types_t
Resource types.
Definition types.h:48
l4io_device_t
l4vbus_device_t l4io_device_t
Device descriptor.
Definition types.h:72
l4io_request_iomem_region
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.
l4_addr_t
unsigned long l4_addr_t
Address type.
Definition l4int.h:34
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_INLINE
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
L4_BEGIN_DECLS
#define L4_BEGIN_DECLS
Start section with C types and functions.
Definition compiler.h:165
L4_EXPORT
#define L4_EXPORT
Attribute to mark functions, variables, and data types as being exported from a library.
Definition compiler.h:214
L4_END_DECLS
#define L4_END_DECLS
End section with C types and functions.
Definition compiler.h:166
l4io_get_root_device
l4io_device_handle_t l4io_get_root_device(void)
Get root device handle of the device bus.
Definition io.h:257
l4io_request_all_ioports
void l4io_request_all_ioports(void(*res_cb)(l4vbus_resource_t const *res))
Request all available IO-port resources.
l4io_request_icu
l4_cap_idx_t l4io_request_icu(void)
Request the ICU object of the client.
l4io_iterate_devices
int l4io_iterate_devices(l4io_device_handle_t *devhandle, l4io_device_t *dev, l4io_resource_handle_t *reshandle)
Iterate over the device bus.
types.h
Common L4 ABI Data Types.
l4vbus_resource_t
Description of a single vbus resource.
Definition vbus_types.h:23
l4vbus_paddr_t
l4_addr_t l4vbus_paddr_t
Address of resources on the vbus.
Definition vbus_types.h:20