This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: AT91 bad IRQ/FIQ priority handling?


On Tue, Sep 14, 2004 at 11:48:05AM +0200, Andrea Michelotti wrote:
> int hal_IRQ_handler(void)
> {
>     cyg_uint32 irq_num;
>-    cyg_uint32 ivr;
>+    cyg_uint32 ivr,ipr,imr;
>+    HAL_READ_UINT32(AT91_AIC+AT91_AIC_IPR, ipr);
>+    HAL_READ_UINT32(AT91_AIC+AT91_AIC_IMR, imr);
>+    
>+    if(imr&ipr&0x1){
>+      HAL_WRITE_UINT32(AT91_AIC+AT91_AIC_ICCR, 1); // we must clean pending fiq
>+      return 0;
>+    }
>     
>     // Calculate active interrupt (updates ISR)
>     HAL_READ_UINT32(AT91_AIC+AT91_AIC_IVR, ivr);
> 
>     HAL_READ_UINT32(AT91_AIC+AT91_AIC_ISR, irq_num);

Returning 0 is wrong. You need to return the interrupt source as
defined in hal_platform_ints.h. 

        Andrew

Attachment: at91_misc.c.patch
Description: Binary data

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]