Specifications
Contents
xv
The Asynchronous I/O Support Routines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-25
The aread Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-26
The awrite Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-27
The acheck Routine. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-28
The await Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-29
Control Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-30
The close Routine. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-31
Developing the Driver’s Interrupt Service Routine . . . . . . . . . . . . . . . . . . . . . . . . . . 17-34
Connecting a User-Level Interrupt Process and Interrupt Vector. . . . . . . . . . . . 17-34
User-Level Interrupts and Memory Locking . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-36
Use of Local Memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-36
Constraints on Interrupt-Handling Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-37
Developing the Device Configuration Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-38
Create Shared Memory Regions and Initialize the Device. . . . . . . . . . . . . . . . . 17-39
Reset the Device. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-40
Create a User-Level Interrupt Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-40
Provide Debug and Status Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-41
Restore the Device to its Initial State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-41
Debugging the Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-41
Appendix A Example PCI User-Level Device Driver
Glossary
Index
Illustrations
Figure 2-1. Driver Placement in the Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Figure 2-2. How the System Calls Driver Routines . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Figure 2-3. Switch Table Entry Points and System Calls. . . . . . . . . . . . . . . . . . . . . 2-9
Figure 4-1. Elements of an HN6800 Processor Board . . . . . . . . . . . . . . . . . . . . . . . 4-2
Figure 4-2. Big Endian Bit and Byte Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Figure 5-1. Elements of a Power Hawk PH610 Processor Board . . . . . . . . . . . . . . 5-2
Figure 5-2. Big Endian Bit and Byte Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
Figure 6-1. Elements of a PowerMAXION Processor Board. . . . . . . . . . . . . . . . . . 6-2
Figure 6-2. Big Endian Bit and Byte Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
Figure 7-1. Elements of an Power Hawk 620 Processor Board . . . . . . . . . . . . . . . . 7-2
Figure 7-2. Power Hawk 640 System Block Diagram . . . . . . . . . . . . . . . . . . . . . . . 7-3
Figure 7-3. Big Endian Bit and Byte Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
Figure 8-1. Motorola MCP750 System Block Diagram. . . . . . . . . . . . . . . . . . . . . . 8-3
Figure 8-2. Big Endian Bit and Byte Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
Figure 9-1. Kernel I/O Structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
Figure 10-1. Installing (H)VME Board into 13-slot Rack . . . . . . . . . . . . . . . . . . . . 10-4
Screens
Screen 13-1. Device Driver Wrapper Coding Example . . . . . . . . . . . . . . . . . . . . . . 13-7
Screen 13-2. High Level Driver Wrapper Coding Example. . . . . . . . . . . . . . . . . . . 13-8
Screen 13-3. STREAMS Module Wrapper Coding Example . . . . . . . . . . . . . . . . . 13-8
Screen 13-4. File System Module Wrapper Coding Example . . . . . . . . . . . . . . . . . 13-9
Screen 13-5. Miscellaneous Module Wrapper Coding Example . . . . . . . . . . . . . . . 13-9