5#include "mos/platform/platform_defs.h"
30#define MOS_EMIT_PANIC_HOOK(e, f, n) MOS_PUT_IN_SECTION(".mos.panic_hooks", panic_hook_t, f##_hook, { .enabled = e, .hook = f, .name = n })
32#define MOS_PANIC_HOOK_FEAT(_feat, _f, _n) MOS_EMIT_PANIC_HOOK(mos_debug_enabled_ptr(_feat), _f, _n)
33#define MOS_PANIC_HOOK(_f, _name) MOS_EMIT_PANIC_HOOK(NULL, _f, _name)
47#define MOS_MAKE_PANIC_POINT(panic_instruction, file, func, line) \
48 __asm__ volatile("1: " panic_instruction "\n\t" \
49 ".pushsection .mos.panic_list,\"aw\"\n\t" MOS_PLATFORM_PANIC_POINT_ASM ".popsection\n\t" \
52 : "i"(file), "i"(func), "i"(line) \
55#define mos_panic(fmt, ...) \
58 pr_emerg(fmt, ##__VA_ARGS__); \
59 MOS_MAKE_PANIC_POINT(MOS_PLATFORM_PANIC_INSTR, __FILE__, __func__, __LINE__); \
60 __builtin_unreachable(); \
63#define mos_panic_inline(fmt, ...) \
66 pr_emerg(fmt, ##__VA_ARGS__); \
67 static const panic_point_t point = { .ip = 0, .file = __FILE__, .line = __LINE__, .func = __func__ }; \
68 try_handle_kernel_panics_at(&point); \
MOSAPI void(1, 2) fatal_abort(const char *fmt
#define MOS_STATIC_ASSERT
void mos_kwarn(const char *func, u32 line, const char *fmt,...)
void kwarn_handler_set(kmsg_handler_t *handler)
void try_handle_kernel_panics_at(const panic_point_t *point)
void kmsg_handler_t(const char *func, u32 line, const char *fmt, va_list args)
u32 const char void try_handle_kernel_panics(ptr_t ip)
void kwarn_handler_remove(void)