summaryrefslogtreecommitdiff
path: root/src/arch/x86/syscallreturn.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-07-29 01:27:34 -0700
committerGabe Black <gblack@eecs.umich.edu>2007-07-29 01:27:34 -0700
commit33847f8c83f8ac3c85c1388b5b69aacbc5163564 (patch)
tree7f97712f67c83087b814f1e4950b0c1f7bb904b4 /src/arch/x86/syscallreturn.hh
parentd99557534217dc59e33ca70591b52d9d9e8322a8 (diff)
downloadgem5-33847f8c83f8ac3c85c1388b5b69aacbc5163564.tar.xz
X86: return -return_value.value() on failure.
--HG-- extra : convert_revision : d8e1486ff075b2917be62a0008f83fd6c9e4c09a
Diffstat (limited to 'src/arch/x86/syscallreturn.hh')
-rw-r--r--src/arch/x86/syscallreturn.hh6
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());
+ }
}
};