diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-04-21 09:29:29 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-04-21 09:35:58 +0200 |
commit | 62ca9c1bc3e09119aaed095dc709f7712d8b3997 (patch) | |
tree | 17640f61f07c4c2de57031a11ab2fd295ac23b5f /c-user/fatal-error/operations.rst | |
parent | c-user: Split up initialization manager (diff) | |
download | rtems-docs-62ca9c1bc3e09119aaed095dc709f7712d8b3997.tar.bz2 |
c-user: Split up fatal error manager
This makes it easier to automatically generate parts of the module
documentation in the future.
Update #3993.
Diffstat (limited to 'c-user/fatal-error/operations.rst')
-rw-r--r-- | c-user/fatal-error/operations.rst | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/c-user/fatal-error/operations.rst b/c-user/fatal-error/operations.rst new file mode 100644 index 0000000..77753d6 --- /dev/null +++ b/c-user/fatal-error/operations.rst @@ -0,0 +1,51 @@ +.. SPDX-License-Identifier: CC-BY-SA-4.0 + +.. Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) + +Operations +========== + +.. index:: _Terminate + +.. _Terminate: + +Announcing a Fatal Error +------------------------ + +The :c:func:`_Terminate()` internal error handler is invoked when the +application or the executive itself determines that a fatal error has occurred +or a final system state is reached (for example after :c:func:`rtems_fatal()` +or :c:func:`exit()`). + +The first action of the internal error handler is to call the fatal extension of +the user extensions. For the initial extensions the following conditions are +required + +- a valid stack pointer and enough stack space, + +- a valid code memory, and + +- valid read-only data. + +For the initial extensions the read-write data (including .bss segment) is not +required on single processor configurations. In SMP configurations, however, +the read-write data must be initialized since this function must determine the +state of the other processors and request them to shut-down if necessary. + +Non-initial extensions require in addition valid read-write data. The board +support package (BSP) may install an initial extension that performs a system +reset. In this case the non-initial extensions will be not called. + +The fatal extensions are called with three parameters: + +- the fatal source, + +- a legacy parameter which is always false, and + +- an error code with a fatal source dependent content. + +Once all fatal extensions executed, the error information will be stored to +:c:data:`_Internal_errors_What_happened` and the system state is set to +:c:macro:`SYSTEM_STATE_TERMINATED`. + +The final step is to call the CPU port specific :c:func:`_CPU_Fatal_halt()`. |