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

4.11
Last change on this file since 7299818 was 7299818, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 10, 2010 at 10:56:35 PM

2010-08-10 Joel Sherrill <joel.sherrill@…>

PR 1658/cpukit

  • sapi/src/exshutdown.c, score/include/rtems/score/interr.h: If the system is not up, consider it a fatal error.
  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  Initialization Manager
3 *
4 *  COPYRIGHT (c) 1989-1999.
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/*
24 *  rtems_shutdown_executive
25 *
26 *  This kernel routine shutdowns the executive.  It halts multitasking
27 *  and returns control to the application execution "thread" which
28 *  initialially invoked the rtems_initialize_executive directive.
29 *
30 *  Input parameters:   NONE
31 *
32 *  Output parameters:  NONE
33 */
34
35void rtems_shutdown_executive(
36   uint32_t   result
37)
38{
39  if ( _System_state_Is_up( _System_state_Get() ) ) {
40    _System_state_Set( SYSTEM_STATE_SHUTDOWN );
41    _Thread_Stop_multitasking();
42  }
43  _Internal_error_Occurred(
44    INTERNAL_ERROR_CORE,
45    true,
46    INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP
47  );
48
49}
Note: See TracBrowser for help on using the repository browser.