[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

386 IRQ handling question



In irq.c, there is a function that enables IRQ lines
( BSP_irq_enable_at_i8259s).

According to the i386ex manual:

"Whenever the 82C59A receives an interrupt request, it sets the
request's pending bit ( regardless of whether the IR signal is masked).
The pending bit remains set until the interrupt is serviced or you read
the interrupt request register.  Therefore, before unmasking an IR
signal, read the interrupt request register to clear pending
interrupts."

In this light, should the BSP_irq_enable_at_i8259s() be modified to read
the IRR before unmasking the interrupt?

eg. for master imr port:

    unsigned char IRR;
 ....
    outport_byte(0x0020, 0xA);
    inport_byte(0x0020,IRR);
    outport_byte(PIC_MASTER_IMR_IO_PORT);

Is this the correct approach or will it cause the IRQ handling to fail?
Is it a design decision to leave pending  interrupts alone when
unmasking the interrupt?  (  I want to be careful, since this code is
shared with the pc386 BSP.)

I believe that on our board, if  the reset button gets pressed, just
after an IR has been requested and has gone pending then, when the
default IRQ handlers are invoked on startup, then the raw_idt_notify
handler will get invoked immediately after the IR is unmasked.   We
sometimes get an infinite number of the raw_idt_notify  messages after a
reset,  but not always.

Comments?