[ECOS] Synchronization

Hugo Tyson hmt@redhat.com
Sat Nov 10 15:36:00 GMT 2001

Schmidt Henning Larsen <HenningLS@danfoss.com> writes:
> > Schmidt> Can I call isig_sem( ID semid ) in an ISR or DSR ?
> > >>  See http://sources.redhat.com/ecos/docs-latest/ref/ecos-ref.13.htm
> > >> l#pgfId=1080346
> > 
> > >> You can only call the signal function of a conditional variable
> > >> from the DSR. So I guess the answer is no.
> > 
> > >> Jesper
> > 
> > Schmidt> But how shall I understand:
> > Schmidt> 
> > http://sources.redhat.com/ecos/docs-latest/ref/ecos-ref.a.html
> > #pgfId=1033803
> > Schmidt> can't I use these functions.
> > Only from threads. I believe the normal approach is to create a thread
> > that does whatever it is you want to do as part of the interrupt
> > handling, and then use condition variables to start it from the DSR.
> > I'm pretty sure it's been discussed before on this list. Look in the
> > archive.
> In the uITRON spec 3 I've found:
>   - Performance may be increased by making separate versions of system
>     calls depending on whether they are issued from task portions or task-
>     independent portions.  In this case, the name of the system call issued
>     from task-independent portions must be i???_??? when the equivalent
>     system call issued from task portions is ???_???.
>     For example, if there is a special version of sig_sem, which returns
>     semaphore resources, has been provided for execution within an interrupt
>     handler.  The name of this system call would then be isig_sem.
> and apparently eCos has the function isig_sem, and according to the uITRON
> specification I can use it in an interrupt-handler !! well can I ?.


But all that does is place a request in a queue; the actual semaphore
signal is called from the associated DSR.  That's because you must not call
kernel operations from an ISR, only from a DSR (and then only kernel
operations which cannot block).

That's the trick we had to play to implement that part of uITRON.

You can use it in an interrupt handler (ISR) if and only if it has the
special uITRON DSR associated with it.  Otherwise nothing whatsoever will

	- Huge

More information about the Ecos-discuss mailing list