This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: from ISR to thread
- From: Nick Garnett <nickg at redhat dot com>
- To: "Patrick Doyle" <wpd at delcomsys dot com>
- Cc: <ecos-discuss at sources dot redhat dot com>
- Date: 05 Dec 2001 16:30:04 +0000
- Subject: Re: [ECOS] from ISR to thread
- References: <NFBBJAJICAKJPMMKDAGBKEALCNAA.wpd@delcomsys.com>
"Patrick Doyle" <wpd@delcomsys.com> writes:
> > ISR code:
> > {
> > cyg_drv_isr_lock()
> > rbuf.putdata(hw.data)
> > cyg_drv_isr_unlock()
> >
> > cyg_drv_interrupt_acknowledge()
> >
> > return cyg_isr_call_dsr
> > }
> This one caught me by surprise. Why would you have to an ISR lock/unlock
> from within an ISR? Were you just being extra careful in case some other
> (higher priority?) ISR's happen to use the same ring buffer?
>
Partly that. Also in SMP systems, the thread may be running on a
different CPU, so merely disabling interrupts on this CPU has no
effect. To make the ISR lock usable it must also contain a spinlock,
to block other CPUs if necessary. Hence it is necessary to use it in
ISRs too.
--
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK