|
|||
Part I Designing Device Drivers for the Solaris Platform 1. Overview of Solaris Device Drivers 2. Solaris Kernel and Device Tree 5. Managing Events and Queueing Tasks 7. Device Access: Programmed I/O Interrupt Handler Functionality Handling High-Level Interrupts 10. Mapping Device and Kernel Memory 14. Layered Driver Interface (LDI) Part II Designing Specific Kinds of Device Drivers 15. Drivers for Character Devices 18. SCSI Host Bus Adapter Drivers 19. Drivers for Network Devices Part III Building a Device Driver 21. Compiling, Loading, Packaging, and Testing Drivers 22. Debugging, Testing, and Tuning Device Drivers 23. Recommended Coding Practices B. Summary of Solaris DDI/DKI Services C. Making a Device Driver 64-Bit Ready |
DDI Interrupt FunctionsThe Solaris OS provides a framework for registering and unregistering interrupts and provides support for Message Signaled Interrupts (MSIs). Interrupt management interfaces enable you to manipulate priorities, capabilities, and interrupt masking, and to obtain pending information. Interrupt Capability FunctionsUse the following functions to obtain interrupt information:
Interrupt Initialization and Destruction FunctionsUse the following functions to create and remove interrupts:
Priority Management FunctionsUse the following functions to obtain and set priority information:
Soft Interrupt FunctionsUse the following functions to manipulate soft interrupts and soft interrupt handlers:
Interrupt Function ExamplesThis section provides examples for performing the following tasks:
Example 8-1 Changing Soft Interrupt PriorityUse the ddi_intr_set_softint_pri(9F) function to change the soft interrupt priority to 9. if (ddi_intr_set_softint_pri(mydev->mydev_softint_hdl, 9) != DDI_SUCCESS) cmn_err (CE_WARN, "ddi_intr_set_softint_pri failed"); Example 8-2 Checking for Pending InterruptsUse the ddi_intr_get_pending(9F) function to check whether an interrupt is pending. if (ddi_intr_get_pending(mydevp->htable[0], &pending) != DDI_SUCCESS) cmn_err(CE_WARN, "ddi_intr_get_pending() failed"); else if (pending) cmn_err(CE_NOTE, "ddi_intr_get_pending(): Interrupt pending"); Example 8-3 Setting Interrupt MasksUse the ddi_intr_set_mask(9F) function to set interrupt masking to prevent the device from receiving interrupts. if ((ddi_intr_set_mask(mydevp->htable[0]) != DDI_SUCCESS)) cmn_err(CE_WARN, "ddi_intr_set_mask() failed"); Example 8-4 Clearing Interrupt MasksUse the ddi_intr_clr_mask(9F) function to clear interrupt masking. The ddi_intr_clr_mask(9F) function fails if the specified interrupt is not enabled. If the ddi_intr_clr_mask(9F) function succeeds, the device starts generating interrupts. if (ddi_intr_clr_mask(mydevp->htable[0]) != DDI_SUCCESS) cmn_err(CE_WARN, "ddi_intr_clr_mask() failed"); |
||
|