#include <cmath>
#include "arch/mips/isa_traits.hh"
+#include "arch/mips/registers.hh"
#include "arch/mips/utility.hh"
+#include "arch/mips/vtophys.hh"
#include "base/bitfield.hh"
#include "base/misc.hh"
#include "cpu/static_inst.hh"
#include "cpu/thread_context.hh"
+#include "mem/fs_translating_port_proxy.hh"
#include "sim/serialize.hh"
-#include "arch/mips/registers.hh"
-#include "arch/mips/vtophys.hh"
-#include "mem/vport.hh"
-
using namespace MipsISA;
using namespace std;
void
startupCPU(ThreadContext *tc, int cpuId)
{
- tc->activate(0/*tc->threadId()*/);
+ tc->activate();
}
void
void
copyRegs(ThreadContext *src, ThreadContext *dest)
{
- panic("Copy Regs Not Implemented Yet\n");
+ // First loop through the integer registers.
+ for (int i = 0; i < NumIntRegs; i++)
+ dest->setIntRegFlat(i, src->readIntRegFlat(i));
+
+ // Then loop through the floating point registers.
+ for (int i = 0; i < NumFloatRegs; i++)
+ dest->setFloatRegFlat(i, src->readFloatRegFlat(i));
+
+ // Would need to add condition-code regs if implemented
+ assert(NumCCRegs == 0);
+
+ // Copy misc. registers
+ for (int i = 0; i < NumMiscRegs; i++)
+ dest->setMiscRegNoEffect(i, src->readMiscRegNoEffect(i));
+
+ // Copy over the PC State
+ dest->pcState(src->pcState());
}
void