Specifications

Writing Device-Driver Tables
4.3 Function Decision Table
Table 4–1 (Cont.) I/O Function Codes
Function Description Equivalent Symbols
Virtual I/O
IO$_TTYREADPALL† Terminal read with prompt
passall
IO$_CONINTREAD Connect to interrupt read-only
IO$_CONINTWRITE Connect to interrupt with write
†Unsupported; subject to change without notice
4.3.1.1 Defining Device-Specific Function Codes
You can also define device-specific function codes by equating the name of a
device-specific function with the name of an existing function that is irrelevant to
the device. The selected codes should, however, have a type (logical, physical, or
virtual) that is appropriate for the function they represent. Also, user programs
that issue $QIO requests specifying a device-specific code must similarly redefine
the existing function. For example, the assembly code that follows defines three
device-specific physical I/O function codes.
IO$_STARTCLOCK=IO$_ERASETAPE ; Start interval clock
IO$_STOPCLOCK=IO$_OFFSET ; Stop interval clock
IO$_STARTDATA=IO$_SPACEFILE ; Start data acquisition
4.4 Building Driver Tables Using C
The C language does not contain the powerful macro facilities that are available
in BLISS and VAX MACRO. For this reason, OpenVMS AXP provides prototype
tables in object form and uses run time initialization routines to override
the default table values provided by the object module. This approach
allows OpenVMS AXP to allocate the tables and assign default values using
VAX MACRO or BLISS, while at the same time allowing the user-provided
portions of a driver to be written entirely in C.
The prototype tables are contained in the object module IOC$DRIVER_
TABLES.OBJ, which resides in the object library VMS$VOLATILE_
PRIVATE_INTERFACES.OLB in SYS$LIBRARY. This object library is
included by the driver link procedure.
To override default values in the prototype tables, the driver writer must
code an initialization routine driver$init_tables, which is called by the driver
loader with no explicit input parameters and which returns an integer status
code. Implicit input parameters are the prototype DDT, DPT, and FDT tables
whose global names are driver$ddt, driver$dpt, and driver$fdt respectively.
Table initialization functions and macros are provided to assist the driver
writer in coding driver$init_tables. These are listed below in the sections on
each table. The initialization functions are driver$ini_<table><parameter>.
$ini_table_parameter where <table> may be DDT, DPT or FDT and
<parameter> is the parameter name as it exists in the VAX MACRO
initialization macros. The function prototypes and macros are available by
#include <vms_drivers.h>. This means that the parameter names are the
same in MACRO, BLISS and C and can be documented in common.
4–9