Kernel Panic Interface
include/console/panic.h View source View on GitHubFunctions
Section titled “Functions”panic_impl_msg
Section titled “panic_impl_msg”void panic_impl_msg(
const char *file,
int line,
const char *func,
const char *fmt
) source panic_impl_code
Section titled “panic_impl_code”void panic_impl_code(
const char *file,
int line,
const char *func,
const struct crash_code *code,
const char *fmt
) source panic_impl_code_only
Section titled “panic_impl_code_only”void panic_impl_code_only(
const char *file,
int line,
const char *func,
const struct crash_code *code
) source Macros
Section titled “Macros”_panic_pick
Section titled “_panic_pick”#define _panic_pick(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, \ _13, _14, _15, _16, NAME, ...) source Expansion
#define _panic_pick(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, \
_13, _14, _15, _16, NAME, ...) \
NAME _panic_arity
Section titled “_panic_arity”#define _panic_arity(...) source _panic_fn
Section titled “_panic_fn”#define _panic_fn(a, code_fn) source Expansion
#define _panic_fn(a, code_fn) \
cc_generic((a), char * : panic_impl_msg, const char * : panic_impl_msg, \
default : code_fn) _panic_0
Section titled “_panic_0”#define _panic_0() source panic()Expansion
#define _panic_0() panic_impl_code_only(__FILE__, __LINE__, __func__, NULL) _panic_1
Section titled “_panic_1”#define _panic_1(a) source panic("msg")panic(INVALID_STATE)panic((asan, RUNTIME))more about CRASH_CODE_ARG in console/crash.h
Expansion
#define _panic_1(a) \
CRASH_CODE_SCOPED(a, _panic_fn(CRASH_CODE_ARG(a), panic_impl_code_only)( \
__FILE__, __LINE__, __func__, CRASH_CODE_ARG(a))) _panic_n
Section titled “_panic_n”#define _panic_n(a, ...) source panic("msg %d", 12)panic(INVALID_STATE, "msg %d", 12)panic((asan, RUNTIME), "msg %d", 12)Expansion
#define _panic_n(a, ...) \
CRASH_CODE_SCOPED( \
a, _panic_fn(CRASH_CODE_ARG(a), panic_impl_code)( \
__FILE__, __LINE__, __func__, CRASH_CODE_ARG(a), __VA_ARGS__)) #define panic(...) source Expansion
#define panic(...) _panic_arity(__VA_ARGS__)(__VA_ARGS__)