L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
L4virtio::Svr::Driver_mem_list_t< DATA > Class Template Reference

List of driver memory regions assigned to a single L4-VIRTIO transport instance. More...

#include <l4virtio>

+ Inheritance diagram for L4virtio::Svr::Driver_mem_list_t< DATA >:
+ Collaboration diagram for L4virtio::Svr::Driver_mem_list_t< DATA >:

Public Types

typedef L4Re::Util::Unique_cap< L4Re::DataspaceDs_cap
 type for storing a data-space capability internally
 

Public Member Functions

 Driver_mem_list_t ()
 Make an empty, zero capacity list.
 
void init (unsigned max)
 Make a fresh list with capacity max.
 
bool full () const
 
Mem_region const * add (l4_uint64_t drv_base, l4_umword_t size, l4_addr_t offset, Ds_cap &&ds)
 Add a new region to the list.
 
void remove (Mem_region const *r)
 Remove the given region from the list.
 
Mem_region * find (l4_uint64_t base, l4_umword_t size) const
 Find memory region containing the given driver address region.
 
void load_desc (Virtqueue::Desc const &desc, Request_processor const *p, Virtqueue::Desc const **table) const
 Default implementation for loading an indirect descriptor.
 
void load_desc (Virtqueue::Desc const &desc, Request_processor const *p, Mem_region const **data) const
 Default implementation returning the Driver_mem_region.
 
template<typename ARG >
void load_desc (Virtqueue::Desc const &desc, Request_processor const *p, ARG *data) const
 Default implementation returning generic information.
 

Detailed Description

template<typename DATA>
class L4virtio::Svr::Driver_mem_list_t< DATA >

List of driver memory regions assigned to a single L4-VIRTIO transport instance.

Note
The regions added to this list must never overlap.

Definition at line 629 of file l4virtio.

Member Function Documentation

◆ add()

template<typename DATA >
Mem_region const * L4virtio::Svr::Driver_mem_list_t< DATA >::add ( l4_uint64_t  drv_base,
l4_umword_t  size,
l4_addr_t  offset,
Ds_cap &&  ds 
)
inline

Add a new region to the list.

Parameters
drv_baseDriver base address of the region.
sizeSize of the region in bytes.
offsetOffset within the data space attached to drv_base.
dsData space backing the driver memory.
Returns
A pointer to the new region.

Definition at line 669 of file l4virtio.

References L4Re::chksys(), L4virtio::Svr::Driver_mem_list_t< DATA >::full(), and L4_ENOMEM.

+ Here is the call graph for this function:

◆ find()

template<typename DATA >
Mem_region * L4virtio::Svr::Driver_mem_list_t< DATA >::find ( l4_uint64_t  base,
l4_umword_t  size 
) const
inline

Find memory region containing the given driver address region.

Parameters
baseDriver base address.
sizeSize of the region.
Returns
Pointer to the region containing the given region, NULL if none is found.

Definition at line 703 of file l4virtio.

Referenced by L4virtio::Svr::Driver_mem_list_t< DATA >::load_desc(), L4virtio::Svr::Driver_mem_list_t< DATA >::load_desc(), and L4virtio::Svr::Driver_mem_list_t< DATA >::load_desc().

+ Here is the caller graph for this function:

◆ full()

template<typename DATA >
bool L4virtio::Svr::Driver_mem_list_t< DATA >::full ( ) const
inline
Returns
True if the remaining capacity is 0.

Definition at line 658 of file l4virtio.

Referenced by L4virtio::Svr::Driver_mem_list_t< DATA >::add().

+ Here is the caller graph for this function:

◆ init()

template<typename DATA >
void L4virtio::Svr::Driver_mem_list_t< DATA >::init ( unsigned  max)
inline

Make a fresh list with capacity max.

Parameters
maxThe capacity of this vector.

Definition at line 650 of file l4virtio.

◆ load_desc() [1/3]

template<typename DATA >
template<typename ARG >
void L4virtio::Svr::Driver_mem_list_t< DATA >::load_desc ( Virtqueue::Desc const &  desc,
Request_processor const *  p,
ARG *  data 
) const
inline

Default implementation returning generic information.

Template Parameters
ARGAbstract argument type used with Request_processor::start() and Request_processor::next() to deliver the result of loading a descriptor. This type must provide a constructor taking three arguments: (1) pointer to a Driver_mem_region, (2) the Virtqueue::Desc descriptor, and (3) a pointer to the calling Request_processor.
Parameters
descThe descriptor to load
pThe request processor calling us
[out]dataShall be assigned to ARG(mem, desc, p)
Exceptions
Bad_descriptorThe descriptor address could not be translated.

Definition at line 764 of file l4virtio.

References L4virtio::Virtqueue::Desc::addr, L4virtio::Svr::Bad_descriptor::Bad_address, L4virtio::Svr::Driver_mem_list_t< DATA >::find(), L4virtio::Ptr< T >::get(), L4_UNLIKELY, and L4virtio::Virtqueue::Desc::len.

+ Here is the call graph for this function:

◆ load_desc() [2/3]

template<typename DATA >
void L4virtio::Svr::Driver_mem_list_t< DATA >::load_desc ( Virtqueue::Desc const &  desc,
Request_processor const *  p,
Mem_region const **  data 
) const
inline

Default implementation returning the Driver_mem_region.

Parameters
descThe descriptor to load
pThe request processor calling us
[out]dataShall be set to a pointer to the Driver_mem_region that covers the descriptor.
Exceptions
Bad_descriptorThe descriptor address could not be translated.

Definition at line 737 of file l4virtio.

References L4virtio::Virtqueue::Desc::addr, L4virtio::Svr::Bad_descriptor::Bad_address, L4virtio::Svr::Driver_mem_list_t< DATA >::find(), L4virtio::Ptr< T >::get(), L4_UNLIKELY, and L4virtio::Virtqueue::Desc::len.

+ Here is the call graph for this function:

◆ load_desc() [3/3]

template<typename DATA >
void L4virtio::Svr::Driver_mem_list_t< DATA >::load_desc ( Virtqueue::Desc const &  desc,
Request_processor const *  p,
Virtqueue::Desc const **  table 
) const
inline

Default implementation for loading an indirect descriptor.

Parameters
descThe descriptor to load
pThe request processor calling us
[out]tableShall be set to the loaded descriptor table
Exceptions
Bad_descriptorThe descriptor address could not be translated.

Definition at line 717 of file l4virtio.

References L4virtio::Virtqueue::Desc::addr, L4virtio::Svr::Bad_descriptor::Bad_address, L4virtio::Svr::Driver_mem_list_t< DATA >::find(), L4virtio::Ptr< T >::get(), L4_UNLIKELY, and L4virtio::Virtqueue::Desc::len.

+ Here is the call graph for this function:

◆ remove()

template<typename DATA >
void L4virtio::Svr::Driver_mem_list_t< DATA >::remove ( Mem_region const *  r)
inline

Remove the given region from the list.

Parameters
rThe region to remove (result from add(), or find()).

Definition at line 683 of file l4virtio.

References L4Re::chksys(), and L4_ERANGE.

+ Here is the call graph for this function:

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