diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2007-07-29 01:27:34 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2007-07-29 01:27:34 -0700 |
commit | 33847f8c83f8ac3c85c1388b5b69aacbc5163564 (patch) | |
tree | 7f97712f67c83087b814f1e4950b0c1f7bb904b4 | |
parent | d99557534217dc59e33ca70591b52d9d9e8322a8 (diff) | |
download | gem5-33847f8c83f8ac3c85c1388b5b69aacbc5163564.tar.xz |
X86: return -return_value.value() on failure.
--HG--
extra : convert_revision : d8e1486ff075b2917be62a0008f83fd6c9e4c09a
-rw-r--r-- | src/arch/x86/syscallreturn.hh | 6 |
1 files changed, 5 insertions, 1 deletions
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()); + } } }; |