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::Dataspace > | Ds_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_base | Driver base address of the region.
  size | Size of the region in bytes.
  offset | Offset within the data space attached to drv_base.
  ds | Data space backing the driver memory.

Returns
  A pointer to the new region.

Definition at line 669 of file l4virtio.

## 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

  base | Driver base address.
  size | Size 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< No_custom_data >::load_desc(), L4virtio::Svr::Driver_mem_list_t< No_custom_data >::load_desc(), and L4virtio::Svr::Driver_mem_list_t< No_custom_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< No_custom_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

  max | The 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

  ARG | Abstract 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

  | desc | The descriptor to load
  | p | The request processor calling us
  [out] | data | Shall be assigned to ARG(mem, desc, p)

Exceptions

  Bad_descriptor | The descriptor address could not be translated.

Definition at line 764 of file l4virtio.

## 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

  | desc | The descriptor to load
  | p | The request processor calling us
  [out] | data | Shall be set to a pointer to the Driver_mem_region that covers the descriptor.

Exceptions

  Bad_descriptor | The descriptor address could not be translated.

Definition at line 737 of file l4virtio.

## 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

  | desc | The descriptor to load
  | p | The request processor calling us
  [out] | table | Shall be set to the loaded descriptor table

Exceptions

  Bad_descriptor | The descriptor address could not be translated.

Definition at line 717 of file l4virtio.

## 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

  r | The region to remove (result from add(), or find()).

Definition at line 683 of file l4virtio.

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

- l4/l4virtio/server/l4virtio