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: cyg_alarm - which context


Hi Martin

Martin Laabs wrote:

> I have an alarm handle which is called periodically. In which context is
> the function called? Obviously it is not a thread because
> cyg_thread_delay does not work.
> Anyway - is this handle-function interruptible by the scheduler or
> should I handle it like a interrupt routine? (I hope it does not block
> interrupts.)

Alarm handler functions are called in the context of the code which
increments the associated counter. In the case of alarms associated with
the eCos system clock, the context is the system clock DSR.

If you need a delay in your handling of the alarm trigger condition, I
suggest you do nothing more than post to a semaphore within your alarm
handler function. You can perform the remainder of your processing in a
regular thread which waits on the semaphore in a loop.

> Which stack is used by this function? It is the idle stack?

In the case of an alarm handler function called from a DSR, this will
depend on the setting of the
CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK option.

I hope this helps...

John Dallaway
eCos maintainer

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