Specifications
Operating System Routines
EXE$READ
Description
A driver uses EXE$READ as an FDT routine when the driver must write to the
user-specified buffer. Because EXE$READ transfers control to EXE$QIODRVPKT
if its operations are successful or EXE$ABORTIO if they are not, it must be the
last FDT routine called to perform the preprocessing of read I/O requests. A
driver cannot use EXE$READ for buffered-I/O operations.
EXE$READ performs the following functions:
• Sets IRP$V_FUNC in IRP$W_STS to indicate a read function
• Writes the p4 argument of the $QIO request into IRP$L_IOST2 (IRP$B_
CARCON).
• Translates a logical read function to a physical read function.
• Examines the size of the transfer, as specified in the p2 argument of the $QIO
request, and takes one of the following actions:
If the transfer byte count is zero, EXE$READ transfers control to
EXE$QIODRVPKT to deliver the IRP to the driver’s start-I/O routine.
The driver start-I/O routine should check for zero-length buffers to avoid
mapping them to UNIBUS, Q22–bus, MASSBUS, or VAXBI node space.
An attempted mapping can cause a system failure.
If the byte count is not zero, EXE$READ loads the byte count and the
starting address of the transfer into R1 and R0, respectively, and calls
EXE$READLOCK.
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:
3
• 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 control to EXE$READ. EXE$READ transfers control to
EXE$QIODRVPKT to deliver the IRP to the driver’s start-I/O routine.
3
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–48