NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ERRORS | RESTRICTIONS | ATTRIBUTES | SEE ALSO
#include <mem/chMem.h>int rgnInitFromActor(KnCap *tgtactorcap, KnRgnDesc *tgtrgndesc, KnCap *srcactorcap, KnRgnDesc *srcrgndesc);
MEM_PROTECTED, MEM_VIRTUAL
The rgnInitFromActor function creates regions in a contiguous address range of the target actor address space. It then maps to these regions a copy of the segments and/or volatile memory which are already mapped to an address range of the source actor's address space.
The target and source actors are specified by tgtactorcap and srcactorcap - pointers to the capabilities of the target and source actors respectively. If srcactorcap and/or tgtactorcap is K_MYACTOR, the address space of the current actor is used as the source and/or the destination, respectively. If srcactorcap and/or tgtactorcap is K_SVACTOR, the supervisor address space is used as the source and/or the destination, respectively. Note that, if tgtactorcap is K_SVACTOR, the allocated regions aren't attached to any particular supervisor actor; therefore, they can't be implcitly deallocated by performing an actorDelete(2K) on a supervisor actor.
The tgtrgndesc field points to a KnRgnDesc structure containing the specification for the target address range and the attributes (options) for the regions to be created as described in rgnAllocate (2K).
The srcrgndesc field points to another KnRgnDesc structure where only the startAddr and size fields are significant. It specifies the source range starting address and size respectively. The srcrgndesc->size must to be less than or equal to tgtrgndesc->size. The source address range cannot contain holes: any address from the source address range has to belong to a region.
The caller can specify any of the tgtrgndesc->options as described in rgnAllocate (2K) apart from K_RESERVED, which is prohibited. Note that the K_FILLZERO option is interpreted differently here: only the range from tgtrgndesc->startAddr + srcrgndesc->size to tgtrgndesc->startAddr + tgtrgndesc->size - 1 will be zero-filled. All regions in the target address range will be created with the same attributes and will be differentiated by the objects (copies of particular segments or of particular volatile memory) mapped to them.
If successful K_OK is returned, otherwise a negative error code is returned.
Some of the provided arguments are outside the caller's address space.
An inconsistent actor capability was given.
actorcap does not specify a reachable actor.
tgtrgndesc->startAddr is not page-aligned.
srcrgndesc->startAddr is not page-aligned.
Tried to create a region outside the valid range for the address space of an actor as returned by vmStat(2K).
tgtrgndesc->size is zero.
The K_ANYWHERE option was specified and there is not sufficient room available in the address space to create the regions.
The K_RESTRICTIVE option was specified and there is not sufficient room in the target address range.
The regions created overlap an existing region.
The source region is outside the valid range for the address space of an actor as returned by vmStat(2K).
srcrgndesc->size is zero.
The source address range contains holes.
srcrgndesc->size is greater than tgtrgndesc->size.
The system is out of resources.
A segment mapper doesn't respect the kernel/mapper protocol.
The target actor, the source actor and the current actor must be located on the same site.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ERRORS | RESTRICTIONS | ATTRIBUTES | SEE ALSO