RTEMS Logo

RTEMS 4.7.99.2 On-Line Library


Fatal Error Manager Announcing a Fatal Error

PREV UP NEXT Bookshelf RTEMS Ada User's Guide

17.3.1: Announcing a Fatal Error

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 record 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 cpukit/rtems/include/rtems/rtems/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.


PREV UP NEXT Bookshelf RTEMS Ada User's Guide

Copyright © 1988-2004 OAR Corporation