From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Larmour To: Andrew Lunn Cc: Geoff Patch , "'ecos-discuss@sources.redhat.com'" Subject: Re: [ECOS] semaphore bug?? Date: Wed, 15 Aug 2001 00:24:00 -0000 Message-id: <3B7A23B1.9FCEC18D@redhat.com> References: <01C12580.59C1CFC0.grp@cea.com.au> <20010815091455.L4703@biferten.ma.tech.ascom.ch> X-SW-Source: 2001-08/msg00501.html Andrew Lunn wrote: > > On Wed, Aug 15, 2001 at 11:49:32AM +1000, Geoff Patch wrote: > > > > Hi Folks, > > > > > I don't think you can post to a semaphore from an ISR. You'll > > > have to run a DSR and do it there. There's a table in the eCos > > > Reference Manual (Device Driver Interface to the Kernel) that > > > shows what functions may be called from an ISR. About the only > > > thing you can do is ack/mask/unmask interrupts and run a DSR. > > > > This is correct, and I recall other postings to the list about this issue. > > It's obviously a fairly common misconception. > > How about adding an assertion check to semaphores and mutex etc. If > they are called from within an ISR throw an assertion. Unfortunately there is no portable way to determine if you are in an ISR. Instead you would have to set a HAL level boolean in the interrupt VSR before calling the ISR. And if the ISR, for whatever reason, doesn't exit by returning, it would all go very wrong. 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