public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] calling context
@ 2008-05-13  8:32 Guenter Ebermann
  2008-05-13 10:55 ` Gary Thomas
  0 siblings, 1 reply; 4+ messages in thread
From: Guenter Ebermann @ 2008-05-13  8:32 UTC (permalink / raw)
  To: ecos-discuss

Hello,

is there a way to detect if a function was called from a DSR or from a normal eCos task?

-Guenter


-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] calling context
  2008-05-13  8:32 [ECOS] calling context Guenter Ebermann
@ 2008-05-13 10:55 ` Gary Thomas
  2008-05-13 12:43   ` David Brennan
  0 siblings, 1 reply; 4+ messages in thread
From: Gary Thomas @ 2008-05-13 10:55 UTC (permalink / raw)
  To: Guenter Ebermann; +Cc: ecos-discuss

Guenter Ebermann wrote:
> Hello,
> 
> is there a way to detect if a function was called from a DSR or from a normal eCos task?

Not directly.  Why do you want/need this?

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] calling context
  2008-05-13 10:55 ` Gary Thomas
@ 2008-05-13 12:43   ` David Brennan
  2008-05-13 14:49     ` Guenter Ebermann
  0 siblings, 1 reply; 4+ messages in thread
From: David Brennan @ 2008-05-13 12:43 UTC (permalink / raw)
  To: Guenter Ebermann; +Cc: ecos-discuss, Gary Thomas


On May 13, 2008, at 3:55 AM, Gary Thomas wrote:

> Guenter Ebermann wrote:
>> Hello,
>> is there a way to detect if a function was called from a DSR or  
>> from a normal eCos task?
>
> Not directly.  Why do you want/need this?
>
> -- 
> ------------------------------------------------------------
> Gary Thomas                 |  Consulting for the
> MLB Associates              |    Embedded world
> ------------------------------------------------------------
>

Gary is correct. It generally is not needed. However I needed it for  
my application and this is what I did.
http://sourceware.org/ml/ecos-patches/2004-10/msg00103.html
Good luck

David Brennan


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] calling context
  2008-05-13 12:43   ` David Brennan
@ 2008-05-13 14:49     ` Guenter Ebermann
  0 siblings, 0 replies; 4+ messages in thread
From: Guenter Ebermann @ 2008-05-13 14:49 UTC (permalink / raw)
  To: David Brennan; +Cc: gary, ecos-discuss

On Tue, 13 May 2008 05:42:32 -0700 David Brennan wrote:
> On May 13, 2008, at 3:55 AM, Gary Thomas wrote:
>> Guenter Ebermann wrote:
>>> Hello,
>>> is there a way to detect if a function was called from a DSR or  
>>> from a normal eCos task?
>>
>> Not directly.  Why do you want/need this?
> 
> Gary is correct. It generally is not needed. However I needed it for  
> my application and this is what I did.
> http://sourceware.org/ml/ecos-patches/2004-10/msg00103.html

Thank you very much for your suggestions.

I also think this is not generally needed in eCos.
But I wanted to ask before implementing something which perhaps is already
included in eCos (I already searched in eCos source code for something comparable before asking).

I need it in my application to do the following:
We manufacture a PCI addon card with a CPU and two FlexRay controllers for
automotive measureing solutions.
We use a small interrupt dispatcher ("ontop" of eCos) which synchonizes
its local time to the global FlexRay controllers time to execute tasks
which must run synchonized with the bus. These time-triggered tasks are
executed out of eCos DSR's.

The PCI driver on the target contains two FIFO's which are DMA'd to the host. One FIFO is filled from time-triggered DSR's and the other one from
normal eCos tasks.

For error reporting functions (which report errors via the PCI FIFO's to the host) it would be nice to know the calling context (DSR or eCos task)
to make them easier to use.

I think I will implement it as simple like this (from within the application):
by setting a cyg_atomic global variable to 1 before executing the time triggered task out of the DSR. Then a HAL_IO_BARRIER().
After the time triggered taks finished (the function returns) I will
set the variable to 0 and add again a HAL_IO_BARRIER().

-Guenter







-- 
249 Spiele für nur 1 Preis. Die GMX Spieleflatrate schon ab 9,90 Euro.
Neu: Asterix bei den Olympischen Spielen: http://flat.games.gmx.de

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

end of thread, other threads:[~2008-05-13 14:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-13  8:32 [ECOS] calling context Guenter Ebermann
2008-05-13 10:55 ` Gary Thomas
2008-05-13 12:43   ` David Brennan
2008-05-13 14:49     ` Guenter Ebermann

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