HP OpenVMS Systems Documentation |
VMS DECwindows Device Driver Manual
A.8 Class Vector TableThe class vector table (IK$VECTOR or IM$VECTOR) data structure contains vectors to the routines of the class driver module (see Figure A-12). The driver builds the data structure using the $VECINI, $VEC, and $VECEND macros. Table A-10 lists and defines the fields of the data structure. Figure A-12 Class Vector Table Data Structure 4735CLASVSTRUCT.TEX
1read only fields A.9 Common Vector TableThe common vector table (DECW_COMMON_VECTOR) data structure in the I/O database contains vectors to the routines and data segments of the common driver module (see Figure A-13). The driver builds the data structure using the $VECINI, $VEC, and $VECEND macros. Table A-11 lists and defines the fields of the data structure. Figure A-13 Common Vector Table Data Structure 4735COMMVSTRUCT.TEX
1read only fields A.10 Port Vector TableThe port vector table (PORT_VECTOR) data structure in the I/O database contains vectors to the routines of the input port driver module (see Figure A-14). The driver builds the data structure using the $VECINI, $VEC, and $VECEND macros. Table A-12 lists and defines the fields of the data structure. Figure A-14 Port Vector Table Data Structure 4735PORTVSTRUCT.TEX
1read only fields A.11 Output Vector TableThe output vector table (GA$VECTOR or GC$VECTOR) data structure contains vectors to the routines of the output driver module. The output driver builds the data structure using the $VECINI, $VEC, and $VECEND macros. Table A-13 lists and defines the fields of the data structure.
1read only fields
Appendix B
|
Location | Contents |
---|---|
R0 | Destroyed |
R1 | Destroyed |
The COMMON_UNIT_INIT macro sets the driver dispatch table field in the device data block and unit control block (UCB) to contain the address of the common driver dispatch table (DDT). This macro contains the common code for the unit initialization routine that is run whenever a unit is created.
COMMON_UNIT_INITinput
Location | Contents |
---|---|
R0 | Address of the DDT for this unit |
R5 | UCB address |
Location | Contents |
---|---|
R1 | Destroyed |
R2 | Destroyed |
The $DECW_COMMON_READY macro senses whether the common drivers are loaded. The macro is used by all DECwindows drivers that depend on a common driver to operate. It checks for the presence of the common driver (INDRIVER) by examining the symbol DECW$GL_VECTOR, set by the driver's controller initialization routine. It then checks for keyboard and mouse class drivers by looking at the flags longword (indexed from the common vector).
$DECW_COMMON_READYoutput
Location | Contents |
---|---|
R0 | Contains a value of 0 when the common driver is not loaded. Contains a value of 1 when all common drivers are loaded. |
The $DECWGBL macro is an external definition that defines the DECwindows common, input, and output driver data structures. The global macro directly calls other structure definition macros within the various DECwindows and VMS modules (see Table B-1) that define the I/O database.
Table B-1 Structure Definition Macros Called by$DECWGBL Macro Name Macro Function $TTYVECDEF Defines the port and class vector tables. $SILODEF Defines the SILO block. $DECWDEF Defines the DVI, KIB, and INP data structures. $DECWCMNINPUCB Defines the common input extension (DWI$x_DECW_ ) and calls $TTYUCBDEF to link the device-specific input extension structure. $DECWPTRINPUCB Defines the pointing device input UCB extension (DWI$x_PTR_ ). $DECWKBINPUCB Defines the keyboard input UCB extension (DWI$x_KB_ ). $DECWOUTPUTUCB Defines the output device UCB extension (UCB$x_DECW_ ). $DECWCOMMON Defines the INB and MHB, the common vector and output vector tables, common flag word (COMMON_FLAGS), and calls the dynamic definition macro $DYNDEF.
B.2 Input Queue and Packet Processing Macros
This section describes the macros that are used in a class input driver
module to acquire free input packets and insert them into the input
queue. The input queue and packet-processing macros are as follows:
The GET_FREE_KB_PACKET macro returns the address of a free packet in R1 if one is available. If a packet is not available, 0 is returned in R1. It uses the interlocked queue instruction (REMQHI) to remove the packet from the free queue.
GET_FREE_KB_PACKETinput
Location | Contents |
---|---|
R5 | UCB address of the input device |
Location | Contents |
---|---|
R1 | Address of the free packet; 0 if there is none |
R2 | Destroyed |
The GET_LAST_EVENT_PACKET macro removes a specified type event packet from the tail of the input queue for motion compression. The macro tests the packet type (INP$B_TYPE) to ensure that it matches the event_type argument in the macro call. If a match is found, the macro increments the motion compression count (DWI$L_PTR_MOTION_COMP_HIT) and returns the free-queue address of the removed input packet in R1. If an event_type (typically, X$MOTION_NOTIFY) packet is not found, it reinserts the packet in the input queue and returns a 0 in R1.
GET_LAST_EVENT_PACKET event_typearguments event_type defines the X11 event (X$MOTION_NOTIFY) for which the packet is removed from the input queue for compression. input
Location | Contents |
---|---|
R5 | UCB address of the input device |
Location | Contents |
---|---|
R1 | Address of the removed packet; 0 if there is none |
R2 | Destroyed |
DWI$L_PTR_MOTION_COMP_HIT | Motion compression count, incremented by one if the specified event type packet is found |
The PUT_INPUT_ON_QUEUE macro inserts an input packet onto the input queue shared with the server. The macro uses the interlocked queue instruction INSQTI for queue insertion and uses the queue header information from the UCB to select the right input queue.
PUT_INPUT_ON_QUEUEinput
Location | Contents |
---|---|
R1 | Address of the input event packet |
R5 | UCB address of the input device |
Location | Contents |
---|---|
R2 | Destroyed |
B.3 Vector Table Generation Macros
This section describes the VMS macros that should be used to generate
the various vector tables. Using these macros ensures the generation of
a valid table, even if the vector table is expanded in new releases.
The vector table generation macros are as follows:
The $VECINI macro generates and initializes the vector table. The table is initialized with the entries pointing to the driver's null routine. Subsequent calls to $VEC fill the table with the addresses of the real entry points.
$VECINI drivername, null_routine, [prefix]arguments drivername defines the driver prefix, usually two alphabetic characters.
null_routine defines the address of the driver's null entry point.
prefix defines the prefix to be added to the generated symbols (for instance, PORT_, CLASS_, COMMON_, OUTPUT_). PORT_ is the default.
The null routine should simply contain an RSB instruction. It is called for any function that the driver does not support. |
The $VEC macro generates fields (vectors) and validates the vector table entry. Each invocation of the $VEC macro specifies the entry argument. However, a driver need not supply the address of a routine for each entry in the table. The $VEC macro constructs a valid table regardless of how many entries are supplied. The $VEC macro accepts the entry names minus the driver type prefix (PORT_ or CLASS_ or OUTPUT_). (For examples, refer to the figures for the class or port vector table data structures in Appendix A.) The $VECINI macro defines the prefix applied to the entries: PORT_ for the port vector table and CLASS_ for the class vector table. This macro ensures that a working table is generated, or that you are notified of any error by message. Note that a driver accesses the table using the symbolic offset names shown in the vector table data structures of Appendix A.
$VEC entry, routinearguments entry defines the name of the table entry.
routine defines the name of the routine being inserted in the entry.
The $VECEND macro generates the longword of zeros that terminates the vector table list and sets the location counter to the correct position. The exact placement of $VECEND in the sequence of $VEC entries marks the end of the vector table.
$VECEND [end]arguments end is a flag controlling the generation of the end of the vector table. This argument is generally omitted so that the $VECEND macro can generate the end of the vector table. Otherwise, the $VECEND macro does not generate the end of the table.
Index | Contents |