Specifications

System Macros Invoked by Drivers
DEVICELOCK
DEVICELOCK
Achieves synchronized access to a device’s database as appropriate to the
processing environment.
Format
DEVICELOCK [lockaddr] [,lockipl] [,savipl] [,condition] [,preserve=YES]
Parameters
[lockaddr]
Address of the device lock to be obtained. If lockaddr is not present,
DEVICELOCK presumes that R5 contains the address of the UCB and uses
the value at UCB$L_DLCK(R5) as the lock address.
[lockipl]
Location containing the IPL at which the device database is synchronized. In a
uniprocessing environment, the DEVICELOCK macro sets IPL to the specified
lockipl;ifnolockipl is specified, it obtains the synchronization IPL from the
device lock’s data structure. In a multiprocessing environment, the system
routine called by DEVICELOCK raises IPL to the IPL value contained in the
device lock’s data structure, regardless of whether the lockipl argument is
present.
Digital recommends that you specify a lockipl value to facilitate debugging.
[savipl]
Location at which to save the current IPL.
[condition]
Indication of a special use of the macro. The only defined condition is
NOSETIPL, which causes the macro to omit setting IPL. In some instances,
setting IPL is undesirable or unnecessary when a driver obtains a device lock.
For example, when an interrupt service routine issues the DEVICELOCK macro,
the dispatching of the device interrupt has already raised IPL to device 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.
Description
In a uniprocessing environment, the DEVICELOCK macro raises IPL to lockipl
(if condition=NOSETIPL is not specified).
In a multiprocessing environment, the DEVICELOCK macro performs the
following actions:
Preserves R0 through the macro call (if preserve=YES is specified).
Stores the address of the device lock in R0.
2–17