[ECOS] Interrupt acknowledge in ISR.

Jonathan Larmour jlarmour@redhat.com
Thu Dec 6 02:49:00 GMT 2001


felixwong@i-technologies.cc wrote:
> 
> I have just read the "from ISR to thread" messages.  So other issue
> I'd like to mention.
> 
> From eCos CVS, some people put  "cyg_drv_interrupt_acknowledge()" in
> ISRs, some put it into DSRs, even some others (e.g. edb7xxx) put this
> line into the threads created by DSR semaphore.
> 
> However, should this be commonly put into the ISR routine?  For my
> hardware (Samsung S3C44B0X), if "cyg_drv_interrupt_acknowledge()"
> is not put in ISR, the program will interrupt again immediately after
> the "return cyg_isr_call_dsr" line. DSR and any other threads can NEVER
> be executed, the MCU is interrupting again and again.  Is this normal?

You should mask the interrupt in the ISR before returning, and then unmask
it in the DSR.

> Is there any ISR design difference in MCUs (in my case all ARM MCU),
> so that people may put "cyg_drv_interrupt_acknowledge()" even out
> of the ISR?

There's no reason why not as long as you don't mind getting another
interrupt (so you may want to mask it). It's possible that simple interrupt
controllers won't report any other interrupts until that one is
acknowledged, so you won't be able to nest interrupts, including
potentially higher priority ones. So generally it is preferable to
acknowledge the interrupt as soon as possible, i.e. in the ISR.
 
> In my case, if I were to disable interrupts before I finish DSR,
> I have to put the "cyg_drv_interrupt_unmask()" at the end of DSR only.  The
> "cyg_drv_interrupt_acknowledge()" is always put in ISR.

And cyg_drv_interrupt_mask in the ISR too.
 
Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine



More information about the Ecos-discuss mailing list