Exception Handling

Till Straumann strauman at slac.stanford.edu
Mon Feb 15 16:27:27 UTC 2010


Cassia Yuri wrote:
>
> Dear all,
>
> Is it possible to modify the context for which the processor returns 
> after an exception? I need the faulty task (task that caused the 
> exception) to be suspended while another task (specific for this 
> situation) gains control and then delete (or not) the faulty one.
>
> I can't see how to do that now; by not deleting the faulty task as a 
> response to the exception (within an interrupt request handler or 
> within _defaultExcHandler in cpu.c) I get stucked in a loop executing 
> the instruction causing the exception and the exception handling.
You can e.g., from the exception handler
post a pointer to the exception context or the TID to the
handling task with rtems_message_queue_send().
After that you can (still from the exception handler) execute
rtems_task_suspend(RTEMS_SELF).

The exception handling task can inspect the exception context,
try to fix it and if that succeeds issue rtems_task_resume(exc_context->tid)
(assuming the exception context contains the TID of the interrupted
task).

HTH
-- Till
>  
> Any help/correction is very welcome,
>  
> best regards,
>  
> Cássia
> ------------------------------------------------------------------------
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users
>   




More information about the users mailing list