L4Re - L4 Runtime Environment
L4Re::Util::Dataspace_svr Class Reference

Dataspace server class. More...

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

Public Member Functions

int map (l4_addr_t offset, l4_addr_t local_addr, unsigned long flags, l4_addr_t min_addr, l4_addr_t max_addr, L4::Ipc::Snd_fpage &memory)
 Map a region of the dataspace. More...
 
virtual int map_hook (l4_addr_t offs, unsigned long flags, l4_addr_t min, l4_addr_t max)
 A hook that is called as the first operation in each map request. More...
 
virtual int phys (l4_addr_t offset, l4_addr_t &phys_addr, l4_size_t &phys_size) throw ()
 Return physical address for a virtual address. More...
 
virtual void take () throw ()
 Take a reference to this dataspace. More...
 
virtual unsigned long release () throw ()
 Release a reference to this dataspace. More...
 
virtual long copy (l4_addr_t dst_offs, l4_umword_t src_id, l4_addr_t src_offs, unsigned long size) throw ()
 Copy from src dataspace to this destination dataspace. More...
 
virtual long clear (unsigned long offs, unsigned long size) const throw ()
 Clear a region in the dataspace. More...
 
virtual long allocate (l4_addr_t offset, l4_size_t size, unsigned access) throw ()
 Allocate a region within a dataspace. More...
 
virtual unsigned long page_shift () const throw ()
 Define the size of the flexpage to map. More...
 
virtual bool is_static () const throw ()
 Return whether the dataspace is static. More...
 

Detailed Description

Dataspace server class.

The default implementation of the interface provides a continuously mapped dataspace.

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 
)
throw (
)
inlinevirtual

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 168 of file dataspace_svr.

References L4_ENODEV.

Referenced by is_static().

+ Here is the caller graph for this function:

◆ clear()

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

Clear a region in the dataspace.

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

Referenced by copy(), and is_static().

+ Here is the caller graph for this function:

◆ 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 
)
throw (
)
inlinevirtual

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 139 of file dataspace_svr.

References clear(), and L4_ENODEV.

Referenced by is_static().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_static()

virtual bool L4Re::Util::Dataspace_svr::is_static ( ) const
throw (
)
inlinevirtual

Return whether the dataspace is static.

Returns
True if dataspace is static

Definition at line 184 of file dataspace_svr.

References allocate(), clear(), copy(), L4::Ipc::Gen_fpage< T >::data(), L4Re::Dataspace::Stats::flags, L4::Ipc::Gen_fpage< T >::id_received(), L4_CAP_FPAGE_W, L4_EACCESS, L4_EINVAL, L4_EOK, L4_EPERM, l4_round_size(), map(), page_shift(), phys(), release(), L4Re::Dataspace::Stats::size, and take().

+ Here is the call graph for this function:

◆ map()

int L4Re::Util::Dataspace_svr::map ( l4_addr_t  offset,
l4_addr_t  local_addr,
unsigned long  flags,
l4_addr_t  min_addr,
l4_addr_t  max_addr,
L4::Ipc::Snd_fpage memory 
)

Map a region of the dataspace.

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

Referenced by is_static().

+ Here is the caller graph for this function:

◆ map_hook()

virtual int L4Re::Util::Dataspace_svr::map_hook ( l4_addr_t  offs,
unsigned long  flags,
l4_addr_t  min,
l4_addr_t  max 
)
inlinevirtual

A hook that is called as the first operation in each map request.

Parameters
offsOffs param to map
flagsFlags param to map
minMin param to map
maxMax param to map
Return values
<0Error and the map request will be aborted with that error.
>=0Success
See also
map

Definition at line 90 of file dataspace_svr.

References phys().

+ Here is the call graph for this function:

◆ page_shift()

virtual unsigned long L4Re::Util::Dataspace_svr::page_shift ( ) const
throw (
)
inlinevirtual

Define the size of the flexpage to map.

Returns
flexpage size

Definition at line 176 of file dataspace_svr.

References L4_LOG2_PAGESIZE.

Referenced by is_static().

+ Here is the caller graph for this function:

◆ phys()

virtual int L4Re::Util::Dataspace_svr::phys ( l4_addr_t  offset,
l4_addr_t phys_addr,
l4_size_t phys_size 
)
throw (
)
virtual

Return physical address for a virtual address.

Parameters
offsetOffset into the dataspace
[out]phys_addrPhysical address
[out]phys_sizeSize of continious physical region
Return values
0Success
<0Error

Referenced by is_static(), and map_hook().

+ Here is the caller graph for this function:

◆ release()

virtual unsigned long L4Re::Util::Dataspace_svr::release ( )
throw (
)
inlinevirtual

Release a reference to this dataspace.

Returns
Number of references to the dataspace

Default does nothing and returns always zero.

Definition at line 124 of file dataspace_svr.

Referenced by is_static().

+ Here is the caller graph for this function:

◆ take()

virtual void L4Re::Util::Dataspace_svr::take ( )
throw (
)
inlinevirtual

Take a reference to this dataspace.

Default does nothing.

Definition at line 114 of file dataspace_svr.

Referenced by is_static().

+ Here is the caller graph for this function:

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