This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: IRQs mapping in PC platform
"Boris V. Guzhov" <borg@int.spb.ru> writes:
> >
> >
> > [bug in HAL_INTERRUPT_ACKNOWLEDGE()]
> >
> 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
Oops, yes, I think you are right.
>
> 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.
>
Yes, that's right. It's been a few years since I did PC interrupt stuff,
but all these improvements are reminding me of what I did then. Maybe
I should dig out my old code and compare it sometime...
I'll get these changes put into our repository.
--
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK