#include <mem/chMem.h>int rgnSetInherit(KnCap * actorcap, KnRgnDesc * rgndesc);
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.
These calls make it possible to change the attributes of all regions in the specified address range of the specified actor address space.
The rgnSetInherit() command replaces the values of the -K_INHERITCOPY and -K_INHERITSHARE attributes with the corresponding values from the options field of rgndesc .
The rgnSetPaging() command replaces the values of the -K_NODEMAND and -K_NOWAITFORMEMORY attributes with the corresponding values from the options field of rgndesc .
The rgnSetOpaque() command replaces the opaque values associated with the region with the new opaque values of rgndesc .
The actor is specified by actorcap , which is a pointer to the actor capability. If actorcap is -K_MYACTOR , the address space of the current actor is used. If actorcap is -K_SVACTOR , the supervisor address space is used.
The rgndesc pointer points to a KnRgnDesc structure which contains the specification of the address range and the new values of the attributes. Only the following members of the structure are used:
VmAddr startAddr ; VmSize size ; VmFlags options ; void* opaque1 ; VmFlags opaque2 ;
The startAddr field gives the start of the address range and the size field gives its size. rgndesc->startAddr must be aligned with a virtual page boundary (see vmPageSize(2K) ). If rgndesc->size is not page-aligned the microkernel rounds it up to the next virtual page boundary.
The options field gives the new attributes of the regions from the address range.
The address range can contain holes - sub-ranges without regions mapped to them.
If rgndesc->startAddr is inside a region, the implementation replaces the original region with two regions. The first region conserves the old attributes and terminates at rgndesc->startAddr - 1 . The second region takes the new attributes and starts immediately after the first one.
If rgndesc->startAddr + rgndesc->size is inside a region, the implementation replaces the original region with three regions. The first one conserves the old attributes and terminates at rgnDesc->startAddr - 1 . The second region takes the new attributes and terminates at rgndesc->startAddr + rgndesc->size - 1 . The third region conserves the old attributes and starts immediately after the second one.
An attribute modification can sometimes replace a number of consecutive regions with a single one.
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.
actorcap does not specify a reachable actor.
rgndesc->startAddr is not page-aligned.
The system is out of resources.
Some or all of the memory identified by the operation could not be locked when -K_NODEMAND and -K_NOWAITFORMEMORY had both been specified.
The segment mapper has detected a mapper-level error.
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|