Changeset 514705d in rtems for cpukit/sapi


Ignore:
Timestamp:
Feb 12, 2014, 3:05:35 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
38ee758
Parents:
92f50c3
git-author:
Sebastian Huber <sebastian.huber@…> (02/12/14 15:05:35)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/19/14 08:59:39)
Message:

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

Location:
cpukit/sapi/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/src/exinit.c

    r92f50c3 r514705d  
    3434#include <rtems/debug.h>
    3535#include <rtems/extensionimpl.h>
    36 #include <rtems/fatal.h>
    3736#include <rtems/init.h>
    3837#include <rtems/io.h>
     
    216215void rtems_initialize_start_multitasking(void)
    217216{
    218   uint32_t status;
    219 
    220217  _System_state_Set( SYSTEM_STATE_UP );
    221218
     
    224221#endif
    225222
    226   _Thread_Start_multitasking( &_Thread_BSP_context );
     223  _Thread_Start_multitasking();
    227224
    228225  /*******************************************************************
     
    230227   *******************************************************************
    231228   ******                 APPLICATION RUNS HERE                 ******
    232    ******            RETURNS WHEN SYSTEM IS SHUT DOWN           ******
     229   ******              THE FUNCTION NEVER RETURNS               ******
    233230   *******************************************************************
    234231   *******************************************************************
    235232   *******************************************************************/
    236 
    237   status = _Thread_Get_global_exit_status();
    238   rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status );
    239 }
     233}
  • cpukit/sapi/src/exshutdown.c

    r92f50c3 r514705d  
    1616#include <rtems/init.h>
    1717#include <rtems/score/sysstate.h>
    18 #include <rtems/score/threadimpl.h>
    1918#include <rtems/score/interr.h>
    2019
     
    2322#endif
    2423
    25 /*
    26  *  rtems_shutdown_executive
    27  *
    28  *  This kernel routine shutdowns the executive.  It halts multitasking
    29  *  and returns control to the application execution "thread" which
    30  *  initialially invoked the rtems_initialize_executive directive.
    31  *
    32  *  Input parameters:   NONE
    33  *
    34  *  Output parameters:  NONE
    35  */
     24void rtems_shutdown_executive( uint32_t result )
     25{
     26  Internal_errors_Source  source;
     27  bool                    is_internal;
     28  Internal_errors_t       code;
    3629
    37 void rtems_shutdown_executive(
    38    uint32_t   result
    39 )
    40 {
    4130  if ( _System_state_Is_up( _System_state_Get() ) ) {
    4231    #if defined(RTEMS_SMP)
     
    4433    #endif
    4534
    46     _Thread_Set_global_exit_status( result );
    47     _Thread_Stop_multitasking();
     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;
     42  }
    4843
    49     /*******************************************************************
    50      *******************************************************************
    51      ******     RETURN TO RTEMS_INITIALIZE_START_MULTITASKING()   ******
    52      ******                 AND THEN TO BOOT_CARD()               ******
    53      *******************************************************************
    54      *******************************************************************/
    55   }
    56   _Internal_error_Occurred(
    57     INTERNAL_ERROR_CORE,
    58     true,
    59     INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP
    60   );
     44  _Internal_error_Occurred( source, is_internal, code );
     45
     46  /***************************************************************
     47   ***************************************************************
     48   *   SYSTEM SHUTS DOWN!!!  WE DO NOT RETURN TO THIS POINT!!!   *
     49   ***************************************************************
     50   ***************************************************************/
    6151}
Note: See TracChangeset for help on using the changeset viewer.