[ECOS] Fw: [ECOS] Determining current context
Tue May 27 10:09:00 GMT 2003
you may pass an extra argument to your generic function which will identify
the context in which function is called.
When it is called the ISR context you pass Value1 and when from thread you
pass Value 2. It is not very friendly to your stack, but the occupied frame
is not really large.
----- Original Message -----
From: "David Brennan" <eCos@brennanhome.cxm>
To: "Gary D. Thomas" <email@example.com>
Cc: "eCos Discussion" <firstname.lastname@example.org>
Sent: Tuesday, May 27, 2003 7:10 AM
Subject: Re: [ECOS] Determining current context
> On Mon, 2003-05-26 at 14:38, Gary D. Thomas wrote:
> > On Mon, 2003-05-26 at 11:51, David Brennan wrote:
> > > Is there a function somewhere which will tell my code what context it
> > > currently in?
> > > Specifically this is for i386-pc platform if that matters.
> > What sort of context are you referring to? Do you mean ISR vs DSR vs
> > thread? In this case, you'll just have to know by design. In other
> > words, an ISR will be a particular piece of code that only runs as
> > a direct result of an interrupt. This code should not be used any
> > other way. Similarly, a DSR is only run as a result of an ISR causing
> > it to be dispatched. All other code is thread code.
> > --
> > Gary D. Thomas <email@example.com>
> That was the impression that I got from the sample code. However, I
> have a generic function which I would like to be able to call from any
> context, but it must behave slightly differently in interrupt context.
> I was hoping that there was an operating system call of some sort which
> could tell me. (Obviously it must know the current context). I'd even
> settle for something as crazy as checking to see if the current stack
> area is the isr area.
> David Brennan
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
More information about the Ecos-discuss