L4Re - L4 Runtime Environment
|
Encapsulate the state for processing a VIRTIO request. More...
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. More... | |
template<typename DESC_MAN , typename ... ARGS> | |
Virtqueue::Request const & | start (DESC_MAN *dm, Virtqueue::Request const &request, ARGS... args) |
Start processing a new request. More... | |
Virtqueue::Desc::Flags | current_flags () const |
Get the flags of the currently processed descriptor. More... | |
bool | has_more () const |
Are there more chained descriptors ? More... | |
template<typename DESC_MAN , typename ... ARGS> | |
bool | next (DESC_MAN *dm, ARGS... args) |
Switch to the next descriptor in a descriptor chain. More... | |
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:
|
inline |
Get the flags of the currently processed descriptor.
Definition at line 475 of file virtio.
References L4virtio::Virtqueue::Desc::flags.
|
inline |
Are there more chained descriptors ?
Definition at line 482 of file virtio.
References L4virtio::Virtqueue::Desc::flags, and L4virtio::Virtqueue::Desc::Flags::next().
Referenced by L4virtio::Svr::Block_request< Ds_data >::data_size().
|
inline |
Switch to the next descriptor in a descriptor chain.
DESCM_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 499 of file virtio.
References 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().
|
inline |
Start processing a new request.
DESCM_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 434 of file virtio.
References 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().
|
inline |
Start processing a new request.
DESCM_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() |