8#ifndef ZEPHYR_INCLUDE_ARCH_EXCEPTION_H_
9#define ZEPHYR_INCLUDE_ARCH_EXCEPTION_H_
11#if defined(CONFIG_EXCEPTION_DUMP_HOOK)
26typedef void (*arch_exception_dump_hook_t)(
const char *format, va_list args);
36typedef void (*arch_exception_drain_hook_t)(
bool flush);
38extern arch_exception_dump_hook_t arch_exception_dump_hook;
39extern arch_exception_drain_hook_t arch_exception_drain_hook;
49static inline void arch_exception_set_dump_hook(arch_exception_dump_hook_t dump,
50 arch_exception_drain_hook_t drain)
52 arch_exception_dump_hook = dump;
53 arch_exception_drain_hook = drain;
63static inline void arch_exception_call_drain_hook(
bool flush)
65 if (arch_exception_drain_hook) {
66 arch_exception_drain_hook(flush);
79static inline void arch_exception_call_dump_hook(
const char *format, ...)
83 if (arch_exception_dump_hook) {
84 va_start(args, format);
85 arch_exception_dump_hook(format, args);
90#if defined(CONFIG_EXCEPTION_DUMP_HOOK_ONLY)
91#define EXCEPTION_DUMP(format, ...) arch_exception_call_dump_hook(format "\n", ##__VA_ARGS__)
92#elif defined(CONFIG_LOG)
93#define EXCEPTION_DUMP(format, ...) arch_exception_call_dump_hook(format "\n", ##__VA_ARGS__); \
94 LOG_ERR(format, ##__VA_ARGS__)
96#define EXCEPTION_DUMP(format, ...) arch_exception_call_dump_hook(format "\n", ##__VA_ARGS__); \
97 printk(format "\n", ##__VA_ARGS__)
102#if defined(CONFIG_LOG)
103#define EXCEPTION_DUMP(...) LOG_ERR(__VA_ARGS__)
105#define EXCEPTION_DUMP(format, ...) printk(format "\n", ##__VA_ARGS__)
109#if defined(CONFIG_X86_64)
111#elif defined(CONFIG_X86)
113#elif defined(CONFIG_ARM64)
115#elif defined(CONFIG_ARM)
117#elif defined(CONFIG_ARC)
119#elif defined(CONFIG_RISCV)
121#elif defined(CONFIG_XTENSA)
123#elif defined(CONFIG_MIPS)
125#elif defined(CONFIG_ARCH_POSIX)
127#elif defined(CONFIG_SPARC)
129#elif defined(CONFIG_RX)
ARCv2 public exception handling.
Cortex-A public exception handling.
ARM AArch32 public exception handling.
RISCV public exception handling.
Xtensa public exception handling.