Introduction   API Reference   Examples   Index  

Attach / Detach Dataspaces
[L4 Region Mapper Library API Reference]


Defines

#define L4RM_MAP   0x01000000
 Immediately map attached region.
#define L4RM_LOG2_ALIGNED   0x02000000
 Align to $2^{(log_2(size) + 1)}$ address.
#define L4RM_LOG2_ALLOC   0x04000000
 Allocate whole $2^{(log_2(size) + 1)}$ sized region.
#define L4RM_SUPERPAGE_ALIGNED   0x08000000
 Align to superpage size.

Functions

L4_CV L4_INLINE int l4rm_attach (const l4dm_dataspace_t *ds, l4_size_t size, l4_offs_t ds_offs, l4_uint32_t flags, void **addr)
 Attach dataspace.
L4_CV L4_INLINE int l4rm_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_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_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 int l4rm_detach (const void *addr)
 Detach dataspace.

Function Documentation

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

Attach dataspace.

Parameters:
ds Dataspace id
size Size
ds_offs Offset in dataspace
flags Flags:
Return values:
addr Start address
Returns:
0 on success (dataspace attached to region at address addr), error code otherwise:
  • -L4_EINVAL invalid dataspace id
  • -L4_ENOMEM out of memory allocating descriptors
  • -L4_ENOMAP no region found
  • -L4_EIPC error calling region mapper
Find an unused map region and attach dataspace area (ds_offs, ds_offs + size) to that region.

References L4RM_DEFAULT_REGION_AREA.

L4_CV L4_INLINE int l4rm_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 Start address, must be page aligned
size Size
ds_offs Offset in dataspace
flags Flags:
  • L4DM_RO attach read-only
  • L4DM_RW attach read/write
  • L4RM_MAP immediately map attached dataspace area
Returns:
0 on success (dataspace attached to region at addr), error code otherwise:
  • -L4_EINVAL invalid dataspace id
  • -L4_EUSED region already used
  • -L4_ENOMEM out of memory allocating descriptors
  • -L4_ENOMAP no region found
  • -L4_EIPC error calling region mapper
Attach dataspace to region at addr.

References L4RM_DEFAULT_REGION_AREA.

L4_CV L4_INLINE int l4rm_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
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 dataspace id
  • -L4_ENOMEM out of memory allocating descriptors
  • -L4_ENOMAP no region found
  • -L4_EIPC error calling region mapper
Attach dataspace to area area. An area is a region in the address space reserved by l4rm_area_reserve().

L4_CV L4_INLINE int l4rm_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
addr Start address, must be page aligned
size Size
ds_offs Offset in dataspace
flags Flags:
  • L4DM_RO attach read-only
  • L4DM_RW attach read/write
  • L4RM_MAP immediately map attached dataspace area
Returns:
0 on success (dataspace attached to region at addr), error code otherwise:
  • -L4_EINVAL invalid dataspace id
  • -L4_EUSED region already used
  • -L4_ENOMEM out of memory allocating descriptors
  • -L4_ENOMAP no region found
  • -L4_EIPC error calling region mapper
Attach dataspace to region at addr in area area.

L4_CV int l4rm_detach ( const void *  addr  ) 

Detach dataspace.

Parameters:
addr Address of VM area
Returns:
0 on success (dataspace detached from region id), error code otherwise:
  • -L4_EINVAL invalid region id
  • -L4_EIPC error calling region mapper
Detach dataspace which is attached to address addr.


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