Interface device.h
The device.h interface provides a series of datastructures and helpers to manage VMM devices.
Brief content:
Functions:
Structs:
Functions
The interface device.h
defines the following functions.
Function device_list_init(list)
Initialise an empty device list
Parameters:
list {device_list_t *}
: device list to initialise
Returns:
- 0 on success, otherwise -1 for error
Back to interface description.
Function add_device(dev_list, d)
Add a generic device to a given device list without performing any initialisation of the device
Parameters:
dev_list {device_list_t *}
: A handle to the device list that the device should be installed intodevice {const struct device *}
: A description of the device
Returns:
- 0 on success, otherwise -1 for error
Back to interface description.
Function find_device_by_pa(dev_list, addr)
Find a device by a given addr within a device list
Parameters:
dev_list {device_list_t *}
: Device list to search withinaddr {uintptr_t}
: Add to search with
Returns:
- Pointer to device if found, otherwise NULL if not found
Back to interface description.
Structs
The interface device.h
defines the following structs.
Struct device
Device Management Object
Elements:
name {const char *}
: A string representation of the device. Useful for debuggingpstart {seL4_Word}
: The physical address of the devicesize {seL4_Word}
: Device mapping sizehandle_device_fault {int *(vm_t, vm_vcpu_t, dev, addr, len)}
: Fault handlerpriv {void *}
: Device emulation private data
Back to interface description.
Struct device_list
Management for a list of devices
Elements:
devices {struct device *}
: List of registered devicesnum_devices {int}
: Total number of registered devices
Back to interface description.
Back to top.