[ECOS] IRQs mapping in PC platform

Boris V. Guzhov borg@int.spb.ru
Fri Aug 18 06:19:00 GMT 2000


> "Boris V. Guzhov" <borg@int.spb.ru> writes:
>
> > Hi,
> > I have tested it.  And my device (3c509 EtherLink3 ISA card)
> >  worked properly with 5 and 7 IRQ
> > It corresponds to  5+PC_HARDWARE_IRQ_OFFSET  and
> > 7+PC_HARDWARE_IRQ_OFFSET vectors and here is
> > used master interrupt controller.
> > But it did not work with 10 and 11 IRQ (they are connected to slave
> > interrupt controller).   Why?
> >
>
> There may well be some problems with the second PIC and propogation of
> interrupts through the master controller. I am not sure that this has
> ever been tested - the only interrupting devices use so far are the
> timer and serial lines, all of which are on the master.
>
> --
> Nick Garnett, eCos Kernel Architect
> Red Hat, Cambridge, UK

I think that there is a bug in  hal/i386/pc/version/include/var_intr.h.

In the file there is  the macros:
#define HAL_INTERRUPT_ACKNOWLEDGE( _vector_ )   \
CYG_MACRO_START                                         \
    int x = (_vector_) - PC_HARDWARE_IRQ_OFFSET;    \
    if ((x >= 8) && (x < 16))              \
    {                                                   \
        asm(                                          \
            "movb $0x20, %%al;"           \
            "outb %%al, $0xA0;"             \
            :   /* No outputs. */                \
            :   /* No inputs. */                  \
            :   "eax"                                  \
            );                                          \
    }                                                   \
    if ((x >= 0) && (x < 8))                     \
    {                                                   \
        asm(                                            \
            "movb $0x20, %%al;"                         \
            "outb %%al, $0x20;"                         \
            :   /* No outputs. */                       \
            :   /* No inputs. */                        \
            :   "eax"                                   \
            );                                          \
    }                                                   \
CYG_MACRO_END

Here for the connected to slave controller devices issue EOI  only for
the slave.  But it is necessary to issue EOI for slave AND
for master:

#define HAL_INTERRUPT_ACKNOWLEDGE( _vector_ )           \
CYG_MACRO_START                                         \
    int x = (_vector_) - PC_HARDWARE_IRQ_OFFSET;        \
    if ((x >= 8) && (x < 16))                           \
    {                                                   \
        asm(                                            \
            "movb $0x20, %%al;"                         \
            "outb %%al, $0xA0;"                         \
            :   /* No outputs. */                       \
            :   /* No inputs. */                        \
            :   "eax"                                   \
            );                                          \
    }                                                   \
    if ((x >= 0) && (x < 16))    \     <----  line changed
    {                                                   \
        asm(                                            \
            "movb $0x20, %%al;"                         \
            "outb %%al, $0x20;"                         \
            :   /* No outputs. */                       \
            :   /* No inputs. */                        \
            :   "eax"                                   \
            );                                          \
    }                                                   \
CYG_MACRO_END

Is that right?

--
Boris Guzhov,
St.Petersburg, Russia





More information about the Ecos-discuss mailing list