kernel: add panic() function that accepts a cpu_context
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <arch/acpi.h>
|
||||
#include <socks/printk.h>
|
||||
#include <socks/sched.h>
|
||||
#include <socks/panic.h>
|
||||
#include <socks/libc/string.h>
|
||||
#include <socks/machine/irq.h>
|
||||
#include <socks/machine/cpu.h>
|
||||
@@ -96,7 +97,7 @@ static void gpf_handler(struct cpu_context *regs)
|
||||
|
||||
static void pf_handler(struct cpu_context *regs)
|
||||
{
|
||||
printk("page fault (%016llx %016llx %016llx)", pf_faultptr(), regs->rip, regs->err_no);
|
||||
panic_irq(regs, "page fault (%016llx %016llx %016llx)", pf_faultptr(), regs->rip, regs->err_no);
|
||||
ml_halt_cpu();
|
||||
}
|
||||
|
||||
@@ -228,6 +229,8 @@ void isr_dispatch(struct cpu_context *regs)
|
||||
int_hook h = isr_handlers[regs->int_no];
|
||||
if (h) {
|
||||
h(regs);
|
||||
} else {
|
||||
panic_irq(regs, "unhandled exception %u", regs->int_no);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user