L4Re - L4 Runtime Environment
|
Server-side L4-VIRTIO device stub. More...
Public Member Functions | |
virtual void | reset ()=0 |
reset callback, called for doing a device reset | |
virtual bool | check_features () |
callback for checking the subset of accepted features | |
virtual bool | check_queues ()=0 |
callback for checking if the queues at DRIVER_OK transition | |
virtual int | reconfig_queue (unsigned idx)=0 |
callback for client queue-config request | |
virtual void | register_single_driver_irq () |
callback for registering a single guest IRQ for all queues (old-style) | |
virtual L4::Cap< L4::Irq > | device_notify_irq () const |
callback to gather the device notification IRQ (old-style) | |
virtual void | register_driver_irq (unsigned idx) |
Callback for registering an notification IRQ (multi IRQ). More... | |
virtual L4::Cap< L4::Irq > | device_notify_irq (unsigned idx) |
Callback to gather the device notification IRQ (multi IRQ). More... | |
virtual unsigned | num_events_supported () const |
Return the highest notification index supported. | |
Device_t (Dev_config *dev_config) | |
Make a device for the given config. | |
Mem_list const * | mem_info () const |
Get the memory region list used for this device. | |
void | reset_queue_config (unsigned idx, unsigned num_max, bool inc_generation=false) |
Trigger reset for the configuration space for queue idx. More... | |
void | init_mem_info (unsigned num) |
Initialize the memory region list to the given maximum. More... | |
void | device_error () |
Transition device into failed state. More... | |
bool | setup_queue (Virtqueue *q, unsigned qn, unsigned num_max) |
Enable/disable the specified queue. More... | |
bool | handle_mem_cmd_write () |
Check for a value in the cmd register and handle a write. More... | |
Protected Attributes | |
Mem_list | _mem_info |
Memory region list. | |
Server-side L4-VIRTIO device stub.
This stub supports old-style device registration with single IRQs (via register_iface()) and new-style multi-event registration (using get_device_config(), bind() and get_device_notification_irq()).
In their default implementation the callbacks provide a wrapper from old-style to new-style functions, so that legacy devices provide both interfaces without any changes to their implementation.
New devices should always implement the new-style interface. If required, they can also provide a backward-compatibility mode by implementing the old-style interface as well.
The old-style interface is considered deprecated and will be removed at some point.
|
inline |
|
inlinevirtual |
|
inline |
Check for a value in the cmd
register and handle a write.
This function checks for a value in the cmd
register and executes the command if there is any, or returns false if there was no command.
Execution of the command is signaled by a zero in the cmd
register.
|
inline |
|
inlinevirtual |
|
inline |
Trigger reset for the configuration space for queue idx.
idx | The queue index to reset. |
num_max | Maximum number of entries in this queue. |
inc_generation | The config generation will be incremented when this is true. |
This function resets the driver-readable configuration space for the queue with the given index. The queue configuration is reset to all 0, name num_max to the given value.
|
inline |
Enable/disable the specified queue.
q | Pointer to the ring that represents the virtqueue internally. |
qn | Index of the queue. |
num_max | Maximum number of supported entries in this queue. |