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

  offset | Offset in the dataspace, in bytes.
  size | Size of the range, in bytes.
  access | Access mode with which the memory backing the dataspace region should be allocated.

Return values

  0 | Success
  <0 | Error

Definition at line 224 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

  offs | Start of the region
  size | Size of the region

Return values

  0 | Success
  <0 | Error

Definition at line 192 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_offs | Offset into the destination dataspace
  src_id | Local id of the source dataspace
  src_offs | Offset into the source dataspace
  size | Number of bytes to copy

Return values

  >=0 | Number of bytes copied
  <0 | An error occured. The error code may depend on the implementation.

Definition at line 175 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 244 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

  | offset | Offset to start within data space
  | local_addr | Local address to map to.
  | flags | Dataspace flags, see L4Re::Dataspace::F::Flags.
  | min_addr | Defines start of receive window.
  | max_addr | Defines end of receive window.
  [out] | memory | Send fpage to map

Return values

  0 | Success
  <0 | Error

Definition at line 57 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

  offs | Offset in dataspace to supply
  order | Log2-size of data to supply
  flags | Flags for the mapping
  base | Start address of the flexpage to be mapped
  send_order | Order (log2 of size) of the flexpage to be mapped

Return values

  <0 | Error and the map request will be aborted with that error.
  >=0 | Success

See also
  map

Definition at line 136 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 259 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 236 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 160 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 150 of file dataspace_svr.

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

- l4/re/util/dataspace_svr