Specifications
System Macros Invoked by Drivers
FORKUNLOCK
FORKUNLOCK
Relinquishes synchronized access to a device driver’s fork database as appropriate
to the processing environment.
Format
FORKUNLOCK [lock] [,newipl] [,condition] [,preserve=YES]
Parameters
[lock]
Index of the fork lock to be released or restored. If lock is not present,
FORKUNLOCK assumes that R5 contains the address of the fork block and
uses the value at FKB$B_FLCK(R5) as the fork lock index.
[newipl]
Location containing the IPL to which to lower. A prior invocation of the
FORKLOCK 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$RESTORE instead of SMP$RELEASE. This releases a single acquisition of
the fork lock 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 FORKUNLOCK 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 FORKUNLOCK macro performs the
following tasks:
• Preserves R0 through the macro call (if preserve=YES is specified).
• Stores the fork lock index in R0.
• Calls SMP$RELEASE or, if condition=RESTORE is specified,
SMP$RESTORE.
• 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 FORKUNLOCK macro sets the SMP-
modified bit in the driver prologue table (DPT$V_SMPMOD in DPT$L_FLAGS).
For an example of the use of the FORKUNLOCK macro, see the description of
the FORKLOCK macro.
2–36