L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
L4virtio::Svr::Request_processor Class Reference

Encapsulate the state for processing a VIRTIO request. More...

#include <virtio>

Inheritance diagram for L4virtio::Svr::Request_processor:
Collaboration diagram for L4virtio::Svr::Request_processor:

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.

Detailed Description

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:

Definition at line 472 of file virtio.

Member Function Documentation

◆ current_flags()

Virtqueue::Desc::Flags L4virtio::Svr::Request_processor::current_flags ( ) const
inline

Get the flags of the currently processed descriptor.

Returns
The flags of the currently processed descriptor.

Definition at line 545 of file virtio.

Referenced by L4virtio::Svr::Virtio_gpio< Request_handler, Epiface >::Request_processor::get_request().

Here is the caller graph for this function:

◆ has_more()

bool L4virtio::Svr::Request_processor::has_more ( ) const
inline

Are there more chained descriptors?

Returns
true if there are more chained descriptors in the current request.

Definition at line 553 of file virtio.

Referenced by L4virtio::Svr::Block_request< Ds_data >::data_size().

Here is the caller graph for this function:

◆ next()

template<typename DESC_MAN, typename ... ARGS>
bool L4virtio::Svr::Request_processor::next ( DESC_MAN * dm,
ARGS... args )
inline

Switch to the next descriptor in a descriptor chain.

Template Parameters
DESC_MANType of descriptor manager (implicit).
Parameters
dmDescriptor manager that is used to translate VIRTIO descriptor addresses.
argsExtra arguments passed to dm->load_desc()
Return values
trueA next descriptor is available.
falseNo descriptor available.
Exceptions
Bad_descriptorThe next index of this descriptor is invalid.

Definition at line 570 of file virtio.

References cxx::access_once(), L4virtio::Svr::Bad_descriptor::Bad_flags, L4virtio::Svr::Bad_descriptor::Bad_next, and L4_UNLIKELY.

Referenced by L4virtio::Svr::Block_request< Ds_data >::data_size(), L4virtio::Svr::Virtio_gpio< Request_handler, Epiface >::Request_processor::get_request(), L4virtio::Svr::Virtio_i2c< Request_handler, Epiface >::Request_processor::get_request(), L4virtio::Svr::Console::Device::port_read(), and L4virtio::Svr::Console::Device::port_write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start() [1/2]

template<typename DESC_MAN, typename ... ARGS>
void L4virtio::Svr::Request_processor::start ( DESC_MAN * dm,
Virtqueue * ring,
Virtqueue::Head_desc const & request,
ARGS... args )
inline

Start processing a new request.

Template Parameters
DESC_MANType of descriptor manager (implicit).
Parameters
dmDescriptor manager that is used to translate VIRTIO descriptor addresses.
ringVIRTIO ring of the request.
requestVIRTIO request from Virtqueue::next_avail()
argsExtra arguments passed to dm->load_desc()
Precondition
The given request must be valid.
Exceptions
Bad_descriptorThe descriptor has an invalid size or load_desc() has thrown an exception by itself.

Definition at line 501 of file virtio.

References cxx::access_once(), L4virtio::Svr::Bad_descriptor::Bad_size, L4virtio::Svr::Virtqueue::desc(), L4virtio::Svr::Virtqueue::Head_desc::desc(), L4_UNLIKELY, and L4virtio::Virtqueue::num().

Referenced by L4virtio::Svr::Block_request< Ds_data >::data_size(), Virtio_net_request::drop_requests(), 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start() [2/2]

template<typename DESC_MAN, typename ... ARGS>
Virtqueue::Request const & L4virtio::Svr::Request_processor::start ( DESC_MAN * dm,
Virtqueue::Request const & request,
ARGS... args )
inline

Start processing a new request.

Template Parameters
DESC_MANType of descriptor manager (implicit).
Parameters
dmDescriptor manager that is used to translate VIRTIO descriptor addresses.
requestVIRTIO request from Virtqueue::next_avail()
argsExtra arguments passed to dm->load_desc()
Precondition
The given request must be valid.

Definition at line 534 of file virtio.

References start().

Here is the call graph for this function:

The documentation for this class was generated from the following file: