Do not crash on handled traps.
This commit is contained in:
parent
eae0475758
commit
f0e2ab8abd
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user