source: rtems/doc/new_chapters/error.t @ d82f3e81

4.104.114.84.95
Last change on this file since d82f3e81 was d82f3e81, checked in by Joel Sherrill <joel.sherrill@…>, on 11/19/98 at 16:05:05

New files

  • Property mode set to 100644
File size: 4.0 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 Error Reporting Support
10
11@section Introduction
12
13These error reporting facilities are an RTEMS support
14component that provide convenient facilities for handling
15error conditions in an RTEMS application.
16of each task using a period.  The services provided by the error
17reporting support component are:
18
19@itemize @bullet
20@item @code{rtems_error} - Report an Error
21@item @code{rtems_panic} - Report an Error and Panic
22@item @code{rtems_status_text} - ASCII Version of RTEMS Status
23@end itemize
24
25@section Background
26
27@subsection Error Handling in an Embedded System
28
29Error handling in an embedded system is a difficult problem.  If the error
30is severe, then the only recourse is to shut the system down in a safe
31manner.  Other errors can be detected and compensated for.  The
32error reporting routines in this support component -- @code{rtems_error}
33and @code{rtems_panic} assume that if the error is severe enough,
34then the system should be shutdown.  If a simple shutdown with
35some basic diagnostic information is not sufficient, then
36these routines should not be used in that particular system.  In this case,
37use the @code{rtems_status_text} routine to construct an application
38specific error reporting routine.
39
40@section Operations
41
42@subsection Reporting an Error
43
44The @code{rtems_error} and @code{rtems_panic} routines
45can be used to print some diagnostic information and
46shut the system down.  The @code{rtems_error} routine
47is invoked with a user specified error level indicator.
48This error indicator is used to determine if the system
49should be shutdown after reporting this error.
50
51@section Routines
52
53This section details the error reporting support compenent's routine.
54A subsection is dedicated to each of this manager's routines
55and describes the calling sequence, related constants, usage,
56and status codes.
57
58@page
59@subsection rtems_status_text - ASCII Version of RTEMS Status
60
61@subheading CALLING SEQUENCE:
62
63@ifset is-C
64@example
65const char *rtems_status_text(
66  rtems_status_code status
67);
68@end example
69@end ifset
70
71@ifset is-Ada
72@example
73An Ada interface is not currently available.
74@end example
75@end ifset
76
77@subheading STATUS CODES:
78
79Returns a pointer to a constant string that describes the given
80RTEMS status code.
81
82@subheading DESCRIPTION:
83
84This routine returns a pointer to a string that describes
85the RTEMS status code specified by @code{status}.
86
87@subheading NOTES:
88
89NONE
90
91@page
92@subsection rtems_error - Report an Error
93
94@subheading CALLING SEQUENCE:
95
96@ifset is-C
97@example
98int rtems_error(
99  int         error_code,
100  const char *printf_format,
101  ...
102);
103@end example
104@end ifset
105
106@ifset is-Ada
107@example
108An Ada interface is not currently available.
109@end example
110@end ifset
111
112@subheading STATUS CODES:
113
114Returns the number of characters written.
115
116@subheading DESCRIPTION:
117
118This routine prints the requested information as specified by the
119@code{printf_format} parameter and the zero or more optional arguments
120following that parameter.  The @code{error_code} parameter is an error
121number with either @code{RTEMS_ERROR_PANIC} or @code{RTEMS_ERROR_ABORT}
122bitwise or'ed with it.  If the @code{RTEMS_ERROR_PANIC} bit is set, then
123then the system is system is shutdown via a call to @code{_exit}. 
124If the @code{RTEMS_ERROR_ABORT} bit is set, then
125then the system is system is shutdown via a call to @code{abort}.
126
127@subheading NOTES:
128
129NONE
130
131@page
132@subsection rtems_panic - Report an Error and Panic
133
134@subheading CALLING SEQUENCE:
135
136@ifset is-C
137@example
138int rtems_panic(
139   const char *printf_format,
140   ...
141);
142@end example
143@end ifset
144
145@ifset is-Ada
146@example
147An Ada interface is not currently available.
148@end example
149@end ifset
150
151@subheading STATUS CODES:
152
153Returns the number of characters written.
154
155@subheading DESCRIPTION:
156
157This routine is a wrapper for the @code{rtems_error} routine with
158an implied error level of @code{RTEMS_ERROR_PANIC}.  See
159@code{rtems_error} for more information.
160
161@subheading NOTES:
162
163NONE
164
Note: See TracBrowser for help on using the repository browser.