Specifications
Writing FDT Routines
5.2 Upper-Level FDT Action Routines
Table 5–2 (Cont.) FDT Completion Macros and Associated Routines
Macro Operation
CALL_
QIODRVPKT
Calls EXE_STD$QIODRVPKT to transfer control to a system
routine (EXE_STD$INSIOQ) that either delivers an IRP
immediately to a driver’s start-I/O routine or places the IRP in
a pending-I/O queue waiting for driver servicing. The FDT routine
uses this FDT completion routine if all preprocessing is complete,
if no errors are found in the specification of an I/O request, and
if device activity, synchronized access to the device’s UCB, or
synchronized access to device registers is required to complete
the I/O request. Common examples of such a request are read and
write functions.
EXE_STD$INSIOQ transfers control to the device driver’s start-I/O
routine only if the device unit is currently idle. If the device unit
is busy, EXE_STD$INSIOQ inserts the IRP in a priority-ordered
queue of IRPs waiting for the unit.
Once an FDT routine transfers control to EXE_STD$QIODRVPKT,
no driver code that further processes the I/O request can refer to
process virtual address space. When a device driver’s start-I/O
routine gains control, the process that queued the I/O request
might no longer be the mapped process. Therefore, the driver must
assume that all information regarding the I/O request is in the
UCB or the IRP and that all buffer addresses in the UCB are either
system addresses or page-frame numbers that can be interpreted in
any process context.
For direct I/O operations, FDT routines also must have locked
all user buffer pages in physical memory because paging cannot
occur at driver fork level or higher interrupt priority levels. The
process virtual address space is not guaranteed to be mapped
again until the operating system delivers a special kernel-mode
asynchronous system trap (AST) to the requesting process as part of
I/O postprocessing.
5.3 FDT Routines for System Direct I/O
The operating system provides two standard FDT routines that are applicable
for direct I/O operations: EXE_STD$READ and EXE_STD$WRITE. When
called by the driver, these routines completely prepare a direct I/O read or write
request. Thus, a driver that uses these routines eliminates the need for its own
device-specific FDT routines.
EXE_STD$READ and EXE_STD$WRITE are described in OpenVMS AXP Device
Support: Reference.
5.4 FDT Routines for System Buffered I/O
Device drivers for buffered I/O operations generally contain their own device-
specific FDT routines.
An FDT routine for a buffered I/O data transfer operation should confirm either
read or write access to the user’s buffer and allocate a buffer in system space.
Sections 5.4.1 and 5.4.2 describe these tasks.
An FDT routine for a buffered I/O operation that does not involve data transfer
accesses the function-dependent parameters of the $QIO request (p1 to p6) from
IRP$L_QIO_Pn, where n is a parameter number from one to six. It performs any
necessary preprocessing and uses one of the exit methods listed in Section 5.2.2.
5–7










