diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2009-04-24 23:11:21 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2009-04-24 23:11:21 -0700 |
commit | 9d0fa27d092d6947eb78ed2580fcaa2b743a8f86 (patch) | |
tree | 89e6a6ce78690906b66c889233c8dfb1669b12d0 /src | |
parent | 7c056e44e551119b3ba925ae99a6c7e1a667fa04 (diff) | |
download | gem5-9d0fa27d092d6947eb78ed2580fcaa2b743a8f86.tar.xz |
SPARC: Tighten up the clone system call and SPARCs copyRegs.
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/sparc/regfile.cc | 15 | ||||
-rw-r--r-- | src/sim/syscall_emul.cc | 6 |
2 files changed, 9 insertions, 12 deletions
diff --git a/src/arch/sparc/regfile.cc b/src/arch/sparc/regfile.cc index 4efac3d4e..a88c6c931 100644 --- a/src/arch/sparc/regfile.cc +++ b/src/arch/sparc/regfile.cc @@ -359,19 +359,20 @@ void SparcISA::copyRegs(ThreadContext *src, ThreadContext *dest) for (int x = 0; x < MaxGL; ++x) { src->setMiscRegNoEffect(MISCREG_GL, x); dest->setMiscRegNoEffect(MISCREG_GL, x); - for (int y = 0; y < 8; y++) + // Skip %g0 which is always zero. + for (int y = 1; y < 8; y++) dest->setIntReg(y, src->readIntReg(y)); } - //Locals/Ins/Outs + //Locals and ins. Outs are all also ins. for (int x = 0; x < NWindows; ++x) { src->setMiscRegNoEffect(MISCREG_CWP, x); dest->setMiscRegNoEffect(MISCREG_CWP, x); - for (int y = 8; y < 32; y++) + for (int y = 16; y < 32; y++) dest->setIntReg(y, src->readIntReg(y)); } - //MicroIntRegs - for (int y = 0; y < NumMicroIntRegs; ++y) - dest->setIntReg(y+32, src->readIntReg(y+32)); + //Microcode reg and pseudo int regs (misc regs in the integer regfile). + for (int y = NumIntArchRegs; y < NumIntArchRegs + NumMicroIntRegs; ++y) + dest->setIntReg(y, src->readIntReg(y)); //Restore src's GL, CWP src->setMiscRegNoEffect(MISCREG_GL, old_gl); @@ -379,7 +380,7 @@ void SparcISA::copyRegs(ThreadContext *src, ThreadContext *dest) // Then loop through the floating point registers. - for (int i = 0; i < SparcISA::NumFloatRegs; ++i) { + for (int i = 0; i < SparcISA::NumFloatArchRegs; ++i) { dest->setFloatRegBits(i, src->readFloatRegBits(i)); } diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc index 108d75063..941c56530 100644 --- a/src/sim/syscall_emul.cc +++ b/src/sim/syscall_emul.cc @@ -723,11 +723,7 @@ cloneFunc(SyscallDesc *desc, int callnum, LiveProcess *process, ctc->setPC(tc->readNextPC()); ctc->setNextPC(tc->readNextPC() + sizeof(TheISA::MachInst)); - - // In SPARC, need NNPC too... - #if THE_ISA == SPARC_ISA - ctc->setNextNPC(tc->readNextNPC() + sizeof(TheISA::MachInst)); - #endif + ctc->setNextNPC(tc->readNextNPC() + sizeof(TheISA::MachInst)); ctc->activate(); |