From: Gabe Black Date: Sun, 29 Jul 2007 08:27:34 +0000 (-0700) Subject: X86: return -return_value.value() on failure. X-Git-Tag: m5_2.0_beta4~258 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=33847f8c83f8ac3c85c1388b5b69aacbc5163564;p=gem5.git X86: return -return_value.value() on failure. --HG-- extra : convert_revision : d8e1486ff075b2917be62a0008f83fd6c9e4c09a --- diff --git a/src/arch/x86/syscallreturn.hh b/src/arch/x86/syscallreturn.hh index 6a7fdba58..be9715d21 100644 --- a/src/arch/x86/syscallreturn.hh +++ b/src/arch/x86/syscallreturn.hh @@ -67,7 +67,11 @@ namespace X86ISA static inline void setSyscallReturn(SyscallReturn return_value, ThreadContext * tc) { - tc->setIntReg(INTREG_RAX, return_value.value()); + if (return_value.successful()) { + tc->setIntReg(INTREG_RAX, return_value.value()); + } else { + tc->setIntReg(INTREG_RAX, -return_value.value()); + } } };