1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Fatal API. |
---|
5 | */ |
---|
6 | |
---|
7 | /* |
---|
8 | * COPYRIGHT (c) 1989-2011. |
---|
9 | * On-Line Applications Research Corporation (OAR). |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.com/license/LICENSE. |
---|
14 | */ |
---|
15 | |
---|
16 | #ifndef _RTEMS_FATAL_H |
---|
17 | #define _RTEMS_FATAL_H |
---|
18 | |
---|
19 | #include <rtems/score/basedefs.h> /* RTEMS_COMPILER_NO_RETURN_ATTRIBUTE */ |
---|
20 | #include <rtems/extension.h> |
---|
21 | |
---|
22 | #ifdef __cplusplus |
---|
23 | extern "C" { |
---|
24 | #endif |
---|
25 | |
---|
26 | /** |
---|
27 | * @defgroup ClassicFatal Fatal |
---|
28 | * |
---|
29 | * @ingroup ClassicRTEMS |
---|
30 | * |
---|
31 | * @brief The Fatal Manager provides functions for fatal system states and or |
---|
32 | * irrecoverable errors. |
---|
33 | * |
---|
34 | * @{ |
---|
35 | */ |
---|
36 | |
---|
37 | /** |
---|
38 | * @brief Exception frame. |
---|
39 | */ |
---|
40 | typedef CPU_Exception_frame rtems_exception_frame; |
---|
41 | |
---|
42 | /** |
---|
43 | * @brief Prints the exception frame via printk(). |
---|
44 | * |
---|
45 | * @see rtems_fatal() and RTEMS_FATAL_SOURCE_EXCEPTION. |
---|
46 | */ |
---|
47 | static inline void rtems_exception_frame_print( |
---|
48 | const rtems_exception_frame *frame |
---|
49 | ) |
---|
50 | { |
---|
51 | _CPU_Exception_frame_print( frame ); |
---|
52 | } |
---|
53 | |
---|
54 | /** |
---|
55 | * @brief Invokes the internal error handler with a source of |
---|
56 | * INTERNAL_ERROR_RTEMS_API and is internal set to false. |
---|
57 | * |
---|
58 | * @param[in] the_error is a 32-bit fatal error code. |
---|
59 | * |
---|
60 | * @see _Internal_error_Occurred(). |
---|
61 | */ |
---|
62 | void rtems_fatal_error_occurred( |
---|
63 | uint32_t the_error |
---|
64 | ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; |
---|
65 | |
---|
66 | /** |
---|
67 | * @brief Invokes the internal error handler with is internal set to false. |
---|
68 | * |
---|
69 | * @param[in] source is the fatal source. |
---|
70 | * @param[in] error is the fatal code. |
---|
71 | * |
---|
72 | * @see _Internal_error_Occurred(). |
---|
73 | */ |
---|
74 | void rtems_fatal( |
---|
75 | rtems_fatal_source source, |
---|
76 | rtems_fatal_code error |
---|
77 | ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; |
---|
78 | |
---|
79 | /** |
---|
80 | * @brief Returns a description for a fatal source. |
---|
81 | * |
---|
82 | * @param[in] source is the fatal source. |
---|
83 | * |
---|
84 | * @retval description The fatal source description. |
---|
85 | * @retval ? The passed fatal source is invalid. |
---|
86 | */ |
---|
87 | const char *rtems_fatal_source_description( rtems_fatal_source source ); |
---|
88 | |
---|
89 | /** |
---|
90 | * @brief Returns a description for an internal error code. |
---|
91 | * |
---|
92 | * @param[in] error is the error code. |
---|
93 | * |
---|
94 | * @retval description The error code description. |
---|
95 | * @retval ? The passed error code is invalid. |
---|
96 | */ |
---|
97 | const char *rtems_internal_error_description( rtems_fatal_code error ); |
---|
98 | |
---|
99 | /** @} */ |
---|
100 | |
---|
101 | #ifdef __cplusplus |
---|
102 | } |
---|
103 | #endif |
---|
104 | |
---|
105 | #endif |
---|
106 | /* end of include file */ |
---|