Introduction   API Reference   Examples   Index  

L4env Setup Functions
[L4 Region Mapper Library API Reference]

These functions provide the region mapper functionality without calling the region mapper thread. More...

Functions

L4_CV L4_INLINE int l4rm_direct_attach_to_region (const l4dm_dataspace_t *ds, const void *addr, l4_size_t size, l4_offs_t ds_offs, l4_uint32_t flags)
 Attach dataspace to specified region.
L4_CV L4_INLINE int l4rm_direct_area_attach (const l4dm_dataspace_t *ds, l4_uint32_t area, l4_size_t size, l4_offs_t ds_offs, l4_uint32_t flags, void **addr)
 Attach dataspace to area.
L4_CV L4_INLINE int l4rm_direct_area_attach_to_region (const l4dm_dataspace_t *ds, l4_uint32_t area, const void *addr, l4_size_t size, l4_offs_t ds_offs, l4_uint32_t flags)
 Attach dataspace to specified region in area.
L4_CV L4_INLINE int l4rm_direct_area_setup_region (l4_addr_t addr, l4_size_t size, l4_uint32_t area, int type, l4_uint32_t flags, l4_threadid_t pager)
 Setup VM area.
L4_CV L4_INLINE int l4rm_direct_area_reserve (l4_size_t size, l4_uint32_t flags, l4_addr_t *addr, l4_uint32_t *area)
 Reserve area.
L4_CV L4_INLINE int l4rm_direct_area_reserve_region (l4_addr_t addr, l4_size_t size, l4_uint32_t flags, l4_uint32_t *area)
 Reserve specified area.

Detailed Description

These functions provide the region mapper functionality without calling the region mapper thread.

Use these functions carefully, no synchronization of accesses to the region mapper data structures is done. These functions are intended to be used by the L4env startup code of a task, where the region mapper thread might not run yet.


Function Documentation

L4_CV L4_INLINE int l4rm_direct_attach_to_region ( const l4dm_dataspace_t *  ds,
const void *  addr,
l4_size_t  size,
l4_offs_t  ds_offs,
l4_uint32_t  flags 
)

Attach dataspace to specified region.

Parameters:
ds Dataspace id
addr Address
size Size
ds_offs Offset in dataspace
flags Flags
Returns:
0 on success (dataspace attached to region at addr), error code otherwise:
  • -L4_EINVAL invalid area id
  • -L4_ENOMEM out of memory allocating descriptors
  • -L4_ENOMAP no region found

References L4RM_DEFAULT_REGION_AREA.

L4_CV L4_INLINE int l4rm_direct_area_attach ( const l4dm_dataspace_t *  ds,
l4_uint32_t  area,
l4_size_t  size,
l4_offs_t  ds_offs,
l4_uint32_t  flags,
void **  addr 
)

Attach dataspace to area.

Parameters:
ds Dataspace id
area Area id, set to L4RM_DEFAULT_REGION_AREA to use default area (i.e. an area not reserved)
size Size
ds_offs Offset in dataspace
flags Flags
Return values:
addr Start address
Returns:
0 on success (dataspace attached to region at addr), error code otherwise:
  • -L4_EINVAL invalid area id
  • -L4_ENOMEM out of memory allocating descriptors
  • -L4_ENOMAP no region found

L4_CV L4_INLINE int l4rm_direct_area_attach_to_region ( const l4dm_dataspace_t *  ds,
l4_uint32_t  area,
const void *  addr,
l4_size_t  size,
l4_offs_t  ds_offs,
l4_uint32_t  flags 
)

Attach dataspace to specified region in area.

Parameters:
ds Dataspace id
area Area id, set to L4RM_DEFAULT_REGION_AREA to use default area (i.e. an area not reserved)
addr Start address
size Size
ds_offs Offset in dataspace
flags Flags
Returns:
0 on success (dataspace attached to region at addr), error code otherwise:
  • -L4_EINVAL invalid map region or area id
  • -L4_ENOMEM out of memory allocating descriptors
  • -L4_ENOMAP no region found

L4_CV L4_INLINE int l4rm_direct_area_setup_region ( l4_addr_t  addr,
l4_size_t  size,
l4_uint32_t  area,
int  type,
l4_uint32_t  flags,
l4_threadid_t  pager 
)

Setup VM area.

Parameters:
addr Region start address
size Region size
area Area id
type Region type:
flags Flags:
pager External pager (if type is L4RM_REGION_PAGER)
Returns:
0 on success (setup region), error code otherwise:
  • -L4_ENOTFOUND no suitable address area found
  • -L4_ENOMEM out of memory allocation region descriptor
  • -L4_EUSED address region already used
  • -L4_EINVAL invalid area / type

L4_CV L4_INLINE int l4rm_direct_area_reserve ( l4_size_t  size,
l4_uint32_t  flags,
l4_addr_t *  addr,
l4_uint32_t *  area 
)

Reserve area.

Parameters:
size Area size
flags Flags
Return values:
addr Start address
area Area id
Returns:
0 on success (reserved area at addr), error code otherwise:
  • -L4_ENOTFOUND no free area of size size found
  • -L4_ENOMEM out of memory allocating descriptors

L4_CV L4_INLINE int l4rm_direct_area_reserve_region ( l4_addr_t  addr,
l4_size_t  size,
l4_uint32_t  flags,
l4_uint32_t *  area 
)

Reserve specified area.

Parameters:
addr Address
size Area Size
flags Flags
Return values:
area Area id
Returns:
0 on success (reserved area at addr), error code otherwise:
  • -L4_EUSED specified are aalready used
  • -L4_ENOMEM out of memory allocating descriptors


L4 Region Mapper Reference Manual, written by Lars Reuther  © 2000-2003