HP OpenVMS Systems Documentation
VMS DECwindows Device Driver Manual
|Type of Service||Symbol||Description|
|Class||COMMON_CTRL_INIT||Macro to relocate vector table|
|Class||COMMON_UNIT_INIT||Macro to set DDT to class DDT|
|Class||COMMON_POS_CURSOR||Routine to position cursor|
|Class||COMMON_SETUP_INPUT_UCB||Routine to set up input UCB|
|Output||COMMON_CTRL_INIT||Macro to relocate vector table|
|Output||COMMON_UNIT_INIT||Macro to set DDT to class DDT|
|Output||COMMON_SETUP_OUTPUT_UCB||Routine to set up output UCB|
|Output||COMMON_VSYNC||Routine to perform VSYNC timed functions|
|VMS||CONTROL_INIT||Controller initialization routine|
|VMS||UNIT_INIT||Unit initialization routine|
|VMS data||COMMON_DDT||Driver dispatch table|
|VMS data||COMMON_FLAGS||Common flag-bits data word|
|Type of Service||Mode||Description|
|VMS FDT||Input request||Routine for processing an X event|
|VMS FDT||Output request||Routine for buffered I/O output preprocessing|
|VMS FDT||Output request||Routine for direct I/O output preprocessing|
|$QIO||Sense||Routine for sense mode of device|
|$QIO||Set||Routine for set mode of device|
DECwindows routines in the common driver for class and output services are entered by means of a vector table. The common vector table is a data structure that allows a driver to find the appropriate service routine. Each entry name is a specific vector table offset (relative to the beginning of the common driver) that points to the common routine. Therefore, each name may be used as a symbolic offset into the table. The service routine symbolic addresses appear in the table as follows:
The common driver builds the vector table by invoking the $VECINI macro, the $VEC macro for each table entry, and the $VECEND macro that terminates the structure. A macro within the controller initialization routine relocates the table. The routines are described in this chapter and the macros in Appendix B.
Driver calls to these common vectored routines refer to symbolic offsets in the common vector table. When INDRIVER is loaded, DECW$GL_VECTOR is a global location that contains the address of the common vector table. A common routine call example follows:
MOVL G^DECW$GL_VECTOR,R0 ;get global pointer to vector table JSB @COMMON_VSYNC(R0) ;call the COMMON_VSYNC routine
The common driver module contains class service routines that are required by class drivers. This section presents the common driver class service routines in alphabetical order. The class service routines are as follows:
The COMMON_POS_CURSOR routine positions the cursor (pointer) according to the location specified in the UCB (UCB$W_DECW_CURSOR_X and UCB$W_DECW_CURSOR_Y). The cursor position adjusts to the hotspot and is clipped to the physical screen boundaries.input
|R5||Output UCB address|
The COMMON_SETUP_INPUT_UCB routine clears most fields of the class input UCB and sets the system defaults where required. It is called by the port driver's unit initialization routine.input
A value that determines which characteristics to set as follows:
|R5||Address of the input UCB being initialized|
|R0, R1, R2||Destroyed|
5.4 Common Driver Routines for Output Service
The common driver module contains output service routines that are
common among output drivers. This section presents the common driver
output service routines in alphabetical order. The output service
routines are as follows:
The COMMON_SETUP_OUTPUT_UCB routine clears most fields of the output UCB and sets the system defaults where required (screen saver and starting cursor position). This routine is called by an output driver's unit initialization routine. COMMON_SETUP_OUTPUT_UCB allocates and initializes a device information block (DVI) and then calls the OUTPUT_SET_DVI routine, which loads device-specific values into the DVI fields.input
|R5||Output UCB address|
The COMMON_VSYNC routine performs time-sensitive processing during the vertical synchronization (VSYNC) interval. Because most output drivers receive a vertical SYNC interrupt to perform the necessary hardware functions, the output driver also calls the COMMON_VSYNC routine from its interrupt service routine. Because this call is inherently timer based, the COMMON_VSYNC routine periodically checks whether the screen saver function should be enabled or disabled. It also checks the input queue at this interval and determines whether the server needs to be notified of new input.input
|R5||Output UCB address|
|All other registers||Preserved|
5.5 Common Driver Vectored Data
The common driver module contains vectored data structures that are
required for DECwindows global driver service. This section presents
the vectored data segments. Offset entry names to vectored data
segments are as follows:
This entry in the common driver vector table points to the driver dispatch table (DDT). It is simply an offset to the DDT and not a routine. The COMMON_UNIT_INIT macro uses the COMMON_DDT entry point when loading the address of the DDT into the UCB. The DDT is described in the VMS Device Support Manual.
This entry in the common driver vector table points to the driver common flags longword (COMMON_FLAG_BITS). It is simply an offset to the common flag bits or global flags and not a routine. The $DECW_COMMON_READY macro uses the flag bits to sense whether the drivers are loaded. The common bits in the flags longword are listed in Table 5-2.
Table 5-2 Common Flags Longword Bits Description FLAGS$V_KB_DECODER Bit 0 is set when the keyboard class driver is loaded. FLAGS$V_PTR_DECODER Bit 1 is set when the pointer class driver is loaded.
5.6 Common Driver FDT Routines for $QIO Service
The $QIO common interface provides for initialization and information
requests from a server or extension to a device. The common driver
module contains function decision table (FDT) routines that service the
$QIO calls in the common interface. The specific requirements and form
of each $QIO call are described in Chapter 2. This section
discusses the functions of the common driver FDT routines.
When a user process calls the SYS$QIO system service, the system service uses the I/O function code specified in the request to scan the driver FDT and selects one or more of the FDT routines provided by the common driver. The common driver performs device-independent processing and then calls the output or input driver for any device-dependent processing. For example, during a cursor pattern $QIO service, the common driver validates the parameters and then calls the appropriate output driver to change the cursor.
Before calling an FDT routine, the $QIO system service sets up the contents of certain registers, as listed in Table 5-3.
|R0||Address of FDT routine being called|
|R3||Address of IRP for current I/O request|
|R4||Address of process control block (PCB) of current process|
|R5||Address of UCB of device assigned to user-specified process-I/O channel|
|R6||Address of CCB that describes user-specified process-I/O channel|
|R7||Bit number of user-specified I/O function code|
|AP||Address of first $QIO parameter ( p1)|
The common driver contains the preprocessor FDT routines and uses the FUNCTAB macro to build a function decision table that lists valid function codes for a given preprocessor. These function codes are entry points to the FDT routines that perform I/O processing for each function specified in the $QIO service call. A list of the common driver FDT function codes and functions is shown in Table 5-4.
|IO$_SENSEMODE||Sense mode of device|
|IO$_SENSECHAR||Sense device characteristics|
|IO$_SETMODE||Set mode of device|
|IO$_SETCHAR||Set device characterisitics|
|IO$_DECW_OUTPUT_BUFFERED_FDT||Preprocess buffered I/O output FDT|
|IO$_DECW_OUTPUT_DIRECT_FDT||Preprocess direct I/O output FDT|
|IO$_DECW_WRITEV||Process input without hardware|
The following sections describe the $QIO functions and modifiers
processed by the device-dependent FDT routines that make up the $QIO
5.6.2 FDT Sense-Mode Routines
The sense-mode FDT routines service $QIO requests to retrieve device information or characteristics. The function modifier passed in the p1 argument selects the appropriate subroutine in the FDT sense-mode routine table for the specific sense-mode function. When the FDT routine exits, it either queues the I/O request, finishes processing the I/O, or aborts the I/O. The following are valid function services as listed in the FDT_SENSEM table that point to the appropriate sense-mode subroutine.
The set-mode FDT routines service $QIO requests to set various device characteristics. The function modifier passed in the p1 parameter selects the appropriate subroutine in the FDT set-mode routine table for the specific set-mode function. When the FDT routine exits, it either queues the I/O request, calls the output driver to complete the request, finishes processing the I/O, or aborts the I/O. The following are valid function
services as listed in the FDT_SETM table that point to the appropriate set-mode subroutine.
The FDT common driver output routines provide $QIO services that preprocess a $QIO output request. The output routines check whether the device being addressed is capable of providing output, then vectors the request to the appropriate FDT parsing routine in the output driver (using the output vector table). The routines preprocess both direct I/O and buffered I/O output requests.