Specifications
Device Driver Entry Points
Unit Initialization Routine
Unit Initialization Routine
Prepares a device for operation and, in the case of a device on a dedicated
controller, initializes the controller.
Specified in
You can specify a unit initialization routine in two ways, either of which will
suffice for all but a few specific devices.
• Specify the address of the unit initialization routine unitinit argument of the
DDTAB macro. This macro places the address of the routine into DDT$L_
UNITINIT. MASSBUS device drivers must use this method.
• Use the DPT_STORE macro to place the address of the unit initialization
routine into CRB$L_INTD+VEC$L_UNITINIT.
Called by
The System Generation utility (SYSGEN) calls a driver’s unit initialization
routine when processing a CONNECT command. The operating system calls a
unit initialization routine when the device, the controller, the processor, or the
adapter to which the device is connected undergoes power failure recovery.
Synchronization
The operating system calls a unit initialization routine at IPL$_POWER. If
it must lower IPL, the controller initialization routine cannot explicitly do so.
Rather, it must fork. Because SYSGEN calls the unit initialization routine
immediately after the controller initialization returns control to it, the driver’s
initialization routines must synchronize their activities. If the controller
initialization routine forks, the unit initialization routine must be prepared
to execute before the controller initialization routine completes.
The portion of the unit initialization that services power failure cannot acquire
any spinlocks. As a result, the routine cannot fork to perform power failure
servicing.
Context
Because the operating system calls it in system context, a unit initialization
routine can only refer to those virtual addresses that reside in system (S0) space.
Register usage
A unit initialization routine must preserve the contents of all registers except R0,
R1, and R2.
4–23