|
Device drivers use ddi_add_intr(9F) to add an interrupt
handler to the system. The interrupt number,
The "interrupt-priorities"
property is set in the device driver's
If the "interrupt-priorities"
property is not present in the driver For example, the following table shows the setting of the interrupt level for different base classes of a PCI device in Solaris 2.5.1. The value of the "class-code" property of a device is 0x00030000. The base class of the device is 0x3, which is a display controller. Based on the information in the previous table, the system assigns interrupt level 9 to the device.
For the on-board PCI devices such as The IDU is responsible for fielding interrupts from external PCI devices, building the interrupt packet, and sending the interrupt packet to the appropriate CPU. The packet is 64 bytes long and contains the INO and target CPU. The INO is a fixed value and is specific to each interrupt source. The INO allows software to uniquely identify the source of the interrupt without having to poll all interrupt sources, thus reducing overhead in processing interrupts.
When a PCI interrupt occurs, the system
calls the PCI nexus driver's interrupt handler,
Usually, the system creates a separate
thread to handle the interrupt service to maximize thread
concurrence. However, if the interrupt level is above the clock
interrupt level, the system can't hold mutex to create a separate
interrupt thread to service the interrupt. The interrupt handler
runs in the same thread as the interrupted process. In such a
case, the driver must not try to hold any mutex locks in its
interrupt handler to avoid system panic on recursive mutex calls.
Device drivers should always call For a detailed discussion on the use of DDI interrupt functions and how to handle high-level interrupts, refer to Handling High-Level Interrupts in Writing Device Drivers. | |
|
| ||||||||||||