summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/interr.c
blob: 5908381c673ae6a7d37331038bc3fe1379e067d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
 * @file
 *
 * @brief Initiates system termination
 * @ingroup RTEMSScoreIntErr
 */

/*
 *  COPYRIGHT (c) 1989-1999.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.org/license/LICENSE.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <rtems/score/interr.h>
#include <rtems/score/smpimpl.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/userextimpl.h>

System_state_Codes _System_state_Current;

Internal_errors_Information _Internal_errors_What_happened;

void _Terminate(
  Internal_errors_Source the_source,
  Internal_errors_t      the_error
)
{
  _User_extensions_Fatal( the_source, the_error );

  _Internal_errors_What_happened.the_source = the_source;
  _Internal_errors_What_happened.the_error  = the_error;

  _System_state_Set( SYSTEM_STATE_TERMINATED );

  _SMP_Request_shutdown();

  _CPU_Fatal_halt( the_source, the_error );

  /* will not return from this routine */
  while (true);
}

void _Internal_error( Internal_errors_Core_list core_error )
{
  _Terminate( INTERNAL_ERROR_CORE, core_error );
}