Reputation: 545
Could you please let me know how the hardware/driver raises an interrupt? and in an SMP, which CPU gets interrupted? If IRQ is shared by multiple devices, how the kernel identifies the which device caused the interrupt.
/Ganesh
Upvotes: 2
Views: 892
Reputation: 300
The interrupt handler also called ISR is a part of device driver in OS. In OS, each irq number represents a interrupt line from the interrupt controller.
The devices are hard wired to the interrupt controller and the interrupt controller will signal the corresponding CPU if there are interrupts generated in devices. The interrupt target CPUs are programmable in interrupt controller for each interrupt lines.
For sharing interrupt numbers in hardware, like GPIO in ARM, the interrupt controller or device should provide an additional register for the real interrupt number. In addition, the ISR should consult that register for the real IRQ number.
Upvotes: 1
Reputation: 2720
Traditionally there is an actual interrupt wire that runs from the device to the interrupt controller, when it is high (or low, or on an edge) an interrupt is generated and the CPU starts executing the interrupt handler.
On modern systems interrupts tend to be messages on a bus which are sent to the interrupt controller (or there may be several).
In terms of more detail you'll need to be more specific, the details vary depending on what sort of hardware you're talking about.
Upvotes: 2