Functions to open / close dataspaces and to create copies of dataspaces.
More...
|
Defines |
#define | L4DM_RESIZE 0x00000080 |
#define | L4DM_CONTIGUOUS 0x00000100 |
#define | L4DM_PINNED 0x00000200 |
#define | L4DM_COW 0x00000400 |
#define | L4DM_SAME_TASK 0x00002000 |
#define | L4DM_WHOLE_DS (-1) |
#define | L4DM_DEFAULT_DSM L4_INVALID_ID |
Functions |
L4_CV int | l4dm_mem_open (l4_threadid_t dsm_id, l4_size_t size, l4_addr_t align, l4_uint32_t flags, const char *name, l4dm_dataspace_t *ds) |
| Create new dataspace.
|
L4_CV int | l4dm_mem_resize (const l4dm_dataspace_t *ds, l4_size_t new_size) |
| Resize dataspace.
|
L4_CV int | l4dm_mem_info (const l4dm_dataspace_t *ds, l4_size_t *size, l4_threadid_t *owner, char *name, l4_uint32_t *next_id) |
| Get debugging information.
|
L4_CV int | l4dm_close (const l4dm_dataspace_t *ds) |
| Close dataspace.
|
int | l4dm_close_all (l4_threadid_t dsm_id, l4_threadid_t client, l4_uint32_t flags) |
| Close all dataspaces of a client.
|
L4_CV int | l4dm_copy (const l4dm_dataspace_t *ds, l4_uint32_t flags, const char *name, l4dm_dataspace_t *copy) |
| Create dataspace copy, short form.
|
int | l4dm_copy_long (const l4dm_dataspace_t *ds, l4_offs_t src_offs, l4_offs_t dst_offs, l4_size_t num, l4_uint32_t flags, const char *name, l4dm_dataspace_t *copy) |
| Create dataspace copy, long form.
|
Detailed Description
Functions to open / close dataspaces and to create copies of dataspaces.
Define Documentation
#define L4DM_RESIZE 0x00000080 |
Allow resize
Definition at line 45 of file consts.h.
#define L4DM_CONTIGUOUS 0x00000100 |
Allocate phys. contiguous memory
Definition at line 60 of file consts.h.
#define L4DM_PINNED 0x00000200 |
Allocated pinned memory
Definition at line 64 of file consts.h.
#define L4DM_COW 0x00000400 |
Create copy-on-write dataspace copy
Definition at line 67 of file consts.h.
#define L4DM_SAME_TASK 0x00002000 |
Close dataspace owned by threads of the same task
Definition at line 82 of file consts.h.
#define L4DM_WHOLE_DS (-1) |
Copy: create copy of the whole dataspace, phys_addr: return the phys. addresses of the whole dataspace
Definition at line 95 of file consts.h.
#define L4DM_DEFAULT_DSM L4_INVALID_ID |
Open: use default dataspcae manager
Definition at line 104 of file consts.h.
Function Documentation
L4_CV int l4dm_mem_open |
( |
l4_threadid_t |
dsm_id, |
|
|
l4_size_t |
size, |
|
|
l4_addr_t |
align, |
|
|
l4_uint32_t |
flags, |
|
|
const char * |
name, |
|
|
l4dm_dataspace_t * |
ds | |
|
) |
| | |
Create new dataspace.
- Parameters:
-
| dsm_id | Dataspace manager id, set to L4DM_DEFAULT_DSM to use default dataspace manager provided by the L4 environment |
| size | Dataspace size |
| align | Alignment |
| flags | Flags:
- L4DM_CONTIGUOUS allocate dataspace on phys. contiguous memory
- L4DM_PINNED allocate "pinned" memory, there will be no pagefaults once the dataspace is mapped
|
| name | Dataspace name |
- Return values:
-
- Returns:
- 0 on success, error code otherwise:
- -L4_EIPC IPC error calling dataspace manager
- -L4_ENOMEM out of memory
- -L4_ENODM no dataspace manager found
Call dataspace manager
dsm_id to create a new memory dataspace.
Resize dataspace.
- Parameters:
-
| ds | Dataspace id |
| new_size | New dataspace size |
- Returns:
- 0 on success (resized dataspace), error code otherwise:
- -L4_EIPC IPC error calling dataspace manager
- -L4_EINVAL invalid dataspace id
- -L4_EPERM caller is not the owner of the dataspace
- -L4_ENOMEM out of memory
Resize the dataspace. If new_size is smaller than the current dataspace size, the remaining area at the end of the dataspace will be freed, if the new size is 0 the dataspace will be closed. If the new size is larger than the current size, more memory is added to the dataspace. If the dataspace was allocated on contiguous memory, enlarge the used contiguous memory area.
L4_CV int l4dm_mem_info |
( |
const l4dm_dataspace_t * |
ds, |
|
|
l4_size_t * |
size, |
|
|
l4_threadid_t * |
owner, |
|
|
char * |
name, |
|
|
l4_uint32_t * |
next_id | |
|
) |
| | |
Get debugging information.
- Parameters:
-
- Return values:
-
| size | Dataspace size |
| owner | Dataspace owner |
| name | Dataspace name |
| next_id | Next dataspace id to iterate |
- Returns:
- 0 on success (resized dataspace), error code otherwise:
- -L4_EIPC IPC error calling dataspace manager
- -L4_EINVAL invalid dataspace id
- -L4_EPERM caller is not the owner of the dataspace
- -L4_ENOMEM out of memory
Retrieve information about a dataspace for debugging purposes.
Close dataspace.
- Parameters:
-
- Returns:
- 0 on success, error code otherwise:
- -L4_EIPC IPC error calling dataspace manager
- -L4_EINVAL invalid dataspace id
- -L4_EPERM operation not permitted, only the owner can close a dataspace
int l4dm_close_all |
( |
l4_threadid_t |
dsm_id, |
|
|
l4_threadid_t |
client, |
|
|
l4_uint32_t |
flags | |
|
) |
| | |
Close all dataspaces of a client.
- Parameters:
-
| dsm_id | Dataspace manager thread id |
| client | Client thread id |
| flags | Flags:
- L4DM_SAME_TASK close all dataspaces owned by threads of the task specified by client.
|
- Returns:
- 0 on success, error code otherwise:
- -L4_EINVAL invalid client thread id
- -L4_EPERM permission denied
- -L4_EIPC IPC error calling dataspace manager
This function can be called by everyone. It's up to the dataspace manager to decide who is allowed to close that dataspaces.
Create dataspace copy, short form.
- Parameters:
-
| ds | Source dataspace id |
| flags | Flags:
|
| name | Copy name |
- Return values:
-
- Returns:
- 0 on success (copy contains the id of the created copy), error code otherwise:
- -L4_EIPC IPC error calling dataspace manager
- -L4_EINVAL Invalid source dataspace id
- -L4_EPERM Permission denied
- -L4_ENOHANDLE Could not create dataspace descriptor
- -L4_ENOMEM Out of memory creating copy
Create a copy of the whole dataspace.
int l4dm_copy_long |
( |
const l4dm_dataspace_t * |
ds, |
|
|
l4_offs_t |
src_offs, |
|
|
l4_offs_t |
dst_offs, |
|
|
l4_size_t |
num, |
|
|
l4_uint32_t |
flags, |
|
|
const char * |
name, |
|
|
l4dm_dataspace_t * |
copy | |
|
) |
| | |
Create dataspace copy, long form.
- Parameters:
-
| ds | Source dataspace id |
| src_offs | Offset in source dataspace |
| dst_offs | Offset in destination dataspace |
| num | Number of bytes to copy, set to L4DM_WHOLE_DS to copy the whole dataspace starting at src_offs |
| flags | Flags
|
| name | Copy name |
- Return values:
-
| copy | Dataspace id of copy |
- Returns:
- 0 on success, error code otherwise:
- -L4_EIPC IPC error calling dataspace manager
- -L4_EINVAL Invalid source dataspace id
- -L4_EPERM Permission denied
- -L4_ENOHANDLE Could not create dataspace descriptor
- -L4_ENOMEM Out of memory creating copy
Create a copy of the dataspace,
src_offs and
num specify the area of the source dataspace which should be copied to the destination dataspace at offset
dst_offs. There are no restrictions to the offsets, in particular they do not need to be aligned to pagesizes.