L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
Dataspace interface

Dataspace C interface. More...

+ Collaboration diagram for Dataspace interface:

Data Structures

struct  l4re_ds_stats_t
 Information about the data space. More...
 

Typedefs

typedef l4_cap_idx_t l4re_ds_t
 Dataspace type.
 

Enumerations

enum  l4re_ds_map_flags {
}
 Flags to specify the memory mapping type of a request. More...
 

Functions

long l4re_ds_clear (l4re_ds_t ds, l4re_ds_offset_t offset, l4re_ds_size_t size) L4_NOTHROW
 Clear parts of a dataspace.
 
long l4re_ds_allocate (l4re_ds_t ds, l4re_ds_offset_t offset, l4re_ds_size_t size) L4_NOTHROW
 Allocate a range in the dataspace.
 
int l4re_ds_copy_in (l4re_ds_t ds, l4re_ds_offset_t dst_offs, l4re_ds_t src, l4re_ds_offset_t src_offs, l4re_ds_size_t size) L4_NOTHROW
 Copy contents from another dataspace.
 
l4re_ds_size_t l4re_ds_size (l4re_ds_t ds) L4_NOTHROW
 Get size of a dataspace.
 
l4re_ds_flags_t l4re_ds_flags (l4re_ds_t ds) L4_NOTHROW
 Get flags of the dataspace.
 
int l4re_ds_info (l4re_ds_t ds, l4re_ds_stats_t *stats) L4_NOTHROW
 Get information on the dataspace.
 

Detailed Description

Dataspace C interface.

Enumeration Type Documentation

◆ l4re_ds_map_flags

Flags to specify the memory mapping type of a request.

Enumerator
L4RE_DS_F_NORMAL 

request normal memory mapping

L4RE_DS_F_CACHEABLE 

request normal memory mapping

L4RE_DS_F_BUFFERABLE 

request bufferable (write buffered) mappings

L4RE_DS_F_UNCACHEABLE 

request uncacheable memory mappings

L4RE_DS_F_CACHING_MASK 

mask for caching flags

L4RE_DS_F_CACHING_SHIFT 

shift value for caching flags

Definition at line 58 of file dataspace.h.

Function Documentation

◆ l4re_ds_allocate()

long l4re_ds_allocate ( l4re_ds_t  ds,
l4re_ds_offset_t  offset,
l4re_ds_size_t  size 
)

Allocate a range in the dataspace.

Parameters
dsDataspace capability.
offsetOffset in the dataspace, in bytes.
sizeSize of the range, in bytes.
Return values
L4_EOKSuccess
-L4_ERANGEGiven range is outside the dataspace. (A dataspace provider may also silently ignore areas outside the dataspace.)
-L4_ENOMEMNot enough memory available.
<0IPC errors

On success, at least the given range is guaranteed to be allocated. The dataspace manager may also allocate more memory due to page granularity.

The memory is allocated with the same rights as the dataspace capability.

◆ l4re_ds_clear()

long l4re_ds_clear ( l4re_ds_t  ds,
l4re_ds_offset_t  offset,
l4re_ds_size_t  size 
)

Clear parts of a dataspace.

Parameters
dsDataspace capability.
offsetOffset within dataspace (in bytes).
sizeSize of region to clear (in bytes).
Return values
>=0Success.
-L4_ERANGEGiven range is outside the dataspace. (A dataspace provider may also silently ignore areas outside the dataspace.)
-L4_EACCESSNo L4_CAP_FPAGE_W right on dataspace capability.
<0IPC errors

Zeroes out the memory. Depending on the type of memory the memory could also be deallocated and replaced by a shared zero-page.

◆ l4re_ds_copy_in()

int l4re_ds_copy_in ( l4re_ds_t  ds,
l4re_ds_offset_t  dst_offs,
l4re_ds_t  src,
l4re_ds_offset_t  src_offs,
l4re_ds_size_t  size 
)

Copy contents from another dataspace.

Parameters
dsDestination dataspace.
dst_offsOffset in destination dataspace.
srcSource dataspace to copy from.
src_offsOffset in the source dataspace.
sizeSize to copy (in bytes).
Return values
L4_EOKSuccess
-L4_EACCESSNo L4_CAP_FPAGE_W right on the destination dataspace.
-L4_EINVALInvalid parameter supplied.
<0IPC errors

The copy operation may use copy-on-write mechanisms. The operation may also fail if both dataspaces are not from the same dataspace manager or the dataspace managers do not cooperate.

◆ l4re_ds_flags()

l4re_ds_flags_t l4re_ds_flags ( l4re_ds_t  ds)

Get flags of the dataspace.

Parameters
dsDataspace capability.
Return values
>=0Flags of the dataspace
<0IPC errors
See also
L4Re::Dataspace::F::Flags

◆ l4re_ds_info()

int l4re_ds_info ( l4re_ds_t  ds,
l4re_ds_stats_t stats 
)

Get information on the dataspace.

Parameters
dsDataspace capability.
[out]statsDataspace information
Return values
0Success
<0IPC errors

◆ l4re_ds_size()

l4re_ds_size_t l4re_ds_size ( l4re_ds_t  ds)

Get size of a dataspace.

Parameters
dsDataspace capability.
Returns
Size of the dataspace in bytes.