Reputation: 601
I was debugging an issue in our project and upon doing a code-walk found that the issue occured because an interrupt handler is not called. I understand that ISR is called when an interrupt is generated by hardware/software. In my case it is the hardware that will generate interrupt. Now I want to prove that the issue is because of hardware not generating an interrupt and forward the issue to hardware team. But I want to prove that by calling the ISR handler by generating interrupt. Is there anyway to simulate a hardware interrupt so that ISR gets called?? Thanks for your time.
Upvotes: 2
Views: 2856
Reputation: 190
I've often wondered about the same and never found any good solutions.
The closest I came is sharing the interrupt line between two devices and using one to generate the hardware interrupt (essentially a signal) for the other.
Linux Device Drivers covers it in some detail in http://www.xml.com/ldd/chapter/book/ch09.html#t6.
Essentially, each device's handler is invoked when an interrupt happens and each gets passed their own dev_id
to differentiate which device actually triggered the interrupt (this should be the first thing that the top half of the interrupt handler should verify).
The chapter also covers some basic HW devices you can build/solder to help you generate interrupts.
Upvotes: 1