diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-02-12 16:05:35 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-02-19 09:59:39 +0100 |
commit | 514705d2f106375ff54d8a744dabeab97c71144d (patch) | |
tree | 9e361d26e18c6fe863e04051978d64241a0ac1a6 /cpukit/sapi/src/exshutdown.c | |
parent | score: Add SYSTEM_STATE_TERMINATED (diff) | |
download | rtems-514705d2f106375ff54d8a744dabeab97c71144d.tar.bz2 |
score: Delete _Thread_BSP_context
Do not return to BSP context in the exit() shutdown path. This makes it
possible to re-use the initialization stack. It can be used for the
interrupt stack for example. On targets with a small RAM this is a
considerable benefit.
This change eliminates also some special cases and simplifies the code.
Delete _Thread_Set_global_exit_status(),
_Thread_Get_global_exit_status() and _Thread_Stop_multitasking().
Diffstat (limited to 'cpukit/sapi/src/exshutdown.c')
-rw-r--r-- | cpukit/sapi/src/exshutdown.c | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/cpukit/sapi/src/exshutdown.c b/cpukit/sapi/src/exshutdown.c index 44c5a09084..41ee537e44 100644 --- a/cpukit/sapi/src/exshutdown.c +++ b/cpukit/sapi/src/exshutdown.c @@ -15,47 +15,37 @@ #include <rtems/init.h> #include <rtems/score/sysstate.h> -#include <rtems/score/threadimpl.h> #include <rtems/score/interr.h> #if defined(RTEMS_SMP) #include <rtems/score/smp.h> #endif -/* - * rtems_shutdown_executive - * - * This kernel routine shutdowns the executive. It halts multitasking - * and returns control to the application execution "thread" which - * initialially invoked the rtems_initialize_executive directive. - * - * Input parameters: NONE - * - * Output parameters: NONE - */ - -void rtems_shutdown_executive( - uint32_t result -) +void rtems_shutdown_executive( uint32_t result ) { + Internal_errors_Source source; + bool is_internal; + Internal_errors_t code; + if ( _System_state_Is_up( _System_state_Get() ) ) { #if defined(RTEMS_SMP) _SMP_Request_other_cores_to_shutdown(); #endif - _Thread_Set_global_exit_status( result ); - _Thread_Stop_multitasking(); - - /******************************************************************* - ******************************************************************* - ****** RETURN TO RTEMS_INITIALIZE_START_MULTITASKING() ****** - ****** AND THEN TO BOOT_CARD() ****** - ******************************************************************* - *******************************************************************/ + source = RTEMS_FATAL_SOURCE_EXIT; + is_internal = false; + code = result; + } else { + source = INTERNAL_ERROR_CORE; + is_internal = true; + code = INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP; } - _Internal_error_Occurred( - INTERNAL_ERROR_CORE, - true, - INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP - ); + + _Internal_error_Occurred( source, is_internal, code ); + + /*************************************************************** + *************************************************************** + * SYSTEM SHUTS DOWN!!! WE DO NOT RETURN TO THIS POINT!!! * + *************************************************************** + ***************************************************************/ } |