L4Re Operating System Framework
Interface and Usage Documentation
|
Typedefs | |
typedef l4vbus_resource_t | l4io_resource_t |
Resource descriptor. | |
typedef l4vbus_device_t | l4io_device_t |
Device descriptor. | |
Enumerations | |
enum | l4io_iomem_flags_t { L4IO_MEM_NONCACHED = 0 , L4IO_MEM_CACHED = 1 , L4IO_MEM_USE_MTRR = 2 , L4IO_MEM_ATTR_MASK = 0xf , L4IO_MEM_WRITE_COMBINED = L4IO_MEM_USE_MTRR | L4IO_MEM_CACHED , L4IO_MEM_USE_RESERVED_AREA = 0x40 << 8 , L4IO_MEM_EAGER_MAP = 0x80 << 8 } |
Flags for IO memory. More... | |
enum | l4io_device_types_t { L4IO_DEVICE_INVALID = 0 , L4IO_DEVICE_PCI , L4IO_DEVICE_USB , L4IO_DEVICE_OTHER , L4IO_DEVICE_ANY = ~0 } |
Device types. More... | |
enum | l4io_resource_types_t { L4IO_RESOURCE_INVALID = L4VBUS_RESOURCE_INVALID , L4IO_RESOURCE_IRQ = L4VBUS_RESOURCE_IRQ , L4IO_RESOURCE_MEM = L4VBUS_RESOURCE_MEM , L4IO_RESOURCE_PORT = L4VBUS_RESOURCE_PORT , L4IO_RESOURCE_ANY = ~0 } |
Resource types. More... | |
Functions | |
long | l4io_request_iomem (l4_addr_t phys, unsigned long size, int flags, l4_addr_t *virt) |
Request an IO memory 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. | |
long | l4io_release_iomem (l4_addr_t virt, unsigned long size) |
Release an IO memory region. | |
long | l4io_request_ioport (unsigned portnum, unsigned len) |
Request an IO port region. | |
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_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. | |
l4_addr_t | l4io_request_resource_iomem (l4io_device_handle_t devhandle, l4io_resource_handle_t *reshandle) |
Request IO memory. | |
int | l4io_has_resource (enum l4io_resource_types_t type, l4vbus_paddr_t start, l4vbus_paddr_t end) |
Check if a resource is available. | |
typedef l4vbus_resource_t l4io_resource_t |
enum l4io_device_types_t |
enum l4io_iomem_flags_t |
Flags for IO memory.
Enumerator | |
---|---|
L4IO_MEM_NONCACHED | Non-cache memory. |
L4IO_MEM_CACHED | Cache memory. |
L4IO_MEM_USE_MTRR | Use MTRR. |
L4IO_MEM_USE_RESERVED_AREA | Use reserved area for mapping I/O memory. Flag only valid for l4io_request_iomem_region() |
L4IO_MEM_EAGER_MAP | Eagerly map the I/O memory. Passthrough to the l4re-rm. |
int l4io_has_resource | ( | enum l4io_resource_types_t | type, |
l4vbus_paddr_t | start, | ||
l4vbus_paddr_t | end | ||
) |
Check if a resource is available.
type | Type of resource |
start | Minimal value. |
end | Maximum value. |
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.
devname | Name of device. | |
[out] | dev_handle | Device handle for found device, can be NULL. |
[out] | dev | Device information, filled by the function, can be NULL. |
[out] | res_handle | Resource handle, can be NULL. |
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.
devhandle | Device handle. | |
type | Type of resource to request (see l4io_resource_types_t). | |
[in,out] | reshandle | Resource handle, start with handle returned by device functions. The next resource handle is returned here. |
[out] | res | Device descriptor. |
long l4io_release_iomem | ( | l4_addr_t | virt, |
unsigned long | size | ||
) |
Release an IO memory region.
virt | Virtual address of region to free, see l4io_request_iomem |
size | Size of the region to release. |
long l4io_release_ioport | ( | unsigned | portnum, |
unsigned | len | ||
) |
Release an IO port region.
portnum | Start of port range to release |
len | Length of range to request |
Request an IO memory region.
phys | Physical address of the I/O memory region | |
size | Size of the region in Bytes, granularity pages. | |
flags | See l4io_iomem_flags_t | |
[in,out] | virt | Virtual address where the IO memory region should be mapped to. If the caller passes '0' a region in the caller's address space is searched and the virtual address is returned. |
0 | Success. |
-L4_ENOENT | No area in the caller's address space could be found to map the IO memory region. |
-L4_EPERM | Operation not allowed. |
-L4_EINVAL | Invalid value. |
-L4_EADDRNOTAVAIL | The requested virtual address is not available. |
-L4_ENOMEM | The requested IO memory region could not be allocated. |
<0 | IPC errors. |
Request an IO memory region and map it to a specified region.
phys | Physical address of the I/O memory region |
virt | Virtual address. |
size | Size of the region in Bytes, granularity pages. |
flags | See l4io_iomem_flags_t |
0 | Success. |
-L4_ENOENT | No area could be found to map the IO memory region. |
-L4_EPERM | Operation not allowed. |
-L4_EINVAL | Invalid value. |
-L4_EADDRNOTAVAIL | The requested virtual address is not available. |
-L4_ENOMEM | The requested IO memory region could not be allocated. |
<0 | IPC errors. |
long l4io_request_ioport | ( | unsigned | portnum, |
unsigned | len | ||
) |
Request an IO port region.
portnum | Start of port range to request |
len | Length of range to request |
l4_addr_t l4io_request_resource_iomem | ( | l4io_device_handle_t | devhandle, |
l4io_resource_handle_t * | reshandle | ||
) |
Request IO memory.
devhandle | Device handle. | |
[in,out] | reshandle | Resource handle from which IO memory should be requested. Upon successfull completion 'reshandle' points to the device's next resource. |
0 | An error occured. The value of 'reshandle' is undefined. |
>0 | The virtual address of the IO memory mapping. |