|
| Dev_config (l4_uint32_t vendor, l4_uint32_t device, unsigned cfg_size, l4_uint32_t num_queues=0) |
| Create a L4-Virtio config data space.
|
| Dev_config (Cfg_cap const &cfg, l4_addr_t cfg_offset, l4_uint32_t vendor, l4_uint32_t device, unsigned cfg_size, l4_uint32_t num_queues=0) |
| Setup an L4-Virtio config space in an existing data space.
|
l4_uint32_t | num_queues () const |
| Return the number of queues currently usable.
|
l4_uint32_t | guest_features (unsigned idx) const |
| Return a specific set of guest features.
|
l4_uint32_t | negotiated_features (unsigned idx) const |
| Compute a specific set of negotiated features.
|
Status | status () const |
| Get current device status (trusted).
|
l4_uint32_t | get_cmd () const |
| Get the value from the cmd register.
|
void | reset_cmd () |
| Reset the cmd register after execution of a command.
|
void | set_status (Status status) |
| Set device status register.
|
void | add_irq_status (l4_uint32_t status) |
| Adds irq status bit.
|
void | set_device_needs_reset () |
| Set DEVICE_NEEDS_RESET bit in device status register.
|
bool | change_queue_config (l4_uint32_t num_queues) |
| Setup new queue configuration.
|
l4virtio_config_queue_t volatile const * | qconfig (unsigned index) const |
| Get queue read-only config data for queue with the given index.
|
void | reset_hdr (bool inc_generation=false) const |
| Reset the config header to the initial contents.
|
bool | reset_queue (unsigned index, unsigned num_max, bool inc_generation=false) const |
| Reset queue config for the given queue.
|
l4virtio_config_hdr_t const volatile * | hdr () const |
| Get a read-only pointer to the config header.
|
L4::Cap< L4Re::Dataspace > | ds () const |
| Get data-space capability for the shared config data space.
|
l4_addr_t | ds_offset () const |
| Return the offset into the config dataspace where the device configuration starts.
|
Abstraction for L4-Virtio device config memory.
Virtio defines a device configuration mechanism, L4-Virtio implements this mechanism based on shared memory a set_status() and a config_queue() call. This class provides an abstraction for L4-Virtio host implementations to establish such a shared memory data space and providing the necessary contents and access functions.
Definition at line 52 of file l4virtio.
Create a L4-Virtio config data space.
- Parameters
-
vendor | The vendor ID to store in config header. |
device | The device ID to store in config header. |
cfg_size | The size of the device-specific config data in bytes. |
num_queues | The number of queues provided by the device. |
This constructor allocates a data space used for L4-virtio config attaches the data space to the local address space and writes the initial contents to the config header.
Definition at line 112 of file l4virtio.
References L4Re::chkcap(), L4Re::chksys(), L4Re::Env::env(), L4_PAGESIZE, L4Re::Util::make_shared_cap(), and num_queues().
Status L4virtio::Svr::Dev_config::status |
( |
| ) |
const |
|
inline |
Get current device status (trusted).
- Returns
- Current device status register (trusted).
The status returned by this function is value stored internally and cannot be written by the guest (i.e., the value can be taken as trusted.)
Definition at line 222 of file l4virtio.
Referenced by add_irq_status(), and set_status().