diff options
Diffstat (limited to 'kernel/drivers/interrupts.c')
-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); } } |