diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-09-25 18:08:55 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-09-25 18:08:55 +0000 |
commit | 8e2cd0ce59116e00f0a91a9698c39deaff554ed1 (patch) | |
tree | 11bd9e847ea35b5803c907856d62befcf2710336 /cpukit/score/inline | |
parent | 2009-09-25 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-8e2cd0ce59116e00f0a91a9698c39deaff554ed1.tar.bz2 |
2009-09-25 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/inline/rtems/score/thread.inl: Restore the BSP context -- do
not save the current. This routine is also marked as not returning
which saves the exit path code.
Diffstat (limited to 'cpukit/score/inline')
-rw-r--r-- | cpukit/score/inline/rtems/score/thread.inl | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/cpukit/score/inline/rtems/score/thread.inl b/cpukit/score/inline/rtems/score/thread.inl index 000396546e..f268817971 100644 --- a/cpukit/score/inline/rtems/score/thread.inl +++ b/cpukit/score/inline/rtems/score/thread.inl @@ -24,6 +24,7 @@ #define _RTEMS_SCORE_THREAD_INL #include <rtems/score/sysstate.h> +#include <rtems/score/context.h> /** * @addtogroup ScoreThread @@ -44,7 +45,22 @@ RTEMS_INLINE_ROUTINE void _Thread_Stop_multitasking( void ) if ( _System_state_Is_up(_System_state_Get ()) ) context_p = &_Thread_Executing->Registers; - _Context_Switch( context_p, &_Thread_BSP_context ); + /* + * This may look a bit of an odd but _Context_Restart_self is just + * a very careful restore of a specific context which ensures that + * if we were running within the same context, it would work. + * + * And we will not return to this thread, so there is no point of + * saving the context. + */ + _Context_Restart_self( &_Thread_BSP_context ); + + /*************************************************************** + *************************************************************** + * SYSTEM SHUTS DOWN!!! WE DO NOT RETURN TO THIS POINT!!! * + *************************************************************** + *************************************************************** + */ } /** |