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>

+ 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 399 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 469 of file virtio.

References L4virtio::Virtqueue::Desc::flags.

◆ 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 476 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().

+ Here is the call graph for this function:
+ 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 493 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(), and L4virtio::Svr::Block_request< Ds_data >::next_block().

+ 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 428 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(), 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 459 of file virtio.

References start().

+ Here is the call graph for this function:

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