Specifications

System Macros Invoked by Drivers
FORKLOCK
FORKLOCK
Achieves synchronized access to a device driver’s fork database as appropriate to
the processing environment.
Format
FORKLOCK [lock] [,lockipl] [,savipl] [,preserve=YES] [,pl=NO]
Parameters
[lock]
Index of the fork lock to be obtained. If the lock argument is not present in the
macro invocation, FORKLOCK presumes that R5 contains the address of the fork
block and uses the value at FKB$B_FLCK(R5) as the lock index.
[lockipl]
Location containing the IPL at which the fork database is synchronized. Although
the value of this argument is ignored by the macro, Digital recommends that you
specify a lockipl value to facilitate debugging.
[savipl]
Location at which to save the current IPL.
[preserve=YES]
Indication that the macro should preserve R0 across the invocation. If you do not
need to retain the contents of R0, specifying preserve=NO can enhance system
performance.
[fipl=NO]
Indication that the macro does not need to determine whether the contents of
the lock argument or FKB$B_FLCK(R5) is a fork lock index or a fork IPL. The
FORKLOCK macro ignores the contents of this argument in a multiprocessing
environment.
The system fork dispatcher uses fipl=YES to determine whether a fork block
it is servicing contains a fork lock index or a fork IPL. Because a device driver
initializes offset UCB$B_FLCK (also known as UCB$B_FIPL) in the fork block, it
does not need to determine its contents when it issues a FORKLOCK macro.
Description
In a uniprocessing environment, the FORKLOCK macro raises IPL according to
one of the following methods:
It sets IPL to the IPL that corresponds to the fork lock index in the spinlock
IPL vector (SMP$AR_IPLVEC).
If you specify fipl=YES, the FORKLOCK macro takes the following actions:
If offset FKB$B_FLCK (FKB$B_FIPL) contains a fork lock index, it sets
IPL to the IPL that corresponds to the fork lock index in the spinlock IPL
vector (SMP$AR_IPLVEC).
If offset FKB$B_FLCK (FKB$B_FIPL) contains a fork IPL, it sets IPL to
that fork IPL.
2–34