source: rtems/cpukit/sapi/src/exshutdown.c @ 10e348ab

4.115
Last change on this file since 10e348ab was 4c98a3e, checked in by Christopher Kerl <zargyyoyo@…>, on 12/07/12 at 14:49:54

sapi misc: Clean up Doxygen GCI task #1

http://www.google-melange.com/gci/task/view/google/gci2012/8011204

  • 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/system.h>
17#include <rtems/init.h>
18#include <rtems/score/sysstate.h>
19#include <rtems/score/thread.h>
20#include <rtems/score/interr.h>
21
22#if defined(RTEMS_SMP)
23  #include <rtems/score/smp.h>
24#endif
25
26/*
27 *  rtems_shutdown_executive
28 *
29 *  This kernel routine shutdowns the executive.  It halts multitasking
30 *  and returns control to the application execution "thread" which
31 *  initialially invoked the rtems_initialize_executive directive.
32 *
33 *  Input parameters:   NONE
34 *
35 *  Output parameters:  NONE
36 */
37
38void rtems_shutdown_executive(
39   uint32_t   result
40)
41{
42  if ( _System_state_Is_up( _System_state_Get() ) ) {
43    #if defined(RTEMS_SMP)
44      _SMP_Request_other_cores_to_shutdown();
45    #endif
46
47    _Per_CPU_Information[0].idle->Wait.return_code = result;
48
49    _System_state_Set( SYSTEM_STATE_SHUTDOWN );
50    _Thread_Stop_multitasking();
51
52    /*******************************************************************
53     *******************************************************************
54     ******     RETURN TO RTEMS_INITIALIZE_START_MULTITASKING()   ******
55     ******                 AND THEN TO BOOT_CARD()               ******
56     *******************************************************************
57     *******************************************************************/
58  }
59  _Internal_error_Occurred(
60    INTERNAL_ERROR_CORE,
61    true,
62    INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP
63  );
64}
Note: See TracBrowser for help on using the repository browser.