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.
|
// LAB 3: Your code here.
|
||||||
if (tf->tf_trapno == T_PGFLT) {
|
if (tf->tf_trapno == T_PGFLT) {
|
||||||
page_fault_handler(tf);
|
page_fault_handler(tf);
|
||||||
|
return;
|
||||||
} else if (tf->tf_trapno == T_BRKPT) {
|
} else if (tf->tf_trapno == T_BRKPT) {
|
||||||
monitor(tf);
|
monitor(tf);
|
||||||
|
return;
|
||||||
} else if (tf->tf_trapno == T_SYSCALL) {
|
} else if (tf->tf_trapno == T_SYSCALL) {
|
||||||
syscall(tf->tf_regs.reg_eax,
|
syscall(tf->tf_regs.reg_eax,
|
||||||
tf->tf_regs.reg_edx,
|
tf->tf_regs.reg_edx,
|
||||||
|
@ -207,6 +209,7 @@ trap_dispatch(struct Trapframe *tf)
|
||||||
tf->tf_regs.reg_ebx,
|
tf->tf_regs.reg_ebx,
|
||||||
tf->tf_regs.reg_edi,
|
tf->tf_regs.reg_edi,
|
||||||
tf->tf_regs.reg_esi);
|
tf->tf_regs.reg_esi);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unexpected trap: The user process or the kernel has a bug.
|
// Unexpected trap: The user process or the kernel has a bug.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user