public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Synchronization
@ 2001-11-09  0:38 Schmidt Henning Larsen
  2001-11-09 11:56 ` Jesper Skov
  0 siblings, 1 reply; 7+ messages in thread
From: Schmidt Henning Larsen @ 2001-11-09  0:38 UTC (permalink / raw)
  To: 'ecos-discuss@sources.redhat.com'

Hi
What is the difference between cyg_drv_mutex_unlock and cyg_mutex_unlock ?
Can I call isig_sem( ID semid ) in an ISR or DSR ?
Henning



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ECOS] Synchronization
  2001-11-09  0:38 [ECOS] Synchronization Schmidt Henning Larsen
@ 2001-11-09 11:56 ` Jesper Skov
  0 siblings, 0 replies; 7+ messages in thread
From: Jesper Skov @ 2001-11-09 11:56 UTC (permalink / raw)
  To: Schmidt Henning Larsen; +Cc: 'ecos-discuss@sources.redhat.com'

>>>>> "Schmidt" == Schmidt Henning Larsen <HenningLS@danfoss.com> writes:

Schmidt> Hi What is the difference between cyg_drv_mutex_unlock and
Schmidt> cyg_mutex_unlock ? 

The _drv_ functions (both lock and unlock) provide fallback
implementations when the kernel isn't present.

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.html#pgfId=1080346

You can only call the signal function of a conditional variable from
the DSR. So I guess the answer is no.

Jesper

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ECOS] Synchronization
  2001-11-10 15:30 Schmidt Henning Larsen
  2001-11-10 15:36 ` Hugo Tyson
@ 2001-11-10 18:18 ` Nick Garnett
  1 sibling, 0 replies; 7+ messages in thread
From: Nick Garnett @ 2001-11-10 18:18 UTC (permalink / raw)
  To: ecos-discuss

Schmidt Henning Larsen <HenningLS@danfoss.com> writes:

> 
> 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 ?.
> 

Yes, you can, in a uITRON ISR, registered with the uITRON API calls. You
cannot mix these calls with the standard eCos API.


-- 
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ECOS] Synchronization
  2001-11-10 15:30 Schmidt Henning Larsen
@ 2001-11-10 15:36 ` Hugo Tyson
  2001-11-10 18:18 ` Nick Garnett
  1 sibling, 0 replies; 7+ messages in thread
From: Hugo Tyson @ 2001-11-10 15:36 UTC (permalink / raw)
  To: ecos-discuss


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 ?.

Yes.

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
happen.

	- Huge

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [ECOS] Synchronization
@ 2001-11-10 15:30 Schmidt Henning Larsen
  2001-11-10 15:36 ` Hugo Tyson
  2001-11-10 18:18 ` Nick Garnett
  0 siblings, 2 replies; 7+ messages in thread
From: Schmidt Henning Larsen @ 2001-11-10 15:30 UTC (permalink / raw)
  To: 'ecos-discuss@sources.redhat.com'

> >>
> 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.

> Jesper

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 ?.

Henning

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ECOS] Synchronization
  2001-11-10 11:55 Schmidt Henning Larsen
@ 2001-11-10 12:15 ` Jesper Skov
  0 siblings, 0 replies; 7+ messages in thread
From: Jesper Skov @ 2001-11-10 12:15 UTC (permalink / raw)
  To: Schmidt Henning Larsen; +Cc: 'ecos-discuss@sources.redhat.com'

>>>>> "Schmidt" == 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.

Jesper

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [ECOS] Synchronization
@ 2001-11-10 11:55 Schmidt Henning Larsen
  2001-11-10 12:15 ` Jesper Skov
  0 siblings, 1 reply; 7+ messages in thread
From: Schmidt Henning Larsen @ 2001-11-10 11:55 UTC (permalink / raw)
  To: 'ecos-discuss@sources.redhat.com'

> 
> 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

But how shall I understand:
http://sources.redhat.com/ecos/docs-latest/ref/ecos-ref.a.html#pgfId=1033803
can't I use these functions.

Henning

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-11-16 14:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-09  0:38 [ECOS] Synchronization Schmidt Henning Larsen
2001-11-09 11:56 ` Jesper Skov
2001-11-10 11:55 Schmidt Henning Larsen
2001-11-10 12:15 ` Jesper Skov
2001-11-10 15:30 Schmidt Henning Larsen
2001-11-10 15:36 ` Hugo Tyson
2001-11-10 18:18 ` Nick Garnett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).