Do not crash on handled traps.

This commit is contained in:
Danila Fedorin 2019-04-23 16:31:01 -07:00
parent eae0475758
commit f0e2ab8abd

View File

@ -198,8 +198,10 @@ trap_dispatch(struct Trapframe *tf)
// LAB 3: Your code here.
if (tf->tf_trapno == T_PGFLT) {
page_fault_handler(tf);
return;
} else if (tf->tf_trapno == T_BRKPT) {
monitor(tf);
return;
} else if (tf->tf_trapno == T_SYSCALL) {
syscall(tf->tf_regs.reg_eax,
tf->tf_regs.reg_edx,
@ -207,6 +209,7 @@ trap_dispatch(struct Trapframe *tf)
tf->tf_regs.reg_ebx,
tf->tf_regs.reg_edi,
tf->tf_regs.reg_esi);
return;
}
// Unexpected trap: The user process or the kernel has a bug.