Config: corrects the way Ruby attaches to the DMA ports
[gem5.git] / src / kern / system_events.cc
index aca75e27d62c43de006cfeed467e32d176a170a2..3ee7a099a48ec24ac23c751c5cd9f6e6c664acf4 100644 (file)
  *          Nathan Binkert
  */
 
-#include "cpu/base.hh"
-#include "cpu/cpu_exec_context.hh"
-#include "kern/kernel_stats.hh"
+#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"
-#include "sim/system.hh"
 
 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));
-/*
-    BranchPred *bp = tc->getCpuPtr()->getBranchPred();
-    if (bp != NULL) {
-        bp->popRAS(tc->getThreadNum());
-    }
-*/
-}
-
-
-FnEvent::FnEvent(PCEventQueue *q, const std::string &desc, Addr addr,
-                 Stats::MainBin *bin)
-    : PCEvent(q, desc, addr), _name(desc), mybin(bin)
-{
-}
-
-void
-FnEvent::process(ThreadContext *tc)
-{
-    if (tc->misspeculating())
-        return;
-
-    tc->getSystemPtr()->kernelBinning->call(tc, mybin);
-}
-
-void
-IdleStartEvent::process(ThreadContext *tc)
-{
-    if (tc->getKernelStats())
-        tc->getKernelStats()->setIdleProcess(
-            tc->readMiscReg(AlphaISA::IPR_PALtemp23), tc);
-    remove();
-}
-
-void
-InterruptStartEvent::process(ThreadContext *tc)
-{
-    if (tc->getKernelStats())
-        tc->getKernelStats()->mode(Kernel::interrupt, tc);
-}
-
-void
-InterruptEndEvent::process(ThreadContext *tc)
-{
-    // We go back to kernel, if we are user, inside the rti
-    // pal code we will get switched to user because of the ICM write
-    if (tc->getKernelStats())
-        tc->getKernelStats()->mode(Kernel::kernel, tc);
+    // Call ISA specific code to do the skipping
+    TheISA::skipFunction(tc);
+    DPRINTF(PCEvent, "skipping %s: pc = %s, newpc = %s\n", description,
+            oldPC, tc->pcState());
 }