source: rtems/doc/user/fatal.t @ dc2b337

4.104.114.84.95
Last change on this file since dc2b337 was 169502e, checked in by Joel Sherrill <joel.sherrill@…>, on 10/11/99 at 19:03:05

Turned on concept and function name indexing.

  • Property mode set to 100644
File size: 5.3 KB
Line 
1@c
2@c  COPYRIGHT (c) 1988-1998.
3@c  On-Line Applications Research Corporation (OAR).
4@c  All rights reserved.
5@c
6@c  $Id$
7@c
8
9@chapter Fatal Error Manager
10
11@cindex fatal errors
12
13@section Introduction
14
15The fatal error manager processes all fatal or
16irrecoverable errors.  The directive provided by the fatal error
17manager is:
18
19@itemize @bullet
20@item @code{@value{DIRPREFIX}fatal_error_occurred} - Invoke the fatal error handler
21@end itemize
22
23@section Background
24
25@cindex fatal error detection
26@cindex fatal error processing
27@cindex fatal error user extension
28
29The fatal error manager is called upon detection of
30an irrecoverable error condition by either RTEMS or the
31application software.  Fatal errors can be detected from three
32sources:
33
34@itemize @bullet
35@item the executive (RTEMS)
36@item user system code
37@item user application code
38@end itemize
39
40RTEMS automatically invokes the fatal error manager
41upon detection of an error it considers to be fatal.  Similarly,
42the user should invoke the fatal error manager upon detection of
43a fatal error.
44
45Each status or dynamic user extension set may include
46a fatal error handler.  The fatal error handler in the static
47extension set can be used to provide access to debuggers and
48monitors which may be present on the target hardware.  If any
49user-supplied fatal error handlers are installed, the fatal
50error manager will invoke them.  If no user handlers are
51configured or if all the user handler return control to the
52fatal error manager, then the RTEMS default fatal error handler
53is invoked.  If the default fatal error handler is invoked, then
54the system state is marked as failed.
55
56Although the precise behavior of the default fatal
57error handler is processor specific, in general, it will disable
58all maskable interrupts, place the error code in a known
59processor dependent place (generally either on the stack or in a
60register), and halt the processor.  The precise actions of the
61RTEMS fatal error are discussed in the Default Fatal Error
62Processing chapter of the Applications Supplement document for
63a specific target processor.
64
65@section Operations
66
67@subsection Announcing a Fatal Error
68
69The @code{@value{DIRPREFIX}fatal_error_occurred} directive is invoked when a
70fatal error is detected.  Before invoking any user-supplied
71fatal error handlers or the RTEMS fatal error handler, the
72@code{@value{DIRPREFIX}fatal_error_occurred}
73directive stores useful information in the
74variable @code{_Internal_errors_What_happened}.  This @value{STRUCTURE}
75contains three pieces of information:
76
77@itemize @bullet
78@item the source of the error (API or executive core),
79
80@item whether the error was generated internally by the
81executive, and a
82
83@item a numeric code to indicate the error type.
84@end itemize
85
86The error type indicator is dependent on the source
87of the error and whether or not the error was internally
88generated by the executive.  If the error was generated
89from an API, then the error code will be of that API's
90error or status codes.  The status codes for the RTEMS
91API are in c/src/exec/rtems/headers/status.h.  Those
92for the POSIX API can be found in <errno.h>.
93
94The @code{@value{DIRPREFIX}fatal_error_occurred} directive is responsible
95for invoking an optional user-supplied fatal error handler
96and/or the RTEMS fatal error handler.  All fatal error handlers
97are passed an error code to describe the error detected.
98
99Occasionally, an application requires more
100sophisticated fatal error processing such as passing control to
101a debugger.  For these cases, a user-supplied fatal error
102handler can be specified in the RTEMS configuration table.  The
103User Extension Table field fatal contains the address of the
104fatal error handler to be executed when the
105@code{@value{DIRPREFIX}fatal_error_occurred}
106directive is called.  If the field is set to NULL or if the
107configured fatal error handler returns to the executive, then
108the default handler provided by RTEMS is executed.  This default
109handler will halt execution on the processor where the error
110occurred.
111
112@section Directives
113
114This section details the fatal error manager's
115directives.  A subsection is dedicated to each of this manager's
116directives and describes the calling sequence, related
117constants, usage, and status codes.
118
119@c
120@c
121@c
122@page
123@subsection FATAL_ERROR_OCCURRED - Invoke the fatal error handler
124
125@cindex announce fatal error
126@cindex fatal error, announce
127
128@subheading CALLING SEQUENCE:
129
130@ifset is-C
131@findex rtems_fatal_error_occurred
132@example
133void volatile rtems_fatal_error_occurred(
134  rtems_unsigned32        the_error
135);
136@end example
137@end ifset
138
139@ifset is-Ada
140@example
141procedure Fatal_Error_Occurred (
142   The_Error : in     RTEMS.Unsigned32
143);
144@end example
145@end ifset
146
147@subheading DIRECTIVE STATUS CODES
148
149NONE
150
151@subheading DESCRIPTION:
152
153This directive processes fatal errors.  If the FATAL
154error extension is defined in the configuration table, then the
155user-defined error extension is called.  If configured and the
156provided FATAL error extension returns, then the RTEMS default
157error handler is invoked.  This directive can be invoked by
158RTEMS or by the user's application code including initialization
159tasks, other tasks, and ISRs.
160
161@subheading NOTES:
162
163This directive supports local operations only.
164
165Unless the user-defined error extension takes special
166actions such as restarting the calling task, this directive WILL
167NOT RETURN to the caller.
168
169The user-defined extension for this directive may
170wish to initiate a global shutdown.
Note: See TracBrowser for help on using the repository browser.