L4Re Operating System Framework
Interface and Usage Documentation
|
Encapsulate the state for processing a VIRTIO request. More...
#include <virtio>
Inherited by L4virtio::Svr::Scmi::Queue_worker< L4virtio::Svr::Scmi::Scmi_dev >, and L4virtio::Svr::Scmi::Queue_worker< OBSERV >.
Public Member Functions | |
template<typename DESC_MAN , typename ... ARGS> | |
void | start (DESC_MAN *dm, Virtqueue *ring, Virtqueue::Head_desc const &request, ARGS... args) |
Start processing a new request. | |
template<typename DESC_MAN , typename ... ARGS> | |
Virtqueue::Request const & | start (DESC_MAN *dm, Virtqueue::Request const &request, ARGS... args) |
Start processing a new request. | |
Virtqueue::Desc::Flags | current_flags () const |
Get the flags of the currently processed descriptor. | |
bool | has_more () const |
Are there more chained descriptors? | |
template<typename DESC_MAN , typename ... ARGS> | |
bool | next (DESC_MAN *dm, ARGS... args) |
Switch to the next descriptor in a descriptor chain. | |
Encapsulate the state for processing a VIRTIO request.
A VIRTIO request is a possibly chained list of descriptors retrieved from the available ring of a virtqueue, using Virtqueue::next_avail().
The descriptor processing depends on helper (DESC_MAN) for interpreting the descriptors in the context of the device implementation.
DESC_MAN has to provide the functionality to safely dereference a descriptor from a descriptor list.
The following methods must be provided by DESC_MAN:
desc
as an indirect descriptor table, and must return a pointer to an indirect descriptor table.
|
inline |
Get the flags of the currently processed descriptor.
Definition at line 526 of file virtio.
References L4virtio::Virtqueue::Desc::flags.
|
inline |
Are there more chained descriptors?
Definition at line 534 of file virtio.
References L4virtio::Virtqueue::Desc::flags, and L4virtio::Virtqueue::Desc::Flags::next().
Referenced by L4virtio::Svr::Block_request< Ds_data >::data_size(), L4virtio::Svr::Block_request< Ds_data >::has_more(), and L4virtio::Svr::Block_request< Ds_data >::next_block().
|
inline |
Switch to the next descriptor in a descriptor chain.
DESC_MAN | Type of descriptor manager (implicit). |
dm | Descriptor manager that is used to translate VIRTIO descriptor addresses. |
args | Extra arguments passed to dm->load_desc() |
true | A next descriptor is available. |
false | No descriptor available. |
Bad_descriptor | The next index of this descriptor is invalid. |
Definition at line 551 of file virtio.
References cxx::access_once(), L4virtio::Svr::Bad_descriptor::Bad_flags, L4virtio::Svr::Bad_descriptor::Bad_next, L4virtio::Virtqueue::Desc::flags, L4virtio::Virtqueue::Desc::Flags::indirect(), L4_UNLIKELY, L4virtio::Virtqueue::Desc::Flags::next(), and L4virtio::Virtqueue::Desc::next.
Referenced by L4virtio::Svr::Block_request< Ds_data >::data_size(), L4virtio::Svr::Block_request< Ds_data >::has_more(), L4virtio::Svr::Block_request< Ds_data >::next_block(), L4virtio::Svr::Console::Device::port_read(), and L4virtio::Svr::Console::Device::port_write().
|
inline |
Start processing a new request.
DESC_MAN | Type of descriptor manager (implicit). |
dm | Descriptor manager that is used to translate VIRTIO descriptor addresses. |
ring | VIRTIO ring of the request. |
request | VIRTIO request from Virtqueue::next_avail() |
args | Extra arguments passed to dm->load_desc() |
Bad_descriptor | The descriptor has an invalid size or load_desc() has thrown an exception by itself. |
Definition at line 482 of file virtio.
References cxx::access_once(), L4virtio::Svr::Bad_descriptor::Bad_size, L4virtio::Svr::Virtqueue::Head_desc::desc(), L4virtio::Svr::Virtqueue::desc(), L4virtio::Virtqueue::Desc::flags, L4virtio::Virtqueue::Desc::Flags::indirect(), L4_UNLIKELY, L4virtio::Virtqueue::Desc::len, and L4virtio::Virtqueue::num().
Referenced by L4virtio::Svr::Block_request< Ds_data >::data_size(), L4virtio::Svr::Console::Virtio_con::handle_control_message(), L4virtio::Svr::Console::Device::port_read(), L4virtio::Svr::Console::Device::port_write(), L4virtio::Svr::Console::Virtio_con::send_control_message(), and start().
|
inline |
Start processing a new request.
DESC_MAN | Type of descriptor manager (implicit). |
dm | Descriptor manager that is used to translate VIRTIO descriptor addresses. |
request | VIRTIO request from Virtqueue::next_avail() |
args | Extra arguments passed to dm->load_desc() |
Definition at line 515 of file virtio.
References start().