Loading...
Searching...
No Matches
panic.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2014, 2015 INRIA
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
22#ifndef PANIC_H
23#define PANIC_H
24
25#include "kernel_defines.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
34typedef enum {
35 PANIC_GENERAL_ERROR,
36 PANIC_SOFT_REBOOT,
37 PANIC_HARD_REBOOT,
38 PANIC_ASSERT_FAIL,
39 PANIC_EXPECT_FAIL,
41#ifdef MODULE_CORTEXM_COMMON
42 PANIC_NMI_HANDLER,
43 PANIC_HARD_FAULT,
44#if defined(CPU_CORE_CORTEX_M3) || defined(CPU_CORE_CORTEX_M33) || \
45 defined(CPU_CORE_CORTEX_M4) || defined(CPU_CORE_CORTEX_M4F) || \
46 defined(CPU_CORE_CORTEX_M7)
47 PANIC_BUS_FAULT,
48 PANIC_USAGE_FAULT,
49 PANIC_DEBUG_MON,
50#endif
51 PANIC_DUMMY_HANDLER,
52#endif
55 PANIC_UNDEFINED
57
78NORETURN void core_panic(core_panic_t crash_code, const char *message);
79
86void panic_arch(void);
87
88#ifdef __cplusplus
89}
90#endif
91
92#endif /* PANIC_H */
#define NORETURN
The NORETURN keyword tells the compiler to assume that the function cannot return.
Common macros and compiler attributes/pragmas configuration.
NORETURN void core_panic(core_panic_t crash_code, const char *message)
Handle an unrecoverable error by halting or rebooting the system.
void panic_arch(void)
architecture dependent handling of a panic case
core_panic_t
Definition of available panic modes.
Definition panic.h:34
@ PANIC_SSP
stack smashing protector failure
Definition panic.h:53
@ PANIC_MEM_MANAGE
memory management fault
Definition panic.h:40
@ PANIC_STACK_OVERFLOW
stack overflow detected
Definition panic.h:54