From d3924f541f36bc08fed87f25ec7fc6e64b86e511 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 15 Jan 2021 16:33:13 +0100 Subject: Fixed kernel exceptions --- kernel/drivers/interrupts.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'kernel/drivers') diff --git a/kernel/drivers/interrupts.c b/kernel/drivers/interrupts.c index 29ff55d..4c5c3b7 100644 --- a/kernel/drivers/interrupts.c +++ b/kernel/drivers/interrupts.c @@ -170,11 +170,7 @@ void isr_uninstall_handler(int isr) void isr_handler(struct regs *r) { - // Execute fault handler if exists - void (*handler)(struct regs * r) = isr_routines[r->int_no]; - if (handler) { - handler(r); - } else if (r->int_no <= 32) { + if (r->int_no <= 32) { printf("%s Exception, exiting!\n", isr_exceptions[r->int_no]); struct proc *proc = proc_current(); if (proc) @@ -182,6 +178,11 @@ void isr_handler(struct regs *r) else __asm__ volatile("cli\nhlt"); proc_yield(r); + } else { + // Execute fault handler if exists + void (*handler)(struct regs * r) = isr_routines[r->int_no]; + if (handler) + handler(r); } } -- cgit v1.2.3