This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: hal_IRQ_handler() for AT91 port
On Wed, 2001-10-17 at 19:39, Ilko Iliev wrote:
> Hi Gary!
>
> Why did you make :
>
> in at91_misc.c
> int hal_IRQ_handler(void)
> {
> cyg_uint32 irq_num;
> cyg_uint32 ipr, imr;
>
> HAL_READ_UINT32(AT91_AIC+AT91_AIC_IPR, ipr);
> HAL_READ_UINT32(AT91_AIC+AT91_AIC_IMR, imr);
> ipr &= imr;
> for (irq_num = 0; irq_num < 19; irq_num++) {
> if (ipr & (1 << irq_num)) {
> break;
> }
> }
> return irq_num;
> }
>
> instead of (whitout loop):
> int hal_IRQ_handler(void)
> {
> // Do hardware-level IRQ handling
> int vector;
>
> vector = AIC->AIC_IVR; // Acknoledge interupt (Reads as 0)
> vector = AIC->AIC_ISR; // Read interupt vector
>
> return vector;
> }
I'm not sure [I don't recall the reason]. Are these two methods
equivalent? If so, we could change it.
>
>
> best regards
> Ilko