39 #include <l4/sys/utcb.h> 40 #include <l4/sys/ipc.h> 46 L4VIRTIO_PROTOCOL = 0,
51 L4VIRTIO_MAGIC = 0x74726976
250 return (
void *)(((
l4_addr_t)cfg) + 0x100);
259 unsigned idx = feat / 32;
262 feature_map[idx] |= 1UL << (feat % 32);
271 unsigned idx = feat / 32;
274 feature_map[idx] &= ~(1UL << (feat % 32));
283 unsigned idx = feat / 32;
288 return feature_map[idx] & (1UL << (feat % 32));
int l4virtio_register_iface(l4_cap_idx_t cap, l4_cap_idx_t guest_irq, l4_cap_idx_t host_irq, l4_cap_idx_t config_ds) L4_NOTHROW
Register client to the L4-VIRTIO device.
l4_uint32_t magic
magic value (must be 'virt').
Guest OS has found device.
l4_uint32_t status
Device status register (read-only).
Status and queue config are set via cmd field instead of via IPC.
L4virtio_device_status
Virtio device status bits.
void l4virtio_set_feature(l4_uint32_t *feature_map, unsigned feat)
Set the given feature bit in a feature map.
l4_uint16_t device_notify_index
R: Event index to be used by the driver (driver to device)
l4_uint32_t version
VIRTIO version.
l4_uint32_t cfg_driver_notify_index
W: Event index to be used for config notifications (device to driver)
unsigned short int l4_uint16_t
Unsigned 16bit value.
int l4virtio_config_queue(l4_cap_idx_t cap, unsigned queue) L4_NOTHROW
Trigger queue configuration of the given queue.
Fatal error in driver or device.
Common L4 ABI Data Types.
L4_virtio_cmd
Virtio commands for device configuration.
l4_uint32_t cmd
L4 specific command register polled by the driver iff supported.
#define EXTERN_C_END
End section with C types and functions.
Driver has acknowledged feature set.
unsigned long l4_cap_idx_t
L4 Capability selector Type.
int l4virtio_device_notification_irq(l4_cap_idx_t cap, unsigned index, l4_cap_idx_t irq) L4_NOTHROW
Get the notification interrupt corresponding to the given index.
Device using 9P transport protocol.
Inofficial socket device.
l4_uint64_t used_addr
W: address of used ring.
l4virtio_config_queue_t * l4virtio_config_queues(l4virtio_config_hdr_t const *cfg)
Get the pointer to the first queue config.
L4virtio_feature_bits
L4virtio-specific feature bits.
L4_virtio_protocol
L4-VIRTIO protocol number.
l4_uint16_t num
RW: number of descriptors configured for this queue.
l4_uint32_t device
device ID
Device using CAIF network protocol.
int l4virtio_set_status(l4_cap_idx_t cap, unsigned status) L4_NOTHROW
Write the VIRTIO status register.
l4_uint32_t queues_offset
offset of virtqueue config array
Register a data space as transport memory.
void * l4virtio_device_config(l4virtio_config_hdr_t const *cfg)
Get the pointer to the device configuration.
l4_uint32_t cfg_device_notify_index
R: Event index to be used for config notifications (driver to device)
Register a transport driver to the device.
L4-VIRTIO config header, provided in shared data space.
unsigned l4virtio_get_feature(l4_uint32_t *feature_map, unsigned feat)
Check if the given bit in a feature map is set.
unsigned long l4_umword_t
Unsigned machine word.
l4_uint16_t num_max
R: maximum number of descriptors supported by this queue.
#define EXTERN_C_BEGIN
Start section with C types and functions.
l4_uint32_t vendor
vendor ID
l4_uint32_t dev_features
device features windows selected by device_feature_sel
L4_virtio_opcodes
L4-VIRTIO opcodes.
#define L4_CV
Define calling convention.
int l4virtio_device_config_ds(l4_cap_idx_t cap, l4_cap_idx_t config_ds, l4_addr_t *ds_offset) L4_NOTHROW
Get the dataspace with the L4virtio configuration page.
Device using rpmsg protocol.
Set queue config in device config.
l4_uint16_t ready
RW: queue ready flag (read-write)
l4_uint16_t driver_notify_index
W: Event index to be used for device notifications (device to driver)
struct l4virtio_config_hdr_t l4virtio_config_hdr_t
L4-VIRTIO config header, provided in shared data space.
L4virtio_device_ids
Virtio device IDs as reported in the driver's config space.
Queue configuration entry.
l4_uint32_t num_queues
number of virtqueues
L4_virtio_irq_status
VIRTIO IRQ status codes (l4virtio_config_hdr_t::irq_status).
unsigned long long l4_uint64_t
Unsigned 64bit value.
Mask to get command bits.
int l4virtio_register_ds(l4_cap_idx_t cap, l4_cap_idx_t ds_cap, l4_uint64_t base, l4_umword_t offset, l4_umword_t size) L4_NOTHROW
Register a shared data space with VIRTIO host.
unsigned long l4_addr_t
Address type.
Set status register in device config.
l4_uint64_t desc_addr
W: address of descriptor table.
void l4virtio_clear_feature(l4_uint32_t *feature_map, unsigned feat)
Clear the given feature bit in a feature map.
Simple device for data IO via ports.
Virtio protocol version 1 supported. Must be 1 for L4virtio.
l4_uint64_t avail_addr
W: address of available ring.
struct l4virtio_config_queue_t l4virtio_config_queue_t
Queue configuration entry.
Guest OS knows how to drive device.
unsigned int l4_uint32_t
Unsigned 32bit value.
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.