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

Found a bug in pc386 bsp




While working on RTEM intel interrupt management I found
the following bug in irq.c for pc386:

PC386_ackIrq(rtems_unsigned8 irq)
{
  if (irq < 8)
  { outport_byte(0x20, 0x20); }
  else
    outport_byte(0xA0, 0x20);
	
} /* ackIRQ */


should be 


PC386_ackIrq(rtems_unsigned8 irq)
{
	if (irq >= 8) {
	    outport_byte(0xA0, 0x20);
        }
	outport_byte(0x20, 0x20);
}


In case interrupt occurs via the
second PIC (irq >= 8) you must acknoledge
the second PIC but also the first one as
It has also been used via interrupt line 2...

You did not see the bug yet because all managed
interrupts are on the fisrt PIC, but as you
are working on ethernet drivers... You may
lose time...


BTW : If someone has a i8259 manual I would also
like to know if there is a timing diference
between the EOI (0x20) command and the EOSI (0x60 + vector index)
command...

Eric.