kernel: add panic() function that accepts a cpu_context

This commit is contained in:
2023-05-03 19:22:12 +01:00
parent 390fe86657
commit a52571eb19
3 changed files with 11 additions and 4 deletions

View File

@@ -7,7 +7,7 @@
static int has_panicked = 0;
void panic(const char *fmt, ...)
void panic_irq(struct cpu_context *ctx, const char *fmt, ...)
{
char buf[512];
va_list args;
@@ -29,7 +29,7 @@ void panic(const char *fmt, ...)
printk("cpu: %u", this_cpu());
ml_print_cpu_state(NULL);
ml_print_cpu_state(ctx);
if (READ_ONCE(has_panicked)) {
ml_halt_cpu();