L4Re - L4 Runtime Environment
L4virtio::Svr::Driver_mem_region_t< DATA > Class Template Reference

Region of driver memory, that shall be managed locally. More...

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

Public Member Functions

 Driver_mem_region_t ()
 Make default empty memroy region.
 
 Driver_mem_region_t (l4_uint64_t drv_base, l4_umword_t size, l4_addr_t offset, Ds_cap &&ds)
 Make a local memory region for the given driver values. More...
 
bool is_writable () const
 
Flags flags () const
 
bool empty () const
 
l4_uint64_t drv_base () const
 
void * local_base () const
 
l4_umword_t size () const
 
l4_addr_t ds_offset () const
 
L4::Cap< L4Re::Dataspaceds () const
 
bool contains (l4_uint64_t base, l4_umword_t size) const
 Test if the given driver address range is within this region. More...
 
template<typename T >
T * local (Ptr< T > p) const
 Get the local address for driver address p. More...
 

Detailed Description

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

Region of driver memory, that shall be managed locally.

Template Parameters
DATAClass defining additional information

Definition at line 380 of file l4virtio.

Constructor & Destructor Documentation

◆ Driver_mem_region_t()

template<typename DATA>
L4virtio::Svr::Driver_mem_region_t< DATA >::Driver_mem_region_t ( l4_uint64_t  drv_base,
l4_umword_t  size,
l4_addr_t  offset,
Ds_cap &&  ds 
)
inline

Make a local memory region for the given driver values.

Parameters
drv_baseBase address of the memory region used by the driver.
sizeSize of the memory region.
offsetOffset within the data space that is mapped to drv_base within the driver.
dsData space capability backing the memory.

This constructor attaches the region of given data space to the local address space and stores the corresponding data for later reference.

Definition at line 425 of file l4virtio.

Member Function Documentation

◆ contains()

template<typename DATA>
bool L4virtio::Svr::Driver_mem_region_t< DATA >::contains ( l4_uint64_t  base,
l4_umword_t  size 
) const
inline

Test if the given driver address range is within this region.

Parameters
baseThe driver base address.
sizeThe size of the region to lookup.
Returns
true if the given driver address region is contained in this region, false else.

Definition at line 516 of file l4virtio.

◆ drv_base()

template<typename DATA>
l4_uint64_t L4virtio::Svr::Driver_mem_region_t< DATA >::drv_base ( ) const
inline
Returns
The base address used by the driver.

Definition at line 495 of file l4virtio.

◆ ds()

template<typename DATA>
L4::Cap<L4Re::Dataspace> L4virtio::Svr::Driver_mem_region_t< DATA >::ds ( ) const
inline
Returns
The data space capability for this region.

Definition at line 507 of file l4virtio.

◆ ds_offset()

template<typename DATA>
l4_addr_t L4virtio::Svr::Driver_mem_region_t< DATA >::ds_offset ( ) const
inline
Returns
The offset within the data space.

Definition at line 504 of file l4virtio.

◆ empty()

template<typename DATA>
bool L4virtio::Svr::Driver_mem_region_t< DATA >::empty ( ) const
inline
Returns
True if the region is empty (size == 0), false else.

Definition at line 491 of file l4virtio.

◆ flags()

template<typename DATA>
Flags L4virtio::Svr::Driver_mem_region_t< DATA >::flags ( ) const
inline
Returns
The flags for this region.

Definition at line 488 of file l4virtio.

◆ is_writable()

template<typename DATA>
bool L4virtio::Svr::Driver_mem_region_t< DATA >::is_writable ( ) const
inline
Returns
True if the region is writable, false else.

Definition at line 485 of file l4virtio.

◆ local()

template<typename DATA>
template<typename T >
T* L4virtio::Svr::Driver_mem_region_t< DATA >::local ( Ptr< T >  p) const
inline

Get the local address for driver address p.

Parameters
pDriver address to translate.
Precondition
p must be contained in this region.
Returns
Local address for the given driver address p.

Definition at line 540 of file l4virtio.

Referenced by L4virtio::Svr::Driver_mem_list_t< Ds_data >::load_desc().

+ Here is the caller graph for this function:

◆ local_base()

template<typename DATA>
void* L4virtio::Svr::Driver_mem_region_t< DATA >::local_base ( ) const
inline
Returns
The local base address.

Definition at line 498 of file l4virtio.

◆ size()

template<typename DATA>
l4_umword_t L4virtio::Svr::Driver_mem_region_t< DATA >::size ( ) const
inline
Returns
The size of the region in bytes.

Definition at line 501 of file l4virtio.


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