doc: provide error handling documentation

We don't really have docs on how fatal errors are induced
or handled. Provide some documentation that covers:

- Assertions (runtime and build)
- Kernel panic and oops conditions
- Stack overflows
- Other exceptions
- Exception handling policy

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2019-09-14 23:40:03 -07:00 committed by Ioannis Glaropoulos
commit 4ce988ab43
5 changed files with 282 additions and 57 deletions

View file

@ -4,12 +4,22 @@
* SPDX-License-Identifier: Apache-2.0
*/
/** @file
* @brief Fatal error functions
*/
#ifndef ZEPHYR_INCLUDE_FATAL_H
#define ZEPHYR_INCLUDE_FATAL_H
#include <arch/cpu.h>
#include <toolchain.h>
/**
* @defgroup fatal_apis Fatal error APIs
* @ingroup kernel_apis
* @{
*/
enum k_fatal_error_reason {
/** Generic CPU exception, not covered by other codes */
K_ERR_CPU_EXCEPTION,
@ -88,4 +98,6 @@ void k_sys_fatal_error_handler(unsigned int reason, const z_arch_esf_t *esf);
*/
void z_fatal_error(unsigned int reason, const z_arch_esf_t *esf);
/** @} */
#endif /* ZEPHYR_INCLUDE_FATAL_H */