Specifications

Operating System Routines
EXE$WRITELOCK, EXE$WRITELOCKR
EXE$WRITELOCK calls EXE$WRITELOCKR.
EXE$WRITELOCKR calls EXE$WRITECHKR, 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$WRITELOCKR.
Determines if the specified buffer is write accessible for a write I/O function,
with one of the following results:
If the buffer allows read access, EXE$WRITECHKR returns SS$_
NORMAL to EXE$WRITELOCKR.
If the buffer does not allow read access, EXE$WRITECHKR returns
SS$_ACCVIO status to EXE$WRITELOCKR.
If EXE$WRITECHKR succeeds, EXE$WRITELOCKR 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:
If MMG$IOLOCK succeeds, EXE$WRITELOCKR 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$WRITELOCKR.
If the initial call was to EXE$WRITELOCK and either EXE$WRITECHKR
or MMG$IOLOCK returns an error status other than a page fault condition,
EXE$WRITELOCKR transfers control to EXE$ABORTIO. In the event of a page
fault, EXE$WRITELOCKR 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$WRITELOCKR and an error occurs,
EXE$WRITELOCKR, 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$WRITELOCKR. EXE$WRITELOCKR proceeds to abort the I/O request.
Otherwise, these routines return success status to their callers.
3–66