Specifications
System Macros Invoked by Drivers
DEVICEUNLOCK
DEVICEUNLOCK
Relinquishes synchronized access to a device’s database as appropriate to the
processing environment.
Format
DEVICEUNLOCK [lockaddr] [,newipl] [,condition] [,preserve=YES]
Parameters
[lockaddr]
Address of the device lock to be released or restored. If lockaddr is not present,
DEVICEUNLOCK presumes that R5 contains the address of the UCB and uses
the value at UCB$L_DLCK(R5) as the lock address.
[newipl]
Location containing the IPL to which to lower. A prior invocation of the
DEVICELOCK macro may have stored this IPL value.
[condition]
Indication of a special use of the macro. The only defined condition is
RESTORE, which causes the macro—in a multiprocessing environment—to
call SMP$RESTOREL instead of SMP$RELEASEL. This releases a single
acquisition of the spinlock by the local processor.
[preserve=YES]
Indication that the macro should preserve R0 across an invocation. If you do not
need to retain the contents of R0, specifying preserve=NO can enhance system
performance.
Description
In a uniprocessing environment, the DEVICEUNLOCK macro lowers IPL to
newipl. If an interrupt is pending at the current IPL or at any IPL above
newipl, the current procedure is immediately interrupted.
In a multiprocessing environment, the DEVICEUNLOCK macro performs the
following tasks:
• Preserves R0 through the macro call (if preserve=YES is specified).
• Stores the address of the device lock in R0.
• Calls SMP$RELEASEL or, if condition=RESTORE is specified,
SMP$RESTOREL.
• Moves any specified newipl into the local processor’s IPL register (PR$_IPL).
If an interrupt is pending at the current IPL or at any IPL above newipl, the
current procedure is immediately interrupted.
In either processing environment, the DEVICELOCK macro sets the SMP-
modified bit in the driver prologue table (DPT$V_SMPMOD in DPT$L_FLAGS).
2–19