From: Gabe Black Date: Sat, 13 Oct 2018 06:09:07 +0000 (-0700) Subject: mips: Explicitly truncate the syscall return value down to 32 bits. X-Git-Tag: v19.0.0.0~1431 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0167f66c130ada7a49d59d1ef4644d282cd146dc;p=gem5.git mips: Explicitly truncate the syscall return value down to 32 bits. The IntReg type is 32 bits, and using it to cast the syscall return value is appropriate, but we're attempting to get rid of the ISA specific register types. Change-Id: I42496dd2cc086a6b718e1ce087fef81bb897d02f Reviewed-on: https://gem5-review.googlesource.com/c/13619 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- diff --git a/src/arch/mips/process.cc b/src/arch/mips/process.cc index 3f65691aa..6bae08392 100644 --- a/src/arch/mips/process.cc +++ b/src/arch/mips/process.cc @@ -224,7 +224,7 @@ MipsProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) tc->setIntReg(ReturnValueReg, sysret.returnValue()); } else { // got an error, return details - tc->setIntReg(SyscallSuccessReg, (IntReg) -1); + tc->setIntReg(SyscallSuccessReg, (uint32_t)(-1)); tc->setIntReg(ReturnValueReg, sysret.errnoValue()); } }