Specifications

Operating System Routines
EXE$MODIFYLOCK, EXE$MODIFYLOCKR
EXE$MODIFYLOCK calls EXE$MODIFYLOCKR.
EXE$MODIFYLOCKR calls EXE$READCHKR, which performs the following
tasks:
Moves the transfer byte count into IRP$L_BCNT. If the byte count is negative,
it returns SS$_BADPARAM status to EXE$MODIFYLOCKR.
Determines if the specified buffer is write accessible for a read I/O function,
with one of the following results:
If the buffer allows write access, EXE$READCHKR sets IRP$V_FUNC in
IRP$W_STS and returns SS$_NORMAL to EXE$MODIFYLOCKR.
If the buffer does not allow write access, EXE$READCHKR returns SS$_
ACCVIO status to EXE$MODIFYLOCKR.
If EXE$READCHKR succeeds, EXE$MODIFYLOCKR moves into IRP$W_BOFF
the byte offset to the start of the buffer and calls MMG$IOLOCK, disabling a
paging mechanism used in write-only operations. MMG$IOLOCK attempts to
lock into memory those pages that contain the buffer, with one of the following
results:
2
If MMG$IOLOCK succeeds, EXE$MODIFYLOCKR stores in IRP$L_SVAPTE
the system virtual address of the process PTE that maps the first page of the
buffer, and returns success status to its caller.
If MMG$IOLOCK fails, it returns SS$_ACCVIO, SS$_INSFWSL, or page
fault status to EXE$MODIFYLOCKR.
If the initial call was to EXE$MODIFYLOCK and either EXE$READCHKR
or MMG$IOLOCK returns an error status other than a page fault condition,
EXE$MODIFYLOCKR calls EXE$ABORTIO. In the event of a page fault,
EXE$MODIFYLOCKR adjusts direct I/O count and AST count to the values they
held before the I/O request, deallocates the IRP, and restarts the I/O request at
the $QIO system service. This procedure is carried out so that the user process
can receive ASTs while it waits for the page fault to complete. Once the page is
faulted into memory, the $QIO system service will resubmit the I/O request.
If the initial call was to EXE$MODIFYLOCKR and an error occurs,
EXE$MODIFYLOCKR, by means of a coroutine call, returns control to the
driver’s FDT routine with status in R0. The driver performs whatever device-
specific actions are required to abort the request, preserving the contents of
R0 and R1. When the driver issues the RSB instruction, control is returned to
EXE$MODIFYLOCKR. EXE$MODIFYLOCKR proceeds to abort or resubmit the
I/O request.
Otherwise, these routines return success status to their callers.
2
For read requests, MMG$IOLOCK performs an optimization for any nonvalid page
contained within the buffer. It creates a demand-zero page rather than fault into
memory the requested page. However, if the buffer extends to more than one page, this
optimization is not possible.
3–41