* Nathan Binkert
*/
-#include "cpu/base.hh"
-#include "cpu/cpu_exec_context.hh"
-#include "kern/kernel_stats.hh"
+#include "arch/isa_traits.hh"
+#include "base/trace.hh"
+#include "config/the_isa.hh"
+#include "cpu/thread_context.hh"
#include "kern/system_events.hh"
-#include "sim/system.hh"
using namespace TheISA;
void
-SkipFuncEvent::process(ExecContext *xc)
+SkipFuncEvent::process(ThreadContext *tc)
{
- Addr newpc = xc->readIntReg(ReturnAddressReg);
+ Addr newpc = tc->readIntReg(ReturnAddressReg);
DPRINTF(PCEvent, "skipping %s: pc=%x, newpc=%x\n", description,
- xc->readPC(), newpc);
+ tc->readPC(), newpc);
- xc->setPC(newpc);
- xc->setNextPC(xc->readPC() + sizeof(TheISA::MachInst));
-/*
- BranchPred *bp = xc->getCpuPtr()->getBranchPred();
- if (bp != NULL) {
- bp->popRAS(xc->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(ExecContext *xc)
-{
- if (xc->misspeculating())
- return;
-
- xc->getSystemPtr()->kernelBinning->call(xc, mybin);
-}
-
-void
-IdleStartEvent::process(ExecContext *xc)
-{
- if (xc->getKernelStats())
- xc->getKernelStats()->setIdleProcess(
- xc->readMiscReg(AlphaISA::IPR_PALtemp23), xc);
- remove();
-}
-
-void
-InterruptStartEvent::process(ExecContext *xc)
-{
- if (xc->getKernelStats())
- xc->getKernelStats()->mode(Kernel::interrupt, xc);
-}
-
-void
-InterruptEndEvent::process(ExecContext *xc)
-{
- // 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 (xc->getKernelStats())
- xc->getKernelStats()->mode(Kernel::kernel, xc);
+ tc->setPC(newpc);
+ tc->setNextPC(tc->readPC() + sizeof(TheISA::MachInst));
+#if ISA_HAS_DELAY_SLOT
+ tc->setNextPC(tc->readNextPC() + sizeof(TheISA::MachInst));
+#endif
}