Specifications

Operating System Routines
MMG$UNLOCK
MMG$UNLOCK
Unlocks process pages previously locked for a direct-I/O operation.
Module
IOLOCK
Input
Location Contents
R1 Number of buffer pages to unlock
R3 System virtual address of PTE for the first buffer
page
Output
None.
Synchronization
Because MMG$UNLOCK raises IPL to IPL$_SYNCH, and obtains the MMG
spinlock in a multiprocessing environment, its caller cannot be executing above
IPL$_SYNCH or hold any higher ranked spinlocks. MMG$UNLOCK returns
control to its caller at the caller’s IPL. The caller retains any spinlocks it held at
the time of the call.
Description
Drivers rarely use MMG$UNLOCK. At the completion of a direct-I/O transfer,
IOC$IOPOST automatically unlocks the pages of both the user buffer and any
additional buffers specified in region 1 (if defined) and region 2 (if defined) for all
the IRPEs linked to the packet undergoing completion processing.
However, driver FDT routines do use MMG$UNLOCK when an attempt to
lock IRPE buffers for a direct-I/O transfer fails. The buffer-locking routines
called by such a driver—EXE$READLOCKR, EXE$WRITELOCKR, and
EXE$MODIFYLOCKR—all perform coroutine calls back to the driver if
an error occurs. When called as a coroutine, the driver must unlock all
previously locked regions using MMG$UNLOCK, and deallocate the IRPE
(using EXE$DEANONPAGED), before returning to the buffer-locking routine.
3–148