x86_64: print stack trace during panic

This commit is contained in:
2023-05-06 22:18:34 +01:00
parent 90afd997e6
commit 6cf8f4234a
4 changed files with 75 additions and 3 deletions

View File

@@ -37,6 +37,13 @@ void panic_irq(struct cpu_context *ctx, const char *fmt, ...)
WRITE_ONCE(has_panicked, 1);
if (ctx) {
ml_print_stack_trace_irq(ctx);
} else {
uintptr_t ip = (uintptr_t)__builtin_return_address(0);
ml_print_stack_trace(ip);
}
printk("---[ end kernel panic: %s", buf);
ml_halt_cpu();
}