Hi,
Can anyone tell me the best way for kernel modules (e.g. irq handler) to
inform user code that an interrupt has occured. One option is of course to
use signals but this doesn't seem particularly effective nor robust.
Thanks,
Antti
Can anyone tell me the best way for kernel modules (e.g. irq handler) to
inform user code that an interrupt has occured. One option is of course to
use signals but this doesn't seem particularly effective nor robust.
Thanks,
Antti
Instead, I would suggest that you implement a socket family to produce
this mechanism. With a socket family, interrupt events can be queued up
to user space, and each entry in the queue can contain whatever
arbitrary data you like that your user space "interrupt handler" may
need to properly service the interrupt. This mechanism allows you to
avoid the need for an interlock to prevent the loss of interrupts.
Also, if servicing an interrupt requires the access of read-clear
registers, you can insulate that access to your real, kernel space
handler, by simply packing the appropriate register values in the skb
that you queue to the socket family. Then all thats left to do in user
space is create a thread that selects on an open socket descriptor
opened against your socket family.
HTH
Neil
> Can anyone tell me the best way for kernel modules (e.g. irq handler) to
> inform user code that an interrupt has occured. One option is of course to
> use signals but this doesn't seem particularly effective nor robust.
> Thanks,
> Antti
-- Pete
- Larry
>>I would suggest that you implement a socket family to produce
>>this mechanism.
> When I needed this kind of functionality (transferring hardware
> events to user space) I simply made a kernel driver for a /dev/pulse
> character special device (Major device 10, minor device selected
> from 240-255 "Reserved for local use"). It wasn't hard to grab
> code from the Rubini book and drivers/char/nwbutton.c and make
> something that works. Sounds simpler than inventing a whole new
> socket family.
> - Larry
1. irq handling code consolidation, second try (common code)
Hi all,
attached patch is a second try of IRQ handling code consolidation.
This is a common part (tested and works on i386).
Best regards.
--
Andrey Panin | Embedded systems software developer
patch-irq-common-2.5.53 17K Download |
2. Optra E 3
3. irq handling code consolidation (v850 part)
5. irq handling code consolidation (i386)
6. VxWorks to Linux (or BSD) resources?
7. irq handling code consolidation (i386 part)
8. Difference in LDAP Directory Server versions
9. irq handling code consolidation, second try (ppc part)
10. irq handling code consolidation, second try (i386 part)
11. irq handling code consolidation, second try (x86_64 part)
12. irq handling code consolidation (common part)
13. irq handling code consolidation, second try (alpha part)