PowerPC/Openpic interrupt problem (bug?)

Till Straumann strauman at SLAC.Stanford.EDU
Sat Jun 23 00:24:45 UTC 2001


Hi.

I wanted to connect an IRQ handler to one of the openpic's timers using

BSP_install_rtems_irq_handler().

The first interrupt crashed the system.

That's what I found:

 - BSP_install_rtems_irq_handler(irqData) interprets irqData->name
    as an IRQ "level" which must lie in the range

    BSP_LOWEST_OFFSET..BSP_MAX_OFFSET

    (roughly 16 ISA irqs + 16 PCI irqs). If the level is found to be
valid, the handler
    is installed in

       rtems_hdl_tbl[d->name];

 - However, when it comes to handle the interrupt, RTEMS' global handler

    reads the irq VECTOR from the openpic and uses it as the table
index:

         irq=openpic_irq(0);
         ...
         rtems_hdl_tbl[irq].hdl();

Obviously, if the vector number and the IRQ level disagree, the wrong
table entry is dispatched.

Was it a deliberate decision to implicitely assume/enforce that IRQ
level  and vector numbers are identical? IMO using the vector number as
the table index (reserving the lower numbers for ISA irqs) would be
cleaner and would allow for sharing of levels among devices.

Also, the "bsp/openpic.h" include file is a quite misleading because it
suggests that vectors may be used in a straightforward way.

Otherwise, hacking RTEMS is great fun - thanks

Regards

-- Till




More information about the users mailing list