diff --git a/kern/trap.c b/kern/trap.c index 8ed3fa8..88ca879 100644 --- a/kern/trap.c +++ b/kern/trap.c @@ -203,12 +203,13 @@ trap_dispatch(struct Trapframe *tf) monitor(tf); return; } else if (tf->tf_trapno == T_SYSCALL) { - syscall(tf->tf_regs.reg_eax, + int32_t returned = syscall(tf->tf_regs.reg_eax, tf->tf_regs.reg_edx, tf->tf_regs.reg_ecx, tf->tf_regs.reg_ebx, tf->tf_regs.reg_edi, tf->tf_regs.reg_esi); + tf->tf_regs.reg_eax = returned; return; }