L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
L4Re::Util::Dataspace_svr Class Reference

Dataspace server class. More...

#include <dataspace_svr>

+ Collaboration diagram for L4Re::Util::Dataspace_svr:

Public Member Functions

int map (Dataspace::Offset offset, Dataspace::Map_addr local_addr, Dataspace::Flags flags, Dataspace::Map_addr min_addr, Dataspace::Map_addr max_addr, L4::Ipc::Snd_fpage &memory)
 Map a region of the dataspace.
 
virtual int map_hook (Dataspace::Offset offs, unsigned order, Dataspace::Flags flags, Dataspace::Map_addr *base, unsigned *send_order)
 A hook that is called for acquiring the data to be mapped.
 
virtual void take () noexcept
 Take a reference to this dataspace.
 
virtual unsigned long release () noexcept
 Release a reference to this dataspace.
 
virtual long copy (l4_addr_t dst_offs, l4_umword_t src_id, l4_addr_t src_offs, unsigned long size) noexcept
 Copy from src dataspace to this destination dataspace.
 
virtual long clear (unsigned long offs, unsigned long size) const noexcept
 Clear a region in the dataspace.
 
virtual long allocate (l4_addr_t offset, l4_size_t size, unsigned access) noexcept
 Allocate a region within a dataspace.
 
virtual unsigned long page_shift () const noexcept
 Define the size of the flexpage to map.
 
virtual bool is_static () const noexcept
 Return whether the dataspace is static.
 
virtual long map_info (l4_addr_t &start_addr, l4_addr_t &end_addr) noexcept
 Return mapping information for no-MMU systems.
 

Detailed Description

Dataspace server class.

The default implementation of the interface provides a continuous dataspace with contiguous pages.

Definition at line 40 of file dataspace_svr.

Member Function Documentation

◆ allocate()

virtual long L4Re::Util::Dataspace_svr::allocate ( l4_addr_t  offset,
l4_size_t  size,
unsigned  access 
)
inlinevirtualnoexcept

Allocate a region within a dataspace.

Parameters
offsetOffset in the dataspace, in bytes.
sizeSize of the range, in bytes.
accessAccess mode with which the memory backing the dataspace region should be allocated.
Return values
0Success
<0Error

Definition at line 235 of file dataspace_svr.

References L4_ENODEV.

◆ clear()

virtual long L4Re::Util::Dataspace_svr::clear ( unsigned long  offs,
unsigned long  size 
) const
inlinevirtualnoexcept

Clear a region in the dataspace.

Parameters
offsStart of the region
sizeSize of the region
Return values
0Success
<0Error

Definition at line 203 of file dataspace_svr.

References L4_ERANGE.

◆ copy()

virtual long L4Re::Util::Dataspace_svr::copy ( l4_addr_t  dst_offs,
l4_umword_t  src_id,
l4_addr_t  src_offs,
unsigned long  size 
)
inlinevirtualnoexcept

Copy from src dataspace to this destination dataspace.

Parameters
dst_offsOffset into the destination dataspace
src_idLocal id of the source dataspace
src_offsOffset into the source dataspace
sizeNumber of bytes to copy
Return values
>=0Number of bytes copied
<0An error occured. The error code may depend on the implementation.

Definition at line 186 of file dataspace_svr.

References L4_ENODEV.

◆ is_static()

virtual bool L4Re::Util::Dataspace_svr::is_static ( ) const
inlinevirtualnoexcept

Return whether the dataspace is static.

Returns
True if dataspace is static

Definition at line 255 of file dataspace_svr.

◆ map()

int L4Re::Util::Dataspace_svr::map ( Dataspace::Offset  offset,
Dataspace::Map_addr  local_addr,
Dataspace::Flags  flags,
Dataspace::Map_addr  min_addr,
Dataspace::Map_addr  max_addr,
L4::Ipc::Snd_fpage memory 
)
inline

Map a region of the dataspace.

Parameters
offsetOffset to start within data space
local_addrLocal address to map to.
flagsDataspace flags, see L4Re::Dataspace::F::Flags.
min_addrDefines start of receive window.
max_addrDefines end of receive window.
[out]memorySend fpage to map
Return values
0Success
<0Error

Definition at line 68 of file dataspace_svr.

References L4_EOK, L4_ERANGE, l4_fpage(), L4_PAGESHIFT, l4_round_page(), l4_trunc_page(), l4_trunc_size(), and map_hook().

+ Here is the call graph for this function:

◆ map_hook()

virtual int L4Re::Util::Dataspace_svr::map_hook ( Dataspace::Offset  offs,
unsigned  order,
Dataspace::Flags  flags,
Dataspace::Map_addr *  base,
unsigned *  send_order 
)
inlinevirtual

A hook that is called for acquiring the data to be mapped.

Parameters
offsOffset in dataspace to supply
orderLog2-size of data to supply
flagsFlags for the mapping
baseStart address of the flexpage to be mapped
send_orderOrder (log2 of size) of the flexpage to be mapped
Return values
<0Error and the map request will be aborted with that error.
>=0Success
See also
map

Definition at line 147 of file dataspace_svr.

Referenced by map().

+ Here is the caller graph for this function:

◆ map_info()

virtual long L4Re::Util::Dataspace_svr::map_info ( l4_addr_t start_addr,
l4_addr_t end_addr 
)
inlinevirtualnoexcept

Return mapping information for no-MMU systems.

The method is only called on no-MMU systems. It should return the address of the underlying backing buffer so that the caller might map the dataspace.

The default implementation always returns an error because the derived class must provide the required information.

See also
L4Re::Dataspace::map_info()

Definition at line 270 of file dataspace_svr.

References L4_EPERM.

◆ page_shift()

virtual unsigned long L4Re::Util::Dataspace_svr::page_shift ( ) const
inlinevirtualnoexcept

Define the size of the flexpage to map.

Returns
flexpage size

Definition at line 247 of file dataspace_svr.

References L4_LOG2_PAGESIZE.

◆ release()

virtual unsigned long L4Re::Util::Dataspace_svr::release ( )
inlinevirtualnoexcept

Release a reference to this dataspace.

Returns
Number of references to the dataspace

Default does nothing and returns always zero.

Definition at line 171 of file dataspace_svr.

◆ take()

virtual void L4Re::Util::Dataspace_svr::take ( )
inlinevirtualnoexcept

Take a reference to this dataspace.

Default does nothing.

Definition at line 161 of file dataspace_svr.


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