This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: IRQs mapping in PC platform
>
>
> [bug in HAL_INTERRUPT_ACKNOWLEDGE()]
>
> >
> > Is that right?
> >
>
> Yes, that is right. However, looking at the code, I see that this
> macro is not actually used, but instead the hal_intc_ack assembly
> macro in platform.inc is actually used. This has the same bug.
>
> So that macro should change to this (I think, I have not been able to
> test it):
>
> .macro hal_intc_ack vector
> # Use any registers you like.
> movl \vector, %edx
> movb $0x20, %al
> cmpl $0x20, %edx
> jl 8f
> cmpl $0x30, %edx
> jl 9f
> outb %al, $0xA0
> 9: outb %al, $0x20
> 8: nop
> .endm
>
> I'll make these two changes to our sources for the next anoncvs
> release.
>
> --
> Nick Garnett, eCos Kernel Architect
> Red Hat, Cambridge, UK
>
Ok. There is one remark:
.macro hal_intc_ack vector
# Use any registers you like.
movl \vector, %edx
movb $0x20, %al
cmpl $0x20, %edx
jl 8f
cmpl $0x28, %edx ; <--- line changed
jl 9f
outb %al, $0xA0
9: outb %al, $0x20
8: nop
.endm
But there is one more bug: in the cyg_drv_interrupt_(un)mask().
I think that right similarly to following (it is written on the "C" only
for a example):
void cyg_drv_interrupt_unmask(cyg_vector_t vector)
{
if ( vector < 0x28 ) // for master
pc_outb(0x21, pc_inb(0x21) & ~(1<<(vector-0x20)));
else // for slave
{
pc_outb(0x21, pc_inb(0x21) & ~(1<<2)); // unmask master IRQ2
pc_outb(0xA1, pc_inb(0xA1) & ~(1<<(vector-0x28)));
}
}
For cyg_drv_interrupt_mask() is similarly.
I tested it. And it worked properly.
--
Boris Guzhov,
St.Petersburg, Russia