Dataspace C interface.
More...
|
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.
|
|
int | l4re_ds_map_info (l4re_ds_t ds, l4_addr_t *start_addr, l4_addr_t *end_addr) L4_NOTHROW |
| Get mapping range of dataspace.
|
|
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_map_info()
Get mapping range of dataspace.
- Parameters
-
In case of a MMU-less system, the dataspace must be mapped at the correct address in the task because virtual and physical address must match. This method returns the start and end address of the physically contiguous buffer backing the dataspace.
On MMU-enabled system any page aligned address is permissible. On such systems the method is just a stub.
- Parameters
-
[out] | start_addr | Start address of dataspace. |
[out] | end_addr | End address (inclusive) of dataspace. |
- Return values
-
>0 | Start/end address have been set and need to be obeyed. |
0 | No constraint of mapping address. |
-L4_EPERM | Cannot infer mapping address. Dataspace not mappable. |
<0 | IPC errors. |
◆ l4re_ds_size()
Get size of a dataspace.
- Parameters
-
- Returns
- Size of the dataspace in bytes.