sim: Add openat/fstatat syscalls and fix mremap
[gem5.git] / src / kern / system_events.cc
index bd01ed9ede0a1834cd1fd6fb00a6115f4e4e5027..3ee7a099a48ec24ac23c751c5cd9f6e6c664acf4 100644 (file)
  */
 
 #include "arch/isa_traits.hh"
+#include "arch/utility.hh"
 #include "base/trace.hh"
 #include "config/the_isa.hh"
 #include "cpu/thread_context.hh"
+#include "debug/PCEvent.hh"
 #include "kern/system_events.hh"
 
 using namespace TheISA;
@@ -40,14 +42,10 @@ using namespace TheISA;
 void
 SkipFuncEvent::process(ThreadContext *tc)
 {
-    Addr newpc = tc->readIntReg(ReturnAddressReg);
+    TheISA::PCState oldPC M5_VAR_USED = tc->pcState();
 
-    DPRINTF(PCEvent, "skipping %s: pc=%x, newpc=%x\n", description,
-            tc->readPC(), newpc);
-
-    tc->setPC(newpc);
-    tc->setNextPC(tc->readPC() + sizeof(TheISA::MachInst));
-#if ISA_HAS_DELAY_SLOT
-    tc->setNextPC(tc->readNextPC() + sizeof(TheISA::MachInst));
-#endif
+    // Call ISA specific code to do the skipping
+    TheISA::skipFunction(tc);
+    DPRINTF(PCEvent, "skipping %s: pc = %s, newpc = %s\n", description,
+            oldPC, tc->pcState());
 }