NAME | SYNOPSIS | FEATURES | DESCRIPTION | RESTRICTIONS | RETURN VALUE | ERRORS | ATTRIBUTES | SEE ALSO
#include <mem/chMem.h>void PxmGetAcc(KnPxmGetAccArgs *getArg, void *cookie);
PXM_EXT
This system call is strictly reserved for internal use only. It MUST NOT be used by any application.
The PxmGetAcc routine is provided by the Proxy-Mapper and is invoked as an up-call by the CHORUS VM. It is invoked as a lap; its second argument is the lap cookie as defined at svLapCreate time. The PxmGetAcc up-call is invoked by the VM in order to obtain access rights needed to perform an operation on the data cache.
The KnPxmGetAccArgs data structure has the following members:
KnDtPxMapper* pxm ; KnSgId sgId ; KnPxmAcc* accParms ; KnPage* page ; VmSize* size ; |
The pxm field is a pointer to the KnExtPxMapper structure previously defined by a call to dcPxmDeclare and associated with the data segment defined by the sgId member of the structure at dcAlloc time.
The access rights are specified by the data structure pointed to by the accParms field. The KnPxmAcc structure contains the following fields:
KnPxmAccReq req ; KnPxmAccRep rep ; void* lock ; |
The req field describes the access rights requested by the VM, while the rep field is filled by the Proxy-Mapper to define the actual access rights returned to the VM. The KnPxmAccReq structure contains the following members:
VmFlags access ; VmOffset start ; VmOffset end ; VmOffset reqStart ; VmOffset reqEnd ; |
The access field specifies the access rights, and may be set to either K_READABLE or K_WRITABLE. When set to K_READABLE, the corresponding data will be read--only by the VM. If set to K_WRITABLE, the corresponding data may be modified by the VM. In such a case, the Proxy-Mapper should insure that backing store (if needed) will be available when data is to be pushed out. The start and end fields specify the access range desired, the reqStart and reqEnd specify the access range required.
The KnPxmAccRep structure contains the following members:
VmFlags access ; VmOffset start ; VmOffset end ; int diag ; |
where the access field specifies the access rights returned by the Proxy-Mapper to the VM (either K_READABLE or K_WRITABLE). The start and end fields specify the range of bytes for which the Proxy-Mapper grants access rights to the VM as a result of the PxmGetAcc up-call. The diag field contains the diagnostic returned by the Proxy-Mapper to the VM. If set to K_OK, the up-call has been successful and the fields returned are meaningful, otherwise it is set to the appropriate error code. If the error code returned is K_EBUSY, the VM will invoke the PxmGetAcc up-call again.
The Proxy-Mapper could grant write access in response to a read-only access request, but it must grant write access in response to a write access request. The Proxy-Mapper must guarantee that the [rep.start, rep.end] range is included in the [req.start, req.end] range, but also includes the [req.reqStart, req.reqEnd] range. . The rep.start and rep.end+1 values must be fragment-aligned.
The VM may request data at the same time as access rights. In this case, the page argument specifies the list of pages which should be read from the data segment. The page field points to a KnPage structure which specifies the first page of the list. The KnPage structure has the following members:
struct KnPage* next ; void* work ; |
The Proxy-Mapper must set the size output field to the size of valid data (from the beginning of the page list). If no data are requested, the page is NULL and the Proxy-Mapper must not refer to the size field. The KnPage structure is the physical page descriptor exported by the VM. The next field points to the next page of the list and is set to NULL for the last page of the list. The work field is not used by the VM while the page is owned by the Proxy-Mapper, it may be used by the Proxy-Mapper while it owns the page.
There are two VM operations which can invoke the PxmGetAcc up-call:
dcRead/dcWrite invocations
A page fault on a region created by rgnMapFromDtCache.
In the case of dcRead or dcWrite, the lock field contains the accLock argument of the dcRead/dcWrite call. Thus, the lock field is an input argument when PxmGetAcc is called as a result of dcRead or dcWrite.
In the case of a page fault, the lock field is set to NULL and the K_PAGEFAULT bit is set in the req.access field. If the PxmGetAcc is performed successfully, the VM invokes the PxmRelAccLock up-call passing the value of the lock field as an arguemtn. This value is returned to the VM by the Proxy-Mapper at the completion of the PxmGetAcc up-call. Thus, in the case of page fault, the lock field is an input/output argument of the PxmGetAcc up-call. Note that the relAccLock up-call is never invoked as a result of a dcRead or dcWrite nucleus call.
The pages of the getArg->page list are conditionally attached to the data cache. It means that they are not visible to dcFlush and therefore dcFlush cannot be blocked on them. If dcFillZero or dcTrunc find a conditionally attached page (which must be filled) they perform the following actions:
Detach this page from the data cache
Allocate a new physical page and attach it to the data cache
Invoke the PxmPullIn up-call to read data from the data segment, if needed
Fill the appropriate part of the page with zero, if needed
Once access rights are obtained, the VM attaches the pages to the data cache fully (they become visible to dcFlush ) and invokes the PxmRrelAccLock up-call(if needed, for example in the case of a page fault). Note that, in the case of a pure PxmGetAcc, the getArg->page is NULL The PxmRelAccLock up-call is invoked when the access rights of the page have already been upgraded.
The current implementation is done only for trusted supervisor actors.
None.
none
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
dcPxmDeclare(2SEG), dcAlloc(2SEG), svLapCreate(2K), lapInvoke(2K), pageMap(2SEG), dcRead(2SEG), dcWrite(2SEG), rgnMapFromDtCache(2SEG), PxmRelAccLock(2SEG)
NAME | SYNOPSIS | FEATURES | DESCRIPTION | RESTRICTIONS | RETURN VALUE | ERRORS | ATTRIBUTES | SEE ALSO