This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: calling context


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]