source: rtems/cpukit/sapi/src/exshutdown.c @ 23de794d

4.115
Last change on this file since 23de794d was 5618c37a, checked in by Sebastian Huber <sebastian.huber@…>, on 07/24/13 at 13:14:48

score: Create thread implementation header

Move implementation specific parts of thread.h and thread.inl into new
header file threadimpl.h. The thread.h contains now only the
application visible API.

Remove superfluous header file includes from various files.

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*
2 *  Initialization Manager
3 *
4 *  COPYRIGHT (c) 1989-2011.
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
16#include <rtems/init.h>
17#include <rtems/score/sysstate.h>
18#include <rtems/score/threadimpl.h>
19#include <rtems/score/interr.h>
20
21#if defined(RTEMS_SMP)
22  #include <rtems/score/smp.h>
23#endif
24
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 */
36
37void rtems_shutdown_executive(
38   uint32_t   result
39)
40{
41  if ( _System_state_Is_up( _System_state_Get() ) ) {
42    #if defined(RTEMS_SMP)
43      _SMP_Request_other_cores_to_shutdown();
44    #endif
45
46    _Thread_Set_global_exit_status( result );
47    _System_state_Set( SYSTEM_STATE_SHUTDOWN );
48    _Thread_Stop_multitasking();
49
50    /*******************************************************************
51     *******************************************************************
52     ******     RETURN TO RTEMS_INITIALIZE_START_MULTITASKING()   ******
53     ******                 AND THEN TO BOOT_CARD()               ******
54     *******************************************************************
55     *******************************************************************/
56  }
57  _Internal_error_Occurred(
58    INTERNAL_ERROR_CORE,
59    true,
60    INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP
61  );
62}
Note: See TracBrowser for help on using the repository browser.