The rtems_fatal_error_occurred
directive is invoked when a
fatal error is detected. Before invoking any user-supplied
fatal error handlers or the RTEMS fatal error handler, the
rtems_fatal_error_occurred
directive stores useful information in the
variable _Internal_errors_What_happened
. This structure
contains three pieces of information:
The error type indicator is dependent on the source of the error and whether or not the error was internally generated by the executive. If the error was generated from an API, then the error code will be of that API's error or status codes. The status codes for the RTEMS API are in c/src/exec/rtems/headers/status.h. Those for the POSIX API can be found in <errno.h>.
The rtems_fatal_error_occurred
directive is responsible
for invoking an optional user-supplied fatal error handler
and/or the RTEMS fatal error handler. All fatal error handlers
are passed an error code to describe the error detected.
Occasionally, an application requires more
sophisticated fatal error processing such as passing control to
a debugger. For these cases, a user-supplied fatal error
handler can be specified in the RTEMS configuration table. The
User Extension Table field fatal contains the address of the
fatal error handler to be executed when the
rtems_fatal_error_occurred
directive is called. If the field is set to NULL or if the
configured fatal error handler returns to the executive, then
the default handler provided by RTEMS is executed. This default
handler will halt execution on the processor where the error
occurred.
Copyright © 1988-1998 OAR Corporation