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

4.104.114.84.95
Last change on this file since ae68ff0 was ae68ff0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/27/97 at 12:40:11

Initial revision

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