source:
rtems/cpukit/score/src/interr.c
@
25f5730f
Last change on this file since 25f5730f was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47 | |
---|---|
|
|
File size: 1.2 KB |
Rev | Line | |
---|---|---|
[bf54252] | 1 | /** |
2 | * @file | |
[3a4ae6c] | 3 | * |
[bf54252] | 4 | * @brief Initiates system termination |
5 | * @ingroup ScoreIntErr | |
6 | */ | |
7 | ||
8 | /* | |
[08311cc3] | 9 | * COPYRIGHT (c) 1989-1999. |
[3a4ae6c] | 10 | * On-Line Applications Research Corporation (OAR). |
11 | * | |
[98e4ebf5] | 12 | * The license and distribution terms for this file may be |
13 | * found in the file LICENSE in this distribution or at | |
[c499856] | 14 | * http://www.rtems.org/license/LICENSE. |
[3a4ae6c] | 15 | */ |
16 | ||
[a8eed23] | 17 | #if HAVE_CONFIG_H |
18 | #include "config.h" | |
19 | #endif | |
20 | ||
[5e9b32b] | 21 | #include <rtems/score/interr.h> |
[38ee758] | 22 | #include <rtems/score/isrlevel.h> |
[6ca4f6a] | 23 | #include <rtems/score/smpimpl.h> |
[5e9b32b] | 24 | #include <rtems/score/sysstate.h> |
[3be0c9a] | 25 | #include <rtems/score/userextimpl.h> |
[3a4ae6c] | 26 | |
[ecf9858] | 27 | System_state_Codes _System_state_Current; |
28 | ||
29 | Internal_errors_Information _Internal_errors_What_happened; | |
30 | ||
[83bf105] | 31 | void _Terminate( |
[3a4ae6c] | 32 | Internal_errors_Source the_source, |
[484a769] | 33 | bool is_internal, |
[749d64a] | 34 | Internal_errors_t the_error |
[3a4ae6c] | 35 | ) |
36 | { | |
[38ee758] | 37 | ISR_Level level; |
38 | ||
39 | _ISR_Disable_without_giant( level ); | |
40 | (void) level; | |
41 | ||
[7336be9d] | 42 | _SMP_Request_shutdown(); |
[8a6de83] | 43 | |
[1906a36] | 44 | _User_extensions_Fatal( the_source, is_internal, the_error ); |
[3a4ae6c] | 45 | |
[38baeb7] | 46 | _Internal_errors_What_happened.the_source = the_source; |
47 | _Internal_errors_What_happened.is_internal = is_internal; | |
48 | _Internal_errors_What_happened.the_error = the_error; | |
[3a4ae6c] | 49 | |
[92f50c3] | 50 | _System_state_Set( SYSTEM_STATE_TERMINATED ); |
[3a4ae6c] | 51 | |
52 | _CPU_Fatal_halt( the_error ); | |
53 | ||
54 | /* will not return from this routine */ | |
[aae7f1a1] | 55 | while (true); |
[3a4ae6c] | 56 | } |
Note: See TracBrowser
for help on using the repository browser.