RTEMS Logo

RTEMS 4.9.0 On-Line Library


Task Context Management Restarting the Currently Executing Task

PREV UP NEXT Bookshelf RTEMS Porting Guide

6.3.5: Restarting the Currently Executing Task

The _CPU_Context_Restart_self is responsible for somehow restarting the currently executing task. If you are lucky when porting RTEMS, then all that is necessary is restoring the context. Otherwise, there will need to be a routine that does something special in this case. Performing a _CPU_Context_Restore on the currently executing task after reinitializing that context should work on most ports. It will not work if restarting self conflicts with the stack frame assumptions of restoring a context.

The following is an implementation of _CPU_Context_Restart_self that can be used when no special handling is required for this case.

#define _CPU_Context_Restart_self( _the_context ) \
   _CPU_Context_restore( (_the_context) )

XXX find a port which does not do it this way and include it here


PREV UP NEXT Bookshelf RTEMS Porting Guide

Copyright © 1988-2008 OAR Corporation