source: rtems/cpukit/sapi/src/exshutdown.c @ f58ef8ae

4.115
Last change on this file since f58ef8ae was f58ef8ae, checked in by Joel Sherrill <joel.sherrill@…>, on Jul 13, 2011 at 6:34:22 PM

2011-07-13 Joel Sherrill <joel.sherrilL@…>

PR 1824/cpukit

  • sapi/include/rtems/init.h, sapi/src/exinit.c, sapi/src/exshutdown.c: Return exit/shutdown status back to boot_card().
  • Property mode set to 100644
File size: 1.3 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 *  $Id$
12 */
13
14#if HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <rtems/system.h>
19#include <rtems/score/sysstate.h>
20#include <rtems/score/thread.h>
21#include <rtems/score/interr.h>
22
23#if defined(RTEMS_SMP)
24  #include <rtems/score/smp.h>
25#endif
26
27/*
28 *  rtems_shutdown_executive
29 *
30 *  This kernel routine shutdowns the executive.  It halts multitasking
31 *  and returns control to the application execution "thread" which
32 *  initialially invoked the rtems_initialize_executive directive.
33 *
34 *  Input parameters:   NONE
35 *
36 *  Output parameters:  NONE
37 */
38
39void rtems_shutdown_executive(
40   uint32_t   result
41)
42{
43  if ( _System_state_Is_up( _System_state_Get() ) ) {
44    #if defined(RTEMS_SMP)
45      _SMP_Request_other_cores_to_shutdown();
46    #endif
47
48    _Per_CPU_Information[0].idle->Wait.return_code = result;
49
50    _System_state_Set( SYSTEM_STATE_SHUTDOWN );
51    _Thread_Stop_multitasking();
52  }
53  _Internal_error_Occurred(
54    INTERNAL_ERROR_CORE,
55    true,
56    INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP
57  );
58
59}
Note: See TracBrowser for help on using the repository browser.