L4Re - L4 Runtime Environment
Region map interface

Region map C interface. More...

+ Collaboration diagram for Region map interface:

Enumerations

enum  l4re_rm_flags_t {
  L4RE_RM_READ_ONLY = 0x01, L4RE_RM_NO_ALIAS = 0x02, L4RE_RM_PAGER = 0x04, L4RE_RM_RESERVED = 0x08,
  L4RE_RM_REGION_FLAGS = 0x0f, L4RE_RM_OVERMAP = 0x10, L4RE_RM_SEARCH_ADDR = 0x20, L4RE_RM_IN_AREA = 0x40,
  L4RE_RM_EAGER_MAP = 0x80, L4RE_RM_ATTACH_FLAGS = 0xf0
}
 Flags for region operations. More...
 

Functions

int l4re_rm_reserve_area (l4_addr_t *start, unsigned long size, unsigned flags, unsigned char align) L4_NOTHROW
 
int l4re_rm_free_area (l4_addr_t addr) L4_NOTHROW
 
int l4re_rm_attach (void **start, unsigned long size, unsigned long flags, l4re_ds_t const mem, l4_addr_t offs, unsigned char align) L4_NOTHROW
 
int l4re_rm_detach (void *addr) L4_NOTHROW
 Detach and unmap in current task. More...
 
int l4re_rm_detach_ds (void *addr, l4re_ds_t *ds) L4_NOTHROW
 Detach, unmap and return affected dataspace in current task. More...
 
int l4re_rm_detach_unmap (l4_addr_t addr, l4_cap_idx_t task) L4_NOTHROW
 Detach and unmap in specified task. More...
 
int l4re_rm_detach_ds_unmap (void *addr, l4re_ds_t *ds, l4_cap_idx_t task) L4_NOTHROW
 Detach and unmap in specified task. More...
 
int l4re_rm_find (l4_addr_t *addr, unsigned long *size, l4_addr_t *offset, unsigned *flags, l4re_ds_t *m) L4_NOTHROW
 
void l4re_rm_show_lists (void) L4_NOTHROW
 Dump region map internal data structures. More...
 
int l4re_rm_reserve_area_srv (l4_cap_idx_t rm, l4_addr_t *start, unsigned long size, unsigned flags, unsigned char align) L4_NOTHROW
 
int l4re_rm_free_area_srv (l4_cap_idx_t rm, l4_addr_t addr) L4_NOTHROW
 
int l4re_rm_attach_srv (l4_cap_idx_t rm, void **start, unsigned long size, unsigned long flags, l4re_ds_t const mem, l4_addr_t offs, unsigned char align) L4_NOTHROW
 
int l4re_rm_detach_srv (l4_cap_idx_t rm, l4_addr_t addr, l4re_ds_t *ds, l4_cap_idx_t task) L4_NOTHROW
 
int l4re_rm_find_srv (l4_cap_idx_t rm, l4_addr_t *addr, unsigned long *size, l4_addr_t *offset, unsigned *flags, l4re_ds_t *m) L4_NOTHROW
 
void l4re_rm_show_lists_srv (l4_cap_idx_t rm) L4_NOTHROW
 Dump region map internal data structures.
 

Detailed Description

Region map C interface.

Enumeration Type Documentation

◆ l4re_rm_flags_t

Flags for region operations.

Enumerator
L4RE_RM_READ_ONLY 

Region is read-only.

L4RE_RM_NO_ALIAS 

The region contains exclusive memory that is not mapped anywhere else.

L4RE_RM_PAGER 

Region has a pager.

L4RE_RM_RESERVED 

Region is reserved (blocked)

L4RE_RM_REGION_FLAGS 

Mask of all region flags.

L4RE_RM_OVERMAP 

Unmap memory already mapped in the region.

L4RE_RM_SEARCH_ADDR 

Search for a suitable address range.

L4RE_RM_IN_AREA 

Search only in area, or map into area.

L4RE_RM_EAGER_MAP 

Eagerly map the attached data space in.

L4RE_RM_ATTACH_FLAGS 

Mask of all attach flags.

Definition at line 40 of file rm.h.

Function Documentation

◆ l4re_rm_attach()

int l4re_rm_attach ( void **  start,
unsigned long  size,
unsigned long  flags,
l4re_ds_t const  mem,
l4_addr_t  offs,
unsigned char  align 
)
inline
Parameters
[in,out]startVirtual start address where the region manager shall attach the data space. If L4Re::Rm::Search_addr is given this value is used as the start address to search for a free virtual memory region and the resulting address is returned here. If L4Re::Rm::In_area is given the value is used as a selector for the area (see L4Re::Rm::reserve_area) to attach the data space to.
sizeSize of the data space to attach (in bytes)
flagsFlags, see L4Re::Rm::Attach_flags and L4Re::Rm::Region_flags. If the Eager_map flag is set this function may also return L4Re::Dataspace::map error codes if the mapping fails.
memData space
offsOffset into the data space to use
alignAlignment of the virtual region, log2-size, default: a page (L4_PAGESHIFT). This is only meaningful if the L4Re::Rm::Search_addr flag is used.
Return values
0Success
-L4_ENOENTNo area could be found (see L4Re::Rm::In_area)
-L4_EPERMOperation not allowed.
-L4_EINVAL
-L4_EADDRNOTAVAILThe given address is not available.
<0IPC errors

Makes the whole or parts of a data space visible in the virtual memory of the corresponding task. The corresponding region in the virtual address space is backed with the contents of the dataspace.

Note
When searching for a free place in the virtual address space, the space between start and the end of the virtual address space is searched.
There is no region object created, instead the region is defined by a virtual address within this range (see L4Re::Rm::find).
Returns
0 on success, <0 on error
See also
L4Re::Rm::attach

This function is using the L4::Env::env()->rm() service.

Examples:
examples/libs/l4re/c/ma+rm.c.

Definition at line 243 of file rm.h.

References l4re_rm_attach_srv().

+ Here is the call graph for this function:

◆ l4re_rm_attach_srv()

int l4re_rm_attach_srv ( l4_cap_idx_t  rm,
void **  start,
unsigned long  size,
unsigned long  flags,
l4re_ds_t const  mem,
l4_addr_t  offs,
unsigned char  align 
)
See also
L4Re::Rm::attach

Referenced by l4re_rm_attach().

+ Here is the caller graph for this function:

◆ l4re_rm_detach()

int l4re_rm_detach ( void *  addr)
inline

Detach and unmap in current task.

Parameters
addrAddress of the region to detach.
Returns
0 on success, <0 on error

Also

See also
L4Re::Rm::detach

This function is using the L4::Env::env()->rm() service.

Definition at line 253 of file rm.h.

References l4re_rm_detach_srv().

+ Here is the call graph for this function:

◆ l4re_rm_detach_ds()

int l4re_rm_detach_ds ( void *  addr,
l4re_ds_t ds 
)
inline

Detach, unmap and return affected dataspace in current task.

Parameters
addrAddress of the region to detach.
Return values
dsReturns dataspace that is affected.
Returns
0 on success, <0 on error

Also

See also
L4Re::Rm::detach

This function is using the L4::Env::env()->rm() service.

Examples:
examples/libs/l4re/c/ma+rm.c.

Definition at line 266 of file rm.h.

References l4re_rm_detach_srv().

+ Here is the call graph for this function:

◆ l4re_rm_detach_ds_unmap()

int l4re_rm_detach_ds_unmap ( void *  addr,
l4re_ds_t ds,
l4_cap_idx_t  task 
)
inline

Detach and unmap in specified task.

Parameters
addrAddress of the region to detach.
Return values
dsReturns dataspace that is affected.
Parameters
taskTask to unmap pages from, specify L4_INVALID_CAP to not unmap
Returns
0 on success, <0 on error

Also

See also
L4Re::Rm::detach

This function is using the L4::Env::env()->rm() service.

Definition at line 273 of file rm.h.

References l4re_rm_detach_srv().

+ Here is the call graph for this function:

◆ l4re_rm_detach_srv()

int l4re_rm_detach_srv ( l4_cap_idx_t  rm,
l4_addr_t  addr,
l4re_ds_t ds,
l4_cap_idx_t  task 
)
See also
L4Re::Rm::detach

Referenced by l4re_rm_detach(), l4re_rm_detach_ds(), l4re_rm_detach_ds_unmap(), and l4re_rm_detach_unmap().

+ Here is the caller graph for this function:

◆ l4re_rm_detach_unmap()

int l4re_rm_detach_unmap ( l4_addr_t  addr,
l4_cap_idx_t  task 
)
inline

Detach and unmap in specified task.

Parameters
addrAddress of the region to detach.
taskTask to unmap pages from, specify L4_INVALID_CAP to not unmap
Returns
0 on success, <0 on error

Also

See also
L4Re::Rm::detach

This function is using the L4::Env::env()->rm() service.

Definition at line 260 of file rm.h.

References l4re_rm_detach_srv().

+ Here is the call graph for this function:

◆ l4re_rm_find()

int l4re_rm_find ( l4_addr_t addr,
unsigned long *  size,
l4_addr_t offset,
unsigned *  flags,
l4re_ds_t m 
)
inline
Returns
0 on success, <0 on error
See also
L4Re::Rm::find

Definition at line 280 of file rm.h.

References l4re_rm_find_srv().

+ Here is the call graph for this function:

◆ l4re_rm_find_srv()

int l4re_rm_find_srv ( l4_cap_idx_t  rm,
l4_addr_t addr,
unsigned long *  size,
l4_addr_t offset,
unsigned *  flags,
l4re_ds_t m 
)
See also
L4Re::Rm::find

Referenced by l4re_rm_find().

+ Here is the caller graph for this function:

◆ l4re_rm_free_area()

int l4re_rm_free_area ( l4_addr_t  addr)
inline
Returns
0 on success, <0 on error
See also
L4Re::Rm::free_area

This function is using the L4::Env::env()->rm() service.

Definition at line 237 of file rm.h.

References l4re_rm_free_area_srv().

+ Here is the call graph for this function:

◆ l4re_rm_free_area_srv()

int l4re_rm_free_area_srv ( l4_cap_idx_t  rm,
l4_addr_t  addr 
)
See also
L4Re::Rm::free_area

Referenced by l4re_rm_free_area().

+ Here is the caller graph for this function:

◆ l4re_rm_reserve_area()

int l4re_rm_reserve_area ( l4_addr_t start,
unsigned long  size,
unsigned  flags,
unsigned char  align 
)
inline
Returns
0 on success, <0 on error
See also
L4Re::Rm::reserve_area

This function is using the L4::Env::env()->rm() service.

Definition at line 229 of file rm.h.

References l4re_rm_reserve_area_srv().

+ Here is the call graph for this function:

◆ l4re_rm_reserve_area_srv()

int l4re_rm_reserve_area_srv ( l4_cap_idx_t  rm,
l4_addr_t start,
unsigned long  size,
unsigned  flags,
unsigned char  align 
)
See also
L4Re::Rm::reserve_area

Referenced by l4re_rm_reserve_area().

+ Here is the caller graph for this function:

◆ l4re_rm_show_lists()

void l4re_rm_show_lists ( void  )
inline

Dump region map internal data structures.

This function is using the L4::Env::env()->rm() service.

Definition at line 287 of file rm.h.

References l4re_rm_show_lists_srv().

+ Here is the call graph for this function: