How to catch interrupt

Bruce Evans bde at zeta.org.au
Wed Jun 16 22:20:26 GMT 2004


On Wed, 16 Jun 2004, Roman Kurakin wrote:

>     How to catch interrupt for ISA device before registering handler for it?

This cannot be done without duplicating lots of interrupt handler
registration code.  (Actually only a little for a quick MD hack: just
setidt() to point to an interrupt handler, plus enabling the ICU^WPIC,
plus changing the normal code to not un-enable the PIC.  npx.c still
does something like this in RELENG_4.)

However, you may only need to test for pending interrupts.  This can
be done for isa interrupts using isa_irq_pending() to get a bitmap of
pending irqs.  See sio.c.  On i386's there are also some newer harder
to use even less portable interfaces for determining pending irqs.
See i386/include/intr_machdep.h.

Bruce


More information about the freebsd-current mailing list