Detecting when running in an ISR ?
Joel Sherrill
joel.sherrill at OARcorp.com
Wed Mar 28 17:18:05 UTC 2012
On 03/28/2012 11:57 AM, Cudmore, Alan P. (GSFC-5820) wrote:
>
> 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:
>>> _ISR_Is_in_progress
>>> 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?
>>
>> http://www.rtems.org/onlinedocs/releases/rtemsdocs-4.10.2/share/rtems/html/c_user/c_user00106.html
>>
>> bool rtems_interrupt_is_in_progress( void );
>>
>>
>> :)
>
> Just what I was looking for , thanks!
>
> I guess I should stop using "grep" as my manual :)
>
I was just thrilled to answer an "Alan question" with a link to a manual.
You usually have much harder questions. :)
-joel
> Alan
>
>
>>
>>> 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.
>>>
>>> Thanks,
>>> Alan
>>>
>>>
>>> _______________________________________________
>>> rtems-users mailing list
>>> rtems-users at rtems.org
>>> http://www.rtems.org/mailman/listinfo/rtems-users
>>
>>
>> --
>> Joel Sherrill, Ph.D. Director of Research& Development
>> joel.sherrill at OARcorp.com On-Line Applications Research
>> Ask me about RTEMS: a free RTOS Huntsville AL 35805
>> Support Available (256) 722-9985
>>
>
--
Joel Sherrill, Ph.D. Director of Research& Development
joel.sherrill at OARcorp.com 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: <http://lists.rtems.org/pipermail/users/attachments/20120328/49105c84/attachment-0001.html>
More information about the users
mailing list