#include <mem/chMem.h>int rgnMapFromActor(KnCap *tgtactorcap, KnRgnDesc *tgtrgndesc, KnCap *srcactorcap, KnRgnDesc *srcrgndesc);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
MEM_FLAT, MEM_PROTECTED, MEM_VIRTUAL
The rgnMapFromActor() system call creates regions in a contiguous address range of the target actor address space. It then maps the segments or volatile memory already mapped to an address range of the source actor address space to the newly created regions.
The target and source actors are specified by tgtactorcap and srcactorcap, which are pointers to the capabilities of the target and source actors, respectively. If srcactorcap or tgtactorcap is -K_MYACTOR, the address space of the current actor is used. If tgtactorcap is -K_SVACTOR, the regions are allocated in the supervisor address space and are not attached to any particular supervisor actor. They cannot therefore be implicitly deallocated by performing an actorDelete(2K) call on a supervisor actor.
The tgtrgndesc pointer points to a KnRgnDesc structure containing the specification for the target address range and the attributes (options) for the regions to be created. This is the same as described in rgnAllocate(2K), except that -K_FILLZERO is ignored and the -K_RESERVED option is prohibited. All regions in the target address range are created with the same attributes, and are differentiated by the objects -- particular segments or particular volatile memory -- mapped to them.
The srcrgndesc pointer points to another KnRgnDesc structure, where only the startAddr field is significant. This field specifies the starting address of the source address range. The starting address must be aligned on a virtual page boundary. The size of the source address range is equal to the size of the target address range.
If successful, K_OK is returned. Otherwise a negative error code is returned.
Some of the arguments provided are outside the caller's address space.
An inconsistent actor capability was given.
srcactorcap or tgtactorcap does not specify a reachable actor.
tgtrgndesc->startAddr is not page-aligned. This error code is never returned with the FLAT memory model.
srcrgndesc->startAddr is not page-aligned. This error code is never returned with the FLAT memory model.
An attempt was made to create a region outside the valid range for the address space of an actor returned by vmStat(2K).
tgtrgndesc->size is 0.
The -K_ANYWHERE option was specified and there is not enough room available in the address space to create the regions.
The -K_RESTRICTIVE option was specified and there is not enough room in the target address range.
The regions created overlap with an existing region.
The source region is outside the valid range for the address space of an actor returned by vmStat(2K).
One of the following options is wrong: -K_WRITABLE, -K_READABLE, -K_EXECUTABLE.
srcrgndesc->size is -0.
The source address range contains holes.
The system is out of resources.
A segment mapper does not respect the microkernel/mapper protocol.
A segment mapper has detected a mapper-level error.
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|