1 | /* |
---|
2 | * Fatal Error Manager |
---|
3 | * |
---|
4 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
5 | * On-Line Applications Research Corporation (OAR). |
---|
6 | * All rights assigned to U.S. Government, 1994. |
---|
7 | * |
---|
8 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
9 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
10 | * notice must appear in all copies of this file and its derivatives. |
---|
11 | * |
---|
12 | * $Id$ |
---|
13 | */ |
---|
14 | |
---|
15 | #include <rtems/system.h> |
---|
16 | #include <rtems/config.h> |
---|
17 | #include <rtems/fatal.h> |
---|
18 | #include <rtems/sysstate.h> |
---|
19 | #include <rtems/userext.h> |
---|
20 | |
---|
21 | /*PAGE |
---|
22 | * |
---|
23 | * rtems_fatal_error_occurred |
---|
24 | * |
---|
25 | * This directive will invoke the fatal error handler supplied by the user |
---|
26 | * followed by the the default one provided by the executive. The default |
---|
27 | * error handler assumes no hardware is present to help inform the user |
---|
28 | * of the problem. Halt stores the error code in a known register, |
---|
29 | * disables interrupts, and halts the CPU. If the CPU does not have a |
---|
30 | * halt instruction, it will loop to itself. |
---|
31 | * |
---|
32 | * Input parameters: |
---|
33 | * the_error - fatal error status code |
---|
34 | * |
---|
35 | * Output parameters: |
---|
36 | * the_error - on stack |
---|
37 | * status register - on stack |
---|
38 | * |
---|
39 | * NOTE: The the_error is not necessarily a directive status code. |
---|
40 | */ |
---|
41 | |
---|
42 | void volatile rtems_fatal_error_occurred( |
---|
43 | unsigned32 the_error |
---|
44 | ) |
---|
45 | { |
---|
46 | |
---|
47 | _User_extensions_Fatal( the_error ); |
---|
48 | |
---|
49 | _System_state_Set( SYSTEM_STATE_FAILED ); |
---|
50 | |
---|
51 | _CPU_Fatal_halt( the_error ); |
---|
52 | |
---|
53 | /* will not return from this routine */ |
---|
54 | } |
---|