changeset c811ced9efc1 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=c811ced9efc1
description:
        CPU: Eliminate the simPalCheck funciton.

diffstat:

9 files changed, 10 insertions(+), 43 deletions(-)
src/arch/alpha/ev5.cc          |   15 ---------------
src/arch/alpha/isa/decoder.isa |   11 ++++++++++-
src/cpu/exec_context.hh        |    3 ---
src/cpu/o3/cpu.cc              |    2 --
src/cpu/o3/cpu.hh              |    1 -
src/cpu/o3/dyn_inst_impl.hh    |    5 -----
src/cpu/ozone/cpu_impl.hh      |   12 ------------
src/cpu/ozone/dyn_inst_impl.hh |    3 ---
src/cpu/simple_thread.hh       |    1 -

diffs (300 lines):

diff -r 67cc7f0427e7 -r c811ced9efc1 src/arch/alpha/ev5.cc
--- a/src/arch/alpha/ev5.cc     Sat Oct 11 02:27:21 2008 -0700
+++ b/src/arch/alpha/ev5.cc     Sat Oct 11 12:17:24 2008 -0700
@@ -547,36 +547,3 @@
 }
 
 } // namespace AlphaISA
-
-#if FULL_SYSTEM
-
-using namespace AlphaISA;
-
-/**
- * Check for special simulator handling of specific PAL calls.
- * If return value is false, actual PAL call will be suppressed.
- */
-bool
-SimpleThread::simPalCheck(int palFunc)
-{
-    if (kernelStats)
-        kernelStats->callpal(palFunc, tc);
-
-    switch (palFunc) {
-      case PAL::halt:
-        halt();
-        if (--System::numSystemsRunning == 0)
-            exitSimLoop("all cpus halted");
-        break;
-
-      case PAL::bpt:
-      case PAL::bugchk:
-        if (system->breakpoint())
-            return false;
-        break;
-    }
-
-    return true;
-}
-
-#endif // FULL_SYSTEM
diff -r 67cc7f0427e7 -r c811ced9efc1 src/arch/alpha/isa/decoder.isa
--- a/src/arch/alpha/isa/decoder.isa    Sat Oct 11 02:27:21 2008 -0700
+++ b/src/arch/alpha/isa/decoder.isa    Sat Oct 11 12:17:24 2008 -0700
@@ -698,7 +698,28 @@
         else {
             // check to see if simulator wants to do something special
             // on this PAL call (including maybe suppress it)
-            bool dopal = xc->simPalCheck(palFunc);
+            
+            bool dopal = true;
+
+            ThreadContext * tc = xc->tcBase();
+            AlphaISA::Kernel::Statistics * kernelStats = tc->getKernelStats();
+            System * system = tc->getSystemPtr();
+            if (kernelStats)
+                kernelStats->callpal(palFunc, tc);
+
+            switch (palFunc) {
+              case PAL::halt:
+                tc->halt();
+                if (--System::numSystemsRunning == 0)
+                    exitSimLoop("all cpus halted");
+                break;
+
+              case PAL::bpt:
+              case PAL::bugchk:
+                if (system->breakpoint())
+                    dopal = false;
+                break;
+            }
 
             if (dopal) {
                 xc->setMiscReg(IPR_EXC_ADDR, NPC);
diff -r 67cc7f0427e7 -r c811ced9efc1 src/arch/alpha/isa/main.isa
--- a/src/arch/alpha/isa/main.isa       Sat Oct 11 02:27:21 2008 -0700
+++ b/src/arch/alpha/isa/main.isa       Sat Oct 11 12:17:24 2008 -0700
@@ -70,6 +70,7 @@
 
 #if FULL_SYSTEM
 #include "arch/alpha/kernel_stats.hh"
+#include "arch/alpha/osfpal.hh"
 #include "sim/pseudo_inst.hh"
 #endif
 #include "arch/alpha/ipr.hh"
diff -r 67cc7f0427e7 -r c811ced9efc1 src/cpu/checker/cpu.hh
--- a/src/cpu/checker/cpu.hh    Sat Oct 11 02:27:21 2008 -0700
+++ b/src/cpu/checker/cpu.hh    Sat Oct 11 12:17:24 2008 -0700
@@ -337,7 +337,6 @@
 
 #if FULL_SYSTEM
     void ev5_trap(Fault fault) { fault->invoke(tc); }
-    bool simPalCheck(int palFunc) { return thread->simPalCheck(palFunc); }
 #else
     // Assume that the normal CPU's call to syscall was successful.
     // The checker's state would have already been updated by the syscall.
diff -r 67cc7f0427e7 -r c811ced9efc1 src/cpu/exec_context.hh
--- a/src/cpu/exec_context.hh   Sat Oct 11 02:27:21 2008 -0700
+++ b/src/cpu/exec_context.hh   Sat Oct 11 12:17:24 2008 -0700
@@ -143,13 +143,7 @@
      * given flags. */
     void writeHint(Addr addr, int size, unsigned flags);
 
-#if FULL_SYSTEM
-    /**
-     * Check for special simulator handling of specific PAL calls.  If
-     * return value is false, actual PAL call will be suppressed.
-     */
-    bool simPalCheck(int palFunc);
-#else
+#if !FULL_SYSTEM
     /** Executes a syscall specified by the callnum. */
     void syscall(int64_t callnum);
 #endif
diff -r 67cc7f0427e7 -r c811ced9efc1 src/cpu/o3/cpu.cc
--- a/src/cpu/o3/cpu.cc Sat Oct 11 02:27:21 2008 -0700
+++ b/src/cpu/o3/cpu.cc Sat Oct 11 12:17:24 2008 -0700
@@ -51,10 +51,6 @@
 
 #if USE_CHECKER
 #include "cpu/checker/cpu.hh"
-#endif
-
-#if THE_ISA == ALPHA_ISA
-#include "arch/alpha/osfpal.hh"
 #endif
 
 class BaseCPUParams;
@@ -903,32 +899,6 @@
         DPRINTF(IPI,"Suspended Processor awoke\n");
         this->threadContexts[0]->activate();
     }
-}
-
-template <class Impl>
-bool
-FullO3CPU<Impl>::simPalCheck(int palFunc, unsigned tid)
-{
-#if THE_ISA == ALPHA_ISA
-    if (this->thread[tid]->kernelStats)
-        this->thread[tid]->kernelStats->callpal(palFunc,
-                                                this->threadContexts[tid]);
-
-    switch (palFunc) {
-      case PAL::halt:
-        halt();
-        if (--System::numSystemsRunning == 0)
-            exitSimLoop("all cpus halted");
-        break;
-
-      case PAL::bpt:
-      case PAL::bugchk:
-        if (this->system->breakpoint())
-            return false;
-        break;
-    }
-#endif
-    return true;
 }
 
 template <class Impl>
diff -r 67cc7f0427e7 -r c811ced9efc1 src/cpu/o3/cpu.hh
--- a/src/cpu/o3/cpu.hh Sat Oct 11 02:27:21 2008 -0700
+++ b/src/cpu/o3/cpu.hh Sat Oct 11 12:17:24 2008 -0700
@@ -414,8 +414,6 @@
     /** Posts an interrupt. */
     void post_interrupt(int int_num, int index);
 
-    bool simPalCheck(int palFunc, unsigned tid);
-
     /** Returns the Fault for any valid interrupt. */
     Fault getInterrupts();
 
diff -r 67cc7f0427e7 -r c811ced9efc1 src/cpu/o3/dyn_inst.hh
--- a/src/cpu/o3/dyn_inst.hh    Sat Oct 11 02:27:21 2008 -0700
+++ b/src/cpu/o3/dyn_inst.hh    Sat Oct 11 12:17:24 2008 -0700
@@ -170,7 +170,6 @@
 #if FULL_SYSTEM
     /** Traps to handle specified fault. */
     void trap(Fault fault);
-    bool simPalCheck(int palFunc);
 #else
     /** Calls a syscall. */
     void syscall(int64_t callnum);
diff -r 67cc7f0427e7 -r c811ced9efc1 src/cpu/o3/dyn_inst_impl.hh
--- a/src/cpu/o3/dyn_inst_impl.hh       Sat Oct 11 02:27:21 2008 -0700
+++ b/src/cpu/o3/dyn_inst_impl.hh       Sat Oct 11 12:17:24 2008 -0700
@@ -130,16 +130,6 @@
 {
     this->cpu->trap(fault, this->threadNumber);
 }
-
-template <class Impl>
-bool
-BaseO3DynInst<Impl>::simPalCheck(int palFunc)
-{
-#if THE_ISA != ALPHA_ISA
-    panic("simPalCheck called, but PAL only exists in Alpha!\n");
-#endif
-    return this->cpu->simPalCheck(palFunc, this->threadNumber);
-}
 #else
 template <class Impl>
 void
diff -r 67cc7f0427e7 -r c811ced9efc1 src/cpu/ozone/cpu.hh
--- a/src/cpu/ozone/cpu.hh      Sat Oct 11 02:27:21 2008 -0700
+++ b/src/cpu/ozone/cpu.hh      Sat Oct 11 12:17:24 2008 -0700
@@ -510,7 +510,6 @@
     void dumpInsts() { frontEnd->dumpInsts(); }
 
 #if FULL_SYSTEM
-    bool simPalCheck(int palFunc);
     void processInterrupts();
 #else
     void syscall(uint64_t &callnum);
diff -r 67cc7f0427e7 -r c811ced9efc1 src/cpu/ozone/cpu_impl.hh
--- a/src/cpu/ozone/cpu_impl.hh Sat Oct 11 02:27:21 2008 -0700
+++ b/src/cpu/ozone/cpu_impl.hh Sat Oct 11 12:17:24 2008 -0700
@@ -685,31 +685,6 @@
         interrupt->invoke(thread.getTC());
     }
 }
-
-template <class Impl>
-bool
-OzoneCPU<Impl>::simPalCheck(int palFunc)
-{
-    // Need to move this to ISA code
-    // May also need to make this per thread
-    thread.kernelStats->callpal(palFunc, tc);
-
-    switch (palFunc) {
-      case PAL::halt:
-        haltContext(thread.readTid());
-        if (--System::numSystemsRunning == 0)
-            exitSimLoop("all cpus halted");
-        break;
-
-      case PAL::bpt:
-      case PAL::bugchk:
-        if (system->breakpoint())
-            return false;
-        break;
-    }
-
-    return true;
-}
 #endif
 
 template <class Impl>
diff -r 67cc7f0427e7 -r c811ced9efc1 src/cpu/ozone/dyn_inst.hh
--- a/src/cpu/ozone/dyn_inst.hh Sat Oct 11 02:27:21 2008 -0700
+++ b/src/cpu/ozone/dyn_inst.hh Sat Oct 11 12:17:24 2008 -0700
@@ -241,7 +241,6 @@
 
 #if FULL_SYSTEM
     void trap(Fault fault);
-    bool simPalCheck(int palFunc);
 #else
     void syscall(uint64_t &callnum);
 #endif
diff -r 67cc7f0427e7 -r c811ced9efc1 src/cpu/ozone/dyn_inst_impl.hh
--- a/src/cpu/ozone/dyn_inst_impl.hh    Sat Oct 11 02:27:21 2008 -0700
+++ b/src/cpu/ozone/dyn_inst_impl.hh    Sat Oct 11 12:17:24 2008 -0700
@@ -254,13 +254,6 @@
 {
     fault->invoke(this->thread->getTC());
 }
-
-template <class Impl>
-bool
-OzoneDynInst<Impl>::simPalCheck(int palFunc)
-{
-    return this->cpu->simPalCheck(palFunc);
-}
 #else
 template <class Impl>
 void
diff -r 67cc7f0427e7 -r c811ced9efc1 src/cpu/simple/base.hh
--- a/src/cpu/simple/base.hh    Sat Oct 11 02:27:21 2008 -0700
+++ b/src/cpu/simple/base.hh    Sat Oct 11 12:17:24 2008 -0700
@@ -414,7 +414,6 @@
 
 #if FULL_SYSTEM
     void ev5_trap(Fault fault) { fault->invoke(tc); }
-    bool simPalCheck(int palFunc) { return thread->simPalCheck(palFunc); }
 #else
     void syscall(int64_t callnum) { thread->syscall(callnum); }
 #endif
diff -r 67cc7f0427e7 -r c811ced9efc1 src/cpu/simple_thread.hh
--- a/src/cpu/simple_thread.hh  Sat Oct 11 02:27:21 2008 -0700
+++ b/src/cpu/simple_thread.hh  Sat Oct 11 12:17:24 2008 -0700
@@ -184,8 +184,6 @@
     int getDataAsid() { return regs.dataAsid(); }
 
     void dumpFuncProfile();
-
-    bool simPalCheck(int palFunc);
 
 #endif
 
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to