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

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

#include <l4virtio>

+ 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 memory 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.
 
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.
 
template<typename T >
T * local (Ptr< T > p) const
 Get the local address for driver address p.
 

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 433 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 478 of file l4virtio.

References L4Re::chksys(), L4virtio::Svr::Driver_mem_region_t< DATA >::ds(), L4Re::Dataspace::Stats::flags, L4Re::Rm::Unique_region< T >::get(), L4Re::Dataspace::info(), L4_CAP_FPAGE_RO, L4_CAP_FPAGE_RW, L4_EINVAL, L4_ENOSYS, L4_ERANGE, L4_PAGESIZE, l4_round_page(), L4_SUPERPAGESHIFT, L4::Ipc::make_cap(), L4Re::Rm::F::R, L4Re::Rm::F::Search_addr, L4virtio::Svr::Driver_mem_region_t< DATA >::size(), L4Re::Dataspace::Stats::size, L4Re::Dataspace::F::W, and L4Re::Rm::F::W.

+ Here is the call graph for this function:

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 572 of file l4virtio.

References L4virtio::Svr::Driver_mem_region_t< DATA >::size().

+ Here is the call graph for this function:

◆ 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 551 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 563 of file l4virtio.

Referenced by L4virtio::Svr::Driver_mem_region_t< DATA >::Driver_mem_region_t().

+ Here is the caller graph for this function:

◆ 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 560 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 otherwise.

Definition at line 547 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 544 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 otherwise.

Definition at line 541 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 596 of file l4virtio.

References L4virtio::Ptr< T >::get().

+ Here is the call 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 554 of file l4virtio.

References L4Re::Rm::Unique_region< T >::get().

+ Here is the call graph for this function:

◆ 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 557 of file l4virtio.

Referenced by L4virtio::Svr::Driver_mem_region_t< DATA >::contains(), and L4virtio::Svr::Driver_mem_region_t< DATA >::Driver_mem_region_t().

+ Here is the caller graph for this function:

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