diff options
author | Steve Reinhardt <steve.reinhardt@amd.com> | 2014-05-12 14:23:31 -0700 |
---|---|---|
committer | Steve Reinhardt <steve.reinhardt@amd.com> | 2014-05-12 14:23:31 -0700 |
commit | 109908c2a6322d1fa31c0b486ea2bada14a292b8 (patch) | |
tree | 08f7341bba700aeab9b3ee7974bcbad6b0cc0052 /src/arch/sparc | |
parent | 72403cb59561a37d42e5b5bc4b0499ddaf9012cf (diff) | |
download | gem5-109908c2a6322d1fa31c0b486ea2bada14a292b8.tar.xz |
syscall emulation: clean up & comment SyscallReturn
Diffstat (limited to 'src/arch/sparc')
-rw-r--r-- | src/arch/sparc/process.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/arch/sparc/process.cc b/src/arch/sparc/process.cc index 456b8b94a..06b0d18b3 100644 --- a/src/arch/sparc/process.cc +++ b/src/arch/sparc/process.cc @@ -532,26 +532,25 @@ Sparc64LiveProcess::setSyscallArg(ThreadContext *tc, int i, IntReg val) } void -SparcLiveProcess::setSyscallReturn(ThreadContext *tc, - SyscallReturn return_value) +SparcLiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) { // check for error condition. SPARC syscall convention is to // indicate success/failure in reg the carry bit of the ccr // and put the return value itself in the standard return value reg (). PSTATE pstate = tc->readMiscRegNoEffect(MISCREG_PSTATE); - if (return_value.successful()) { + if (sysret.successful()) { // no error, clear XCC.C tc->setIntReg(NumIntArchRegs + 2, - tc->readIntReg(NumIntArchRegs + 2) & 0xEE); - IntReg val = return_value.value(); + tc->readIntReg(NumIntArchRegs + 2) & 0xEE); + IntReg val = sysret.returnValue(); if (pstate.am) val = bits(val, 31, 0); tc->setIntReg(ReturnValueReg, val); } else { // got an error, set XCC.C tc->setIntReg(NumIntArchRegs + 2, - tc->readIntReg(NumIntArchRegs + 2) | 0x11); - IntReg val = -return_value.value(); + tc->readIntReg(NumIntArchRegs + 2) | 0x11); + IntReg val = sysret.errnoValue(); if (pstate.am) val = bits(val, 31, 0); tc->setIntReg(ReturnValueReg, val); |