diff options
author | Marvin Borner | 2021-01-15 16:33:13 +0100 |
---|---|---|
committer | Marvin Borner | 2021-01-15 16:33:13 +0100 |
commit | d3924f541f36bc08fed87f25ec7fc6e64b86e511 (patch) | |
tree | 7a6f568e9d2447b0aa6cc8dfb13ead21e1c602b9 /kernel | |
parent | 388b3fa1bd8af8c5df6aef8447ffd2a8b2cb9300 (diff) |
Fixed kernel exceptions
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/drivers/interrupts.c | 11 |
1 files changed, 6 insertions, 5 deletions
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); } } |