NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES | SEE ALSO
#include <mem/chMem.h>int lcTrunc(KnObjDesc *lcdesc, VmOffset zerooffset, VmFlags flags, unsigned long ordernb);
MEM_VM
This system call is strictly reserved for internal use only. It MUST NOT be used by any application.
The lcTrunc function grants write access to the [lcdesc->startOffset, lcdesc->startOffset + lcdesc->size)] range and recalls all access rights from the [lcdesc->startOffset + lcdesc->size, K_MAXVMOFFSET] range of the local cache specified by the lcdesc->dataObject capability.
Then, lcTrunc caches the [lcdesc->startOffset, zerooffset) range in the local cache and zeros the [zerooffset, lcdesc->startOffset + lcdesc->size) range (if not empty, in other words, zerooffset == lcdesc->startOffset + lcdesc->size).
Finally, lcTrunc marks the [lcdesc->startOffset, lcdesc->startOffset + lcdesc->size) range as modified.
If lcdesc->size is equal to zero the lcTrunc call simply invalidates the [lcdesc->startOffset, K_MAXVMOFFSET] range.
Both lcdesc->startOffset and lcdesc->size must be fragment-aligned. The size of the fragment is implementation-dependent and usually equal to the virtual page size divided by 8 (number of bits in one byte).
If the K_ORDERED flag is set in the flags argument, the ordinalNumber argument specifies the lcTrunc message order number. It allows the kernel to detect the situation when two mesages sent by a mapper in one order are received by the kernel in another. For instance, if the mapper grants certain access rights in a MpGetAccess reply first, then, processing another request, calls an lcTrunc to recall the access rights, using the order numbers, the kernel is aware that the access returned by the MpGetAccess reply was already recalled by the mapper, and performs another MpGetAccess request.
The lcTrunc operation cannot be blocked by either a pure MpGetAccess or by an impure (combined with a MpGetAccess) MpPullIn up-call.
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 local cache capability was provided.
lcdesc->dataObject does not specify a reachable local cache.
lcdesc->startOffset or lcdesc->size isn't fragment-aligned.
Tried to truncate a segment outside the valid offset range in a segment, as returned by vmStat.
zeroofset is out of [lcdesc->startOffset, lcdesc->startOffset + lcdesc->size] range.
The flags argument contains invalid flag values.
Tried to invalidate or destroy a no-demand (mapped to a region with the K_NODEMAND attribute) physical memory.
An ipcCall transaction failed during the remote lcTrunc.
The mapper doesn't respect the vm/mapper protocol.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES | SEE ALSO