summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2010-09-20 02:46:42 -0700
committerGabe Black <gblack@eecs.umich.edu>2010-09-20 02:46:42 -0700
commitab8d7eee76e9d439070fe116fb23e0afe7aa74c3 (patch)
tree2fc54a18e5233e875c664b4897368805b425a174
parent3f9f4bf3d6ce9080adb03966599e0f1a98b091eb (diff)
downloadgem5-ab8d7eee76e9d439070fe116fb23e0afe7aa74c3.tar.xz
CPU: Fix O3 and possible InOrder segfaults in FS.
-rw-r--r--src/cpu/inorder/cpu.cc4
-rw-r--r--src/cpu/o3/commit_impl.hh2
-rw-r--r--src/cpu/o3/cpu.cc7
-rw-r--r--src/cpu/o3/cpu.hh2
-rw-r--r--src/cpu/o3/dyn_inst_impl.hh2
5 files changed, 9 insertions, 8 deletions
diff --git a/src/cpu/inorder/cpu.cc b/src/cpu/inorder/cpu.cc
index 5d4d3c580..5d42ba559 100644
--- a/src/cpu/inorder/cpu.cc
+++ b/src/cpu/inorder/cpu.cc
@@ -633,7 +633,9 @@ InOrderCPU::processInterrupts(Fault interrupt)
this->interrupts->updateIntrInfo(this->threadContexts[0]);
DPRINTF(InOrderCPU, "Interrupt %s being handled\n", interrupt->name());
- this->trap(interrupt, 0);
+ static StaticInstPtr dummyStatic(TheISA::NoopMachInst, 0);
+ static DynInstPtr dummyDyn = new Impl::DynInst(dummyStatic);
+ this->trap(interrupt, dummyDyn);
}
diff --git a/src/cpu/o3/commit_impl.hh b/src/cpu/o3/commit_impl.hh
index 87f18d4e4..98c7b49c8 100644
--- a/src/cpu/o3/commit_impl.hh
+++ b/src/cpu/o3/commit_impl.hh
@@ -1062,7 +1062,7 @@ DefaultCommit<Impl>::commitHead(DynInstPtr &head_inst, unsigned inst_num)
// needed to update the state as soon as possible. This
// prevents external agents from changing any specific state
// that the trap need.
- cpu->trap(inst_fault, tid, head_inst);
+ cpu->trap(inst_fault, tid, head_inst->staticInst);
// Exit state update mode to avoid accidental updating.
thread[tid]->inSyscall = false;
diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc
index 7eea04ce6..8e9f3ef5d 100644
--- a/src/cpu/o3/cpu.cc
+++ b/src/cpu/o3/cpu.cc
@@ -926,8 +926,7 @@ FullO3CPU<Impl>::processInterrupts(Fault interrupt)
this->interrupts->updateIntrInfo(this->threadContexts[0]);
DPRINTF(O3CPU, "Interrupt %s being handled\n", interrupt->name());
- DynInstPtr dummyInst;
- this->trap(interrupt, 0, dummyInst);
+ this->trap(interrupt, 0, NULL);
}
template <class Impl>
@@ -944,10 +943,10 @@ FullO3CPU<Impl>::updateMemPorts()
template <class Impl>
void
-FullO3CPU<Impl>::trap(Fault fault, ThreadID tid, DynInstPtr inst)
+FullO3CPU<Impl>::trap(Fault fault, ThreadID tid, StaticInstPtr inst)
{
// Pass the thread's TC into the invoke method.
- fault->invoke(this->threadContexts[tid], inst->staticInst);
+ fault->invoke(this->threadContexts[tid], inst);
}
#if !FULL_SYSTEM
diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh
index e7368993b..57c07a9ec 100644
--- a/src/cpu/o3/cpu.hh
+++ b/src/cpu/o3/cpu.hh
@@ -367,7 +367,7 @@ class FullO3CPU : public BaseO3CPU
{ return globalSeqNum++; }
/** Traps to handle given fault. */
- void trap(Fault fault, ThreadID tid, DynInstPtr inst);
+ void trap(Fault fault, ThreadID tid, StaticInstPtr inst);
#if FULL_SYSTEM
/** HW return from error interrupt. */
diff --git a/src/cpu/o3/dyn_inst_impl.hh b/src/cpu/o3/dyn_inst_impl.hh
index 9406e2be0..3e015d962 100644
--- a/src/cpu/o3/dyn_inst_impl.hh
+++ b/src/cpu/o3/dyn_inst_impl.hh
@@ -155,7 +155,7 @@ template <class Impl>
void
BaseO3DynInst<Impl>::trap(Fault fault)
{
- this->cpu->trap(fault, this->threadNumber, this);
+ this->cpu->trap(fault, this->threadNumber, this->staticInst);
}
template <class Impl>