Specifications

Operating System Routines
EXE$READLOCK, EXE$READLOCKR
EXE$READLOCK calls EXE$READLOCKR.
EXE$READLOCKR 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$READLOCKR.
Determines whether 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$READLOCKR.
If the buffer does not allow write access, EXE$READCHKR returns SS$_
ACCVIO status to EXE$READLOCKR.
If EXE$READCHKR succeeds, EXE$READLOCKR moves into IRP$W_BOFF the
byte offset to the start of the buffer and calls MMG$IOLOCK. MMG$IOLOCK
attempts to lock into memory those pages that contain the buffer, with one of the
following results:
4
If MMG$IOLOCK succeeds, EXE$READLOCKR 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$READLOCKR.
If the initial call was to EXE$READLOCK and either EXE$READCHKR or
MMG$IOLOCK returns an error status other than a page fault condition,
EXE$READLOCKR transfers control to EXE$ABORTIO. In the event of a page
fault, EXE$READLOCKR 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$READLOCKR and an error occurs,
EXE$READLOCKR, 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$READLOCKR. EXE$READLOCKR proceeds to abort or resubmit the I/O
request.
Otherwise, these routines return success status to their callers.
4
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–53