From: Tuan Ta Date: Mon, 2 Apr 2018 20:22:30 +0000 (-0400) Subject: riscv: fixed syscall return value X-Git-Tag: v19.0.0.0~1171 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2eb57c7c3bb762097aa7bdab40cd37ec73996dca;p=gem5.git riscv: fixed syscall return value In case of failure, a syscall returns a negative value encoding the error code. This patch makes the risc-v implementation returns the encoded value instead of its absolute value upon a failure of a syscall. Change-Id: I6032b0337fe1cff5b326dbc6bb3b87a415f03300 Reviewed-on: https://gem5-review.googlesource.com/c/9627 Reviewed-by: Alec Roelke Maintainer: Alec Roelke --- diff --git a/src/arch/riscv/process.cc b/src/arch/riscv/process.cc index ed6de1546..16d0dc7ff 100644 --- a/src/arch/riscv/process.cc +++ b/src/arch/riscv/process.cc @@ -279,6 +279,6 @@ RiscvProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) tc->setIntReg(SyscallPseudoReturnReg, sysret.returnValue()); } else { // got an error, return details - tc->setIntReg(SyscallPseudoReturnReg, sysret.errnoValue()); + tc->setIntReg(SyscallPseudoReturnReg, sysret.encodedValue()); } }