The friendly Operating System for the Internet of Things
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
28  extern "C" {
29 #endif
30 
34 typedef enum {
35  PANIC_GENERAL_ERROR,
36  PANIC_SOFT_REBOOT,
37  PANIC_HARD_REBOOT,
38  PANIC_ASSERT_FAIL,
39 #ifdef MODULE_CORTEXM_COMMON
40  PANIC_NMI_HANDLER,
41  PANIC_HARD_FAULT,
42 #if defined(CPU_ARCH_CORTEX_M3) || defined(CPU_ARCH_CORTEX_M4) || \
43  defined(CPU_ARCH_CORTEX_M4F)
44  PANIC_MEM_MANAGE,
45  PANIC_BUS_FAULT,
46  PANIC_USAGE_FAULT,
47  PANIC_DEBUG_MON,
48 #endif
49  PANIC_DUMMY_HANDLER,
50 #endif
51  PANIC_UNDEFINED
52 } core_panic_t;
53 
74 NORETURN void core_panic(core_panic_t crash_code, const char *message);
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif /* PANIC_H */
81 
core_panic_t
Definition of available panic modes.
Definition: panic.h:34
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.
#define NORETURN
The NORETURN keyword tells the compiler to assume that the function cannot return.