NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ERRORS | RESTRICTIONS | ATTRIBUTES | SEE ALSO
#include <mem/chMem.h>int rgnInit(KnCap *actorcap, KnRgnDesc *rgndesc, KnObjDesc *segdesc);
MEM_VM
This system call is strictly reserved for internal use only. It MUST NOT be used by any application.
The rgnInit call creates a region in the address space of the target actor and maps a volatile copy of a segment range to the region. The target actor is specified by actorcap - a pointer to the target actor capability. If actorcap is K_MYACTOR, the address space of the current actor is used. If actorcap is K_SVACTOR, the region is allocated in the supervisor address space and isn't attached to any particular supervisor actor; it cannot therefore be implicitly deallocated by an actorDelete(2K) of a supervisor actor.
The rgndesc pointer points to a KnRgnDesc structure containing the specification of the region to be created, as described in rgnAllocate (2K).
The segdesc pointer points to a KnObjDesc structure containing the source data specification. The KnObjDesc fields are as follows:
KnCap dataObject ; VmOffset startOffset ; VmSize size ; |
The dataObject field definesthe capability of the source segment.
The startOffset defines the starting offset of the data in the segment. Its value must be aligned to a virtual page boundary.
The size field defines the size of the data.
The caller can specify any of the rgndesc->options as described in rgnAllocate (2K), except that the K_RESERVED flag is prohibited. The K_FILLZERO option is also interpreted differently here: only the range from rgndesc->startAddr + segdesc->size to rgndesc->startAddr + rgndesc->size - 1 will be zero-filled.
The kernel uses the standard Chorus-IPC based kernel-mapper protocol (see MpPullIn(2SEG), MpGetAccess(2SEG)) to read the current state of the segment prior to copying it to newly allocated volatile memory, and mapping the memory to the region created. The kernel implementation can defer the effective data reading and copy.
If successful K_OK is returned, otherwise a negative error code is returned.
Some of the arguements provided are outside the caller's address space.
An inconsistent actor capability was provided.
actorcap does not specify a reachable actor.
rgndesc->startAddr is not page-aligned.
segdesc->startOffset 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).
rgndesc->size is zero.
Attempted to map a segment outside its valid offset range as returned by vmStat(2K).
segdesc->size is greater than rgndesc->size.
The K_ANYWHERE option was specified and there is insufficient room available in the address space to create the region.
The K_RESTRICTIVE option was specified and there is insufficient room in the target address range.
the region created overlaps an existing region.
The system is out of resources.
The segment mapper doesn't respect the kernel/mapper protocol.
The target 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