Fix to deal with the new base class parameter for registration
[gem5.git] / cpu / pc_event.cc
index 4a037663ca919f01f991498c2cfdc6b4fc293535..8f046a7a41e9a6447113eadff6e159149d4231ba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003 The Regents of The University of Michigan
+ * Copyright (c) 2002-2003 The Regents of The University of Michigan
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #include "base/trace.hh"
 #include "sim/universe.hh"
 
-#ifdef FULL_SYSTEM
-#include "targetarch/arguments.hh"
-#include "targetarch/pmap.h"
-#include "kern/tru64/kernel.hh"
-#include "mem/functional_mem/memory_control.hh"
-#include "sim/system.hh"
-#include "cpu/base_cpu.hh"
-#include "cpu/full_cpu/bpred.hh"
-#endif
-
 using namespace std;
 
 PCEventQueue::PCEventQueue()
@@ -85,9 +75,9 @@ PCEventQueue::schedule(PCEvent *event)
 }
 
 bool
-PCEventQueue::service(ExecContext *xc)
+PCEventQueue::doService(ExecContext *xc)
 {
-    Addr pc = xc->regs.pc;
+    Addr pc = xc->regs.pc & ~0x3;
     int serviced = 0;
     range_t range = equal_range(pc);
     for (iterator i = range.first; i != range.second; ++i) {
@@ -95,7 +85,7 @@ PCEventQueue::service(ExecContext *xc)
         // another event.  This for example, prevents two invocations
         // of the SkipFuncEvent.  Maybe we should have separate PC
         // event queues for each processor?
-        if (pc != xc->regs.pc)
+        if (pc != (xc->regs.pc & ~0x3))
             continue;
 
         DPRINTF(PCEvent, "PC based event serviced at %#x: %s\n",
@@ -125,77 +115,6 @@ PCEventQueue::equal_range(Addr pc)
     return std::equal_range(pc_map.begin(), pc_map.end(), pc, MapCompare());
 }
 
-#ifdef FULL_SYSTEM
-void
-SkipFuncEvent::process(ExecContext *xc)
-{
-    Addr newpc = xc->regs.intRegFile[ReturnAddressReg];
-
-    DPRINTF(PCEvent, "skipping %s: pc=%x, newpc=%x\n", description,
-            xc->regs.pc, newpc);
-
-    xc->regs.pc = newpc;
-    xc->regs.npc = xc->regs.pc + sizeof(MachInst);
-
-    BranchPred *bp = xc->cpu->getBranchPred();
-    if (bp != NULL) {
-        bp->popRAS(xc->thread_num);
-    }
-}
-
-void
-BadAddrEvent::process(ExecContext *xc)
-{
-    // The following gross hack is the equivalent function to the
-    // annotation for vmunix::badaddr in:
-    // simos/simulation/apps/tcl/osf/tlaser.tcl
-
-    uint64_t a0 = xc->regs.intRegFile[ArgumentReg0];
-
-    if (a0 < ALPHA_K0SEG_BASE || a0 >= ALPHA_K1SEG_BASE ||
-        xc->memCtrl->badaddr(ALPHA_K0SEG_TO_PHYS(a0) & PA_IMPL_MASK)) {
-
-        DPRINTF(BADADDR, "badaddr arg=%#x bad\n", a0);
-        xc->regs.intRegFile[ReturnValueReg] = 0x1;
-        SkipFuncEvent::process(xc);
-    }
-    else
-        DPRINTF(BADADDR, "badaddr arg=%#x good\n", a0);
-}
-
-void
-PrintfEvent::process(ExecContext *xc)
-{
-    if (DTRACE(Printf)) {
-        DebugOut() << curTick << ": " << xc->cpu->name() << ": ";
-
-        AlphaArguments args(xc);
-        Kernel::Printf(args);
-    }
-}
-
-void
-DebugPrintfEvent::process(ExecContext *xc)
-{
-    if (DTRACE(DebugPrintf)) {
-        if (!raw)
-            DebugOut() << curTick << ": " << xc->cpu->name() << ": ";
-
-        AlphaArguments args(xc);
-        Kernel::Printf(args);
-    }
-}
-
-void
-DumpMbufEvent::process(ExecContext *xc)
-{
-    if (DTRACE(DebugPrintf)) {
-        AlphaArguments args(xc);
-        Kernel::DumpMbuf(args);
-    }
-}
-#endif
-
 BreakPCEvent::BreakPCEvent(PCEventQueue *q, const std::string &desc, bool del)
     : PCEvent(q, desc), remove(del)
 {