source: rtems/cpukit/sapi/src/exshutdown.c @ 514705d

4.11
Last change on this file since 514705d was 514705d, checked in by Sebastian Huber <sebastian.huber@…>, on Feb 12, 2014 at 3:05:35 PM

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().

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[c3db01d0]1/*
2 *  Initialization Manager
3 *
[d4dc7c8]4 *  COPYRIGHT (c) 1989-2011.
[c3db01d0]5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 */
11
12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
[540eec6e]16#include <rtems/init.h>
[c3db01d0]17#include <rtems/score/sysstate.h>
[7299818]18#include <rtems/score/interr.h>
[c3db01d0]19
[d4dc7c8]20#if defined(RTEMS_SMP)
21  #include <rtems/score/smp.h>
22#endif
23
[514705d]24void rtems_shutdown_executive( uint32_t result )
[c3db01d0]25{
[514705d]26  Internal_errors_Source  source;
27  bool                    is_internal;
28  Internal_errors_t       code;
29
[7299818]30  if ( _System_state_Is_up( _System_state_Get() ) ) {
[d4dc7c8]31    #if defined(RTEMS_SMP)
32      _SMP_Request_other_cores_to_shutdown();
33    #endif
[f58ef8ae]34
[514705d]35    source      = RTEMS_FATAL_SOURCE_EXIT;
36    is_internal = false;
37    code        = result;
38  } else {
39    source      = INTERNAL_ERROR_CORE;
40    is_internal = true;
41    code        = INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP;
[c3db01d0]42  }
[514705d]43
44  _Internal_error_Occurred( source, is_internal, code );
45
46  /***************************************************************
47   ***************************************************************
48   *   SYSTEM SHUTS DOWN!!!  WE DO NOT RETURN TO THIS POINT!!!   *
49   ***************************************************************
50   ***************************************************************/
[c3db01d0]51}
Note: See TracBrowser for help on using the repository browser.