Specifications
Writing Device-Driver Tables
4.4 Building Driver Tables Using C
• Initialization macros may be used as a labor-saving device. Each macro
invokes the corresponding function, checks the status it returns and to
returns to the driver loader if it encounters an error. The names of the
initializtion macros are ini_<table>_<parameter>.
• Table initialization code will be collected in a PSECT using a TBD pragma, so
that the space it occupies can be deallocated after initialization. This will not
be implemented until DECC provides PSECT control for code.
4.4.1 Driver Prologue Table
4.4.1.1 DPT Macros
The macros listed in Table 4–2 should be used in the
driver$init_tables
routine
to finish the initialization of the prototype Driver Prologue Table. These macros
invoke the appropriate initialization function and check the status returned from
the function. If an error is returned, the macro will return control back to the
driver loader with the error status.
The first parameter for all the DPT initialization macros is a pointer to the
driver’s DPT structure. Typically, this first parameter will be the address of the
prototype DPT.
The values shown in the last column of the table are the initial values that are
contained in the prototype DPT structure. These initial values can be changed by
using the corresponding macro.
Table 4–2 DPT Initialization Macros for C
Macro name Data type of second parameter Prototype value
ini_dpt_adapt integer AT$_UBA
ini_dpt_bt_order integer 0
ini_dpt_decode integer 0
ini_dpt_defunits integer 1
ini_dpt_deliver function pointer 0
ini_dpt_end
1
--
ini_dpt_flags integer DPT$M_SMPMOD
2
ini_dpt_idb_crams integer 0
ini_dpt_iohandles integer 0
ini_dpt_maxunits integer 8
ini_dpt_name string pointer -
ini_dpt_struc_init function pointer ioc$return
ini_dpt_struc_reinit function pointer ioc$return
ini_dpt_ucb_crams integer 0
ini_dpt_ucbsize integer 0
ini_dpt_unload function pointer 0
1
The
ini_dpt_end
macro should be used immediately after all the other DPT initialization macros
in the
driver$init_tables
routine.
2
The integer value specified with the
ini_dpt_flags
macro is logically-ORed with the default
value and any previously specified values.
(continued on next page)
4–10










