Dataspace C interface.
More...
Dataspace C interface.
◆ 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.
◆ 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
-
ds | Dataspace capability. |
offset | Offset in the dataspace, in bytes. |
size | Size of the range, in bytes. |
- Return values
-
L4_EOK | Success |
-L4_ERANGE | Given range is outside the dataspace. (A dataspace provider may also silently ignore areas outside the dataspace.) |
-L4_ENOMEM | Not enough memory available. |
<0 | IPC 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
-
ds | Dataspace capability. |
offset | Offset within dataspace (in bytes). |
size | Size of region to clear (in bytes). |
- Return values
-
>=0 | Success. |
-L4_ERANGE | Given range is outside the dataspace. (A dataspace provider may also silently ignore areas outside the dataspace.) |
-L4_EACCESS | No L4_CAP_FPAGE_W right on dataspace capability. |
<0 | IPC 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
-
ds | Destination dataspace. |
dst_offs | Offset in destination dataspace. |
src | Source dataspace to copy from. |
src_offs | Offset in the source dataspace. |
size | Size to copy (in bytes). |
- Return values
-
L4_EOK | Success |
-L4_EACCESS | No L4_CAP_FPAGE_W right on the destination dataspace. |
-L4_EINVAL | Invalid parameter supplied. |
<0 | IPC 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
-
- Return values
-
>=0 | Flags of the dataspace |
<0 | IPC errors |
- See also
- L4Re::Dataspace::F::Flags
◆ l4re_ds_info()
Get information on the dataspace.
- Parameters
-
| ds | Dataspace capability. |
[out] | stats | Dataspace information |
- Return values
-
◆ l4re_ds_size()
Get size of a dataspace.
- Parameters
-
- Returns
- Size of the dataspace in bytes.