syscall emulation: Enabled getrlimit and getrusage for x86.
[gem5.git] / src / arch / mips / utility.cc
index 7dd74551ea6a64355f374b082b5ad1b7b318e261..65432b4eab1ac331050f09b89cc41661b7aa94a2 100644 (file)
 #include <cmath>
 
 #include "arch/mips/isa_traits.hh"
+#include "arch/mips/registers.hh"
 #include "arch/mips/utility.hh"
-#include "config/full_system.hh"
-#include "cpu/thread_context.hh"
-#include "cpu/static_inst.hh"
-#include "sim/serialize.hh"
+#include "arch/mips/vtophys.hh"
 #include "base/bitfield.hh"
 #include "base/misc.hh"
-
-#if FULL_SYSTEM
-#include "arch/mips/registers.hh"
-#include "arch/mips/vtophys.hh"
-#include "mem/vport.hh"
-#endif
+#include "cpu/static_inst.hh"
+#include "cpu/thread_context.hh"
+#include "mem/fs_translating_port_proxy.hh"
+#include "sim/serialize.hh"
 
 
 using namespace MipsISA;
@@ -52,25 +48,10 @@ using namespace std;
 namespace MipsISA {
 
 uint64_t
-getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp)
+getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
 {
-#if FULL_SYSTEM
-    if (number < 4) {
-        if (fp)
-            return tc->readFloatRegBits(FirstArgumentReg + number);
-        else
-            return tc->readIntReg(FirstArgumentReg + number);
-    } else {
-        Addr sp = tc->readIntReg(StackPointerReg);
-        VirtualPort *vp = tc->getVirtPort();
-        uint64_t arg = vp->read<uint64_t>(sp +
-                (number - 4) * sizeof(uint64_t));
-        return arg;
-    }
-#else
-    panic("getArgument() is Full system only\n");
+    panic("getArgument() not implemented\n");
     M5_DUMMY_RETURN
-#endif
 }
 
 uint64_t
@@ -253,6 +234,10 @@ startupCPU(ThreadContext *tc, int cpuId)
     tc->activate(0/*tc->threadId()*/);
 }
 
+void
+initCPU(ThreadContext *tc, int cpuId)
+{}
+
 void
 copyRegs(ThreadContext *src, ThreadContext *dest)
 {
@@ -267,10 +252,9 @@ copyMiscRegs(ThreadContext *src, ThreadContext *dest)
 void
 skipFunction(ThreadContext *tc)
 {
-    Addr newpc = tc->readIntReg(ReturnAddressReg);
-    tc->setPC(newpc);
-    tc->setNextPC(tc->readPC() + sizeof(TheISA::MachInst));
-    tc->setNextPC(tc->readNextPC() + sizeof(TheISA::MachInst));
+    TheISA::PCState newPC = tc->pcState();
+    newPC.set(tc->readIntReg(ReturnAddressReg));
+    tc->pcState(newPC);
 }