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

4.11
Last change on this file since d4dc7c8 was d4dc7c8, checked in by Jennifer Averett <Jennifer.Averett@…>, on May 26, 2011 at 6:07:07 PM

2011-05-26 Jennifer Averett <Jennifer.Averett@…>

PR 1796/cpukit

  • sapi/src/exshutdown.c, score/include/rtems/score/percpu.h, score/include/rtems/score/smp.h, score/src/smp.c, score/src/threaddispatch.c, score/src/threadhandler.c: Added SMP interprocess communications.
  • Property mode set to 100644
File size: 1.2 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    _System_state_Set( SYSTEM_STATE_SHUTDOWN );
48    _Thread_Stop_multitasking();
49  }
50  _Internal_error_Occurred(
51    INTERNAL_ERROR_CORE,
52    true,
53    INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP
54  );
55
56}
Note: See TracBrowser for help on using the repository browser.