[3a4ae6c] | 1 | /* |
---|
| 2 | * Internal Error Handler |
---|
| 3 | * |
---|
[08311cc3] | 4 | * COPYRIGHT (c) 1989-1999. |
---|
[3a4ae6c] | 5 | * On-Line Applications Research Corporation (OAR). |
---|
| 6 | * |
---|
[98e4ebf5] | 7 | * The license and distribution terms for this file may be |
---|
| 8 | * found in the file LICENSE in this distribution or at |
---|
[dd687d97] | 9 | * http://www.rtems.com/license/LICENSE. |
---|
[3a4ae6c] | 10 | * |
---|
| 11 | * $Id$ |
---|
| 12 | */ |
---|
| 13 | |
---|
[a8eed23] | 14 | #if HAVE_CONFIG_H |
---|
| 15 | #include "config.h" |
---|
| 16 | #endif |
---|
| 17 | |
---|
[3a4ae6c] | 18 | #include <rtems/system.h> |
---|
[5e9b32b] | 19 | #include <rtems/score/interr.h> |
---|
| 20 | #include <rtems/score/sysstate.h> |
---|
| 21 | #include <rtems/score/userext.h> |
---|
[3a4ae6c] | 22 | |
---|
| 23 | /*PAGE |
---|
| 24 | * |
---|
| 25 | * _Internal_error_Occurred |
---|
| 26 | * |
---|
| 27 | * This routine will invoke the fatal error handler supplied by the user |
---|
| 28 | * followed by the the default one provided by the executive. The default |
---|
| 29 | * error handler assumes no hardware is present to help inform the user |
---|
| 30 | * of the problem. Halt stores the error code in a known register, |
---|
| 31 | * disables interrupts, and halts the CPU. If the CPU does not have a |
---|
| 32 | * halt instruction, it will loop to itself. |
---|
| 33 | * |
---|
| 34 | * Input parameters: |
---|
| 35 | * the_source - what subsystem the error originated in |
---|
| 36 | * is_internal - if the error was internally generated |
---|
| 37 | * the_error - fatal error status code |
---|
| 38 | * |
---|
| 39 | * Output parameters: |
---|
| 40 | * As much information as possible is stored in a CPU dependent fashion. |
---|
| 41 | * See the CPU dependent code for more information. |
---|
| 42 | * |
---|
| 43 | * NOTE: The the_error is not necessarily a directive status code. |
---|
| 44 | */ |
---|
| 45 | |
---|
[d0bb8f3] | 46 | void _Internal_error_Occurred( |
---|
[3a4ae6c] | 47 | Internal_errors_Source the_source, |
---|
[484a769] | 48 | bool is_internal, |
---|
[3127180] | 49 | uint32_t the_error |
---|
[3a4ae6c] | 50 | ) |
---|
| 51 | { |
---|
| 52 | |
---|
[38baeb7] | 53 | _Internal_errors_What_happened.the_source = the_source; |
---|
| 54 | _Internal_errors_What_happened.is_internal = is_internal; |
---|
| 55 | _Internal_errors_What_happened.the_error = the_error; |
---|
[3a4ae6c] | 56 | |
---|
| 57 | _User_extensions_Fatal( the_source, is_internal, the_error ); |
---|
| 58 | |
---|
| 59 | _System_state_Set( SYSTEM_STATE_FAILED ); |
---|
| 60 | |
---|
| 61 | _CPU_Fatal_halt( the_error ); |
---|
| 62 | |
---|
| 63 | /* will not return from this routine */ |
---|
[aae7f1a1] | 64 | while (true); |
---|
[3a4ae6c] | 65 | } |
---|