Specifications

4 Writing Device-Driver Tables
4.1 Driver Prologue Table ........................................ 4–1
4.2 Driver Dispatch Table ........................................ 4–3
4.3 Function Decision Table . . . .................................... 4–4
4.3.1 OpenVMS AXP I/O Function Codes ........................... 4–6
4.3.1.1 Defining Device-Specific Function Codes . ................... 4–9
4.4 Building Driver Tables Using C ................................. 4–9
4.4.1 Driver Prologue Table . .................................... 4–10
4.4.1.1 DPT Macros .......................................... 4–10
4.4.1.2 DPT Functions ........................................ 4–11
4.4.2 Driver Dispatch Table . .................................... 4–11
4.4.2.1 DDT Fields........................................... 4–11
4.4.2.2 DDT Functions ........................................ 4–12
4.4.2.3 DDT Macro Calls . . .................................... 4–13
4.4.3 Function Decision Table .................................... 4–13
4.4.3.1 FDT Functions ........................................ 4–14
4.4.3.2 FDT Macros .......................................... 4–14
4.4.4 Device Database Initialization/Reinitialization .................. 4–14
4.4.4.1 DPT_STORE_ISR. . .................................... 4–14
5 Writing FDT Routines
5.1 Context of Driver FDT Processing . . . ............................ 5–2
5.2 Upper-Level FDT Action Routines . . . ............................ 5–2
5.2.1 System-Provided Upper-Level FDT Routines . ................... 5–3
5.2.2 FDT Exit Paths .......................................... 5–5
5.3 FDT Routines for System Direct I/O . ............................ 5–7
5.4 FDT Routines for System Buffered I/O ........................... 5–7
5.4.1 Checking Accessibility of the Users Buffer . . ................... 5–8
5.4.2 Allocating the System Buffer ................................ 5–8
5.4.3 Buffered-I/O Postprocessing ................................. 5–8
6 Writing a Start-I/O Routine
6.1 Transferring Control to the Start-I/O Routine . . . ................... 6–1
6.2 Context of a Driver Fork Process ................................ 6–1
6.3 Functions of a Start-I/O Routine ................................ 6–2
6.3.1 Obtaining Controller Access ................................. 6–2
6.3.2 Obtaining and Converting the I/O Function Code and Its Modifiers. . 6–3
6.3.3 Preparing the Device Activation Bit Mask . . . ................... 6–3
6.3.4 Synchronizing Access to the Device Database ................... 6–3
6.3.5 Checking for a Local Processor Power Failure ................... 6–3
6.3.6 Activating the Device . . .................................... 6–4
6.4 Waiting for an Interrupt or Timeout . ............................ 6–4
7 Writing an Interrupt Service Routine
7.1 Servicing a Solicited Interrupt .................................. 7–1
7.2 Servicing an Unsolicited Interrupt . . . ............................ 7–3
vi