summaryrefslogtreecommitdiff
path: root/src/cpu/o3/sparc/cpu_impl.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/o3/sparc/cpu_impl.hh')
-rw-r--r--src/cpu/o3/sparc/cpu_impl.hh5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cpu/o3/sparc/cpu_impl.hh b/src/cpu/o3/sparc/cpu_impl.hh
index 50d980f55..2e398577e 100644
--- a/src/cpu/o3/sparc/cpu_impl.hh
+++ b/src/cpu/o3/sparc/cpu_impl.hh
@@ -272,7 +272,10 @@ SparcO3CPU<Impl>::getSyscallArg(int i, int tid)
{
TheISA::IntReg idx = TheISA::flattenIntIndex(this->tcBase(tid),
SparcISA::ArgumentReg0 + i);
- return this->readArchIntReg(idx, tid);
+ TheISA::IntReg val = this->readArchIntReg(idx, tid);
+ if (bits(this->readMiscRegNoEffect(SparcISA::MISCREG_PSTATE, tid), 3, 3))
+ val = bits(val, 31, 0);
+ return val;
}
template <class Impl>