Detecting when running in an ISR ?

Cudmore, Alan P. (GSFC-5820) alan.p.cudmore at
Wed Mar 28 16:57:37 UTC 2012

On Mar 28, 2012, at 12:52 PM, Joel Sherrill wrote:

On 03/28/2012 10:48 AM, Cudmore, Alan P. (GSFC-5820) wrote:

On our RTEMS 4.10 project ( m68k/coldfire ), I have an exception handler that does a number of things such as closing files before restarting our processor card.

This works fine when a task has an exception, but did not work too well when I caught an exception in an ISR.

I found this macro:
Which I can use to detect if the exception handler is running in an ISR. Is that a good enough way to detect that the code is running in the context of an ISR? Or is there a better/more standard way?

bool rtems_interrupt_is_in_progress( void );


Just what I was looking for , thanks!

I guess I should stop using "grep" as my manual :)


Another option would be to have a high priority exception task running, just waiting to handle the exception clean up activity. The exception handler could use a semaphore to kick off the task.


rtems-users mailing list
rtems-users at<mailto:rtems-users at>

Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherrill at<mailto:joel.sherrill at>        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list