8#ifndef ZEPHYR_INCLUDE_ARCH_EXCEPTION_H_
9#define ZEPHYR_INCLUDE_ARCH_EXCEPTION_H_
13#if defined(CONFIG_EXCEPTION_DUMP_HOOK)
28typedef void (*arch_exception_dump_hook_t)(
const char *format, va_list args);
38typedef void (*arch_exception_drain_hook_t)(
bool flush);
40extern arch_exception_dump_hook_t arch_exception_dump_hook;
41extern arch_exception_drain_hook_t arch_exception_drain_hook;
51static inline void arch_exception_set_dump_hook(arch_exception_dump_hook_t dump,
52 arch_exception_drain_hook_t drain)
54 arch_exception_dump_hook = dump;
55 arch_exception_drain_hook = drain;
65static inline void arch_exception_call_drain_hook(
bool flush)
67 if (arch_exception_drain_hook) {
68 arch_exception_drain_hook(flush);
81static inline void arch_exception_call_dump_hook(
const char *format, ...)
85 if (arch_exception_dump_hook) {
86 va_start(args, format);
87 arch_exception_dump_hook(format, args);
92#if defined(CONFIG_EXCEPTION_DUMP_HOOK_ONLY)
93#define EXCEPTION_DUMP(format, ...) arch_exception_call_dump_hook(format "\n", ##__VA_ARGS__)
94#elif defined(CONFIG_LOG)
95#define EXCEPTION_DUMP(format, ...) arch_exception_call_dump_hook(format "\n", ##__VA_ARGS__); \
96 LOG_ERR(format, ##__VA_ARGS__)
98#define EXCEPTION_DUMP(format, ...) arch_exception_call_dump_hook(format "\n", ##__VA_ARGS__); \
99 printk(format "\n", ##__VA_ARGS__)
104#if defined(CONFIG_LOG)
105#define EXCEPTION_DUMP(...) LOG_ERR(__VA_ARGS__)
107#define EXCEPTION_DUMP(format, ...) printk(format "\n", ##__VA_ARGS__)
113#if defined(CONFIG_X86_64)
115#elif defined(CONFIG_X86)
117#elif defined(CONFIG_ARM64)
119#elif defined(CONFIG_ARM)
121#elif defined(CONFIG_ARC)
123#elif defined(CONFIG_RISCV)
125#elif defined(CONFIG_XTENSA)
127#elif defined(CONFIG_MIPS)
129#elif defined(CONFIG_ARCH_POSIX)
131#elif defined(CONFIG_SPARC)
133#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.