L4Re - L4 Runtime Environment
io.h File Reference
#include <l4/sys/types.h>
#include <l4/sys/linkage.h>
#include <l4/io/types.h>
+ Include dependency graph for io.h:

Go to the source code of this file.

Functions

l4_cap_idx_t l4io_request_icu (void)
 Request the ICU object of the client. More...
 
long l4io_request_iomem (l4_addr_t phys, unsigned long size, int flags, l4_addr_t *virt)
 Request an IO memory region. More...
 
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. More...
 
long l4io_release_iomem (l4_addr_t virt, unsigned long size)
 Release an IO memory region. More...
 
long l4io_search_iomem_region (l4_addr_t phys, l4_addr_t size, l4_addr_t *rstart, l4_addr_t *rsize)
 Search for a IO memory region. More...
 
long l4io_request_ioport (unsigned portnum, unsigned len)
 Request an IO port region. More...
 
long l4io_release_ioport (unsigned portnum, unsigned len)
 Release an IO port region. More...
 
l4io_device_handle_t l4io_get_root_device (void)
 Get root device handle of the device bus. More...
 
int l4io_iterate_devices (l4io_device_handle_t *devhandle, l4io_device_t *dev, l4io_resource_handle_t *reshandle)
 Iterate over the device bus. More...
 
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. More...
 
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. More...
 
l4_addr_t l4io_request_resource_iomem (l4io_device_handle_t devhandle, l4io_resource_handle_t *reshandle)
 Request IO memory. More...
 
void l4io_request_all_ioports (void(*res_cb)(l4vbus_resource_t const *res))
 Request all available IO-port resources. More...
 
int l4io_has_resource (enum l4io_resource_types_t type, l4vbus_paddr_t start, l4vbus_paddr_t end)
 Check if a resource is available. More...
 

Function Documentation

◆ l4io_get_root_device()

l4io_device_handle_t l4io_get_root_device ( void  )
inline

Get root device handle of the device bus.

Returns
root device handle

Definition at line 268 of file io.h.

References EXTERN_C_END.

◆ 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.

Parameters
devhandleDevice handle to start iterating at
Return values
devhandleNext device handle
devDevice information, may be NULL
reshandleResource handle.
Returns
0 on success, error code otherwise

◆ l4io_request_all_ioports()

void l4io_request_all_ioports ( void(*)(l4vbus_resource_t const *res)  res_cb)

Request all available IO-port resources.

Parameters
res_cbCallback function called for every port resource found, give NULL for no callback.

◆ l4io_request_icu()

l4_cap_idx_t l4io_request_icu ( void  )

Request the ICU object of the client.

Returns
Client ICU object, an invalid capability selector is returned if no ICU is available.