Specifications

Writing Device-Driver Tables
4.1 Driver Prologue Table
UCB$B_DEVCLASS Device class
UCB$B_DEVTYPE Device type
UCB$W_DEVBUFSIZ Default buffer size
UCB$Q_DEVDEPEND Device-dependent parameters
A driver invokes the DPT_STORE macro once, specifying the REINIT
keyword, to automatically generate a driver I/O database reinitialization
routine. This routine, which executes when the driver is first loaded into the
system, and whenever the driver is reloaded, initializes those fields specified
by the series of DPT_STORE and DPT_STORE_ISR macros that intervene
between the DPT_STORE REINIT and DPT_STORE END declarations.
Drivers use the DPT_STORE macro with the REINIT table marker label to
begin a list of DPT_STORE and DPT_STORE_ISR invocations that supply
initialization and reinitialization data. The following fields are declared with
the DPT_STORE_ISR macro:
CRB$L_INTD Interrupt service routine
CRB$L_INTD2 Interrupt service routine for second interrupt vector
A driver invokes the DPT_STORE macro once, specifying the END keyword,
to denote the end of the reinitialization section.
For additional information on how to use the DPTAB, DPT_STORE, and DPT_
STORE_ISR macros, plus an example of their usage, see OpenVMS AXP Device
Support: Reference.
4.2 Driver Dispatch Table
The driver dispatch table (DDT) identifies those driver routines that the operating
system calls to process I/O requests. Every driver must create a DDT.
The routines listed in the DDT can reside in the driver module or in a system
module. Device-dependent routines are normally located in the driver module.
For more information about the system device-independent routines that can be
specified, see the Systems Routines section of OpenVMS AXP Device Support:
Reference.
The driver creates a DDT by invoking the macro DDTAB. The DDTAB macro
generates a DDT named devnam$DDT, according to the value you supply in
devnam macro argument. It invokes the DRIVER_DATA macro to place the
DDT within the the drivers data program section ($$$110_DATA).
When the driver is loaded into memory, OpenVMS writes the address of its DDT
into DDB$L_DDT.
You must specify the address of the drivers function decision table (FDT) in the
functb argument of the DDTAB macro. Several optional arguments allow you to
specify the names of the following routines, if applicable:
Start-I/O routine
Controller initialization routine
Cancel-I/O routine
Register dumping routine
Unit initialization routine
Alternate start-I/O routine
4–3