changeset d0772caaeacd in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=d0772caaeacd
description:
Faults: Make the generic faults more consistent between SE and FS.
All of the classes will now be available in both modes, and only
GenericPageTableFault will continue to check the mode for conditional
compilation. It uses a process object to handle the fault in SE mode,
and
for now those aren't available in FS mode.
diffstat:
src/sim/faults.cc | 24 +++++++++++-------------
src/sim/faults.hh | 3 ---
2 files changed, 11 insertions(+), 16 deletions(-)
diffs (71 lines):
diff -r ef28ed90449d -r d0772caaeacd src/sim/faults.cc
--- a/src/sim/faults.cc Mon Sep 26 23:48:54 2011 -0700
+++ b/src/sim/faults.cc Tue Sep 27 00:16:33 2011 -0700
@@ -38,18 +38,15 @@
#include "sim/faults.hh"
#include "sim/process.hh"
-#if !FULL_SYSTEM
void FaultBase::invoke(ThreadContext * tc, StaticInstPtr inst)
{
- panic("fault (%s) detected @ PC %s", name(), tc->pcState());
+ if (FULL_SYSTEM) {
+ DPRINTF(Fault, "Fault %s at PC: %s\n", name(), tc->pcState());
+ assert(!tc->misspeculating());
+ } else {
+ panic("fault (%s) detected @ PC %s", name(), tc->pcState());
+ }
}
-#else
-void FaultBase::invoke(ThreadContext * tc, StaticInstPtr inst)
-{
- DPRINTF(Fault, "Fault %s at PC: %s\n", name(), tc->pcState());
- assert(!tc->misspeculating());
-}
-#endif
void UnimpFault::invoke(ThreadContext * tc, StaticInstPtr inst)
{
@@ -61,13 +58,15 @@
tc->pcState(tc->pcState());
}
-
-#if !FULL_SYSTEM
void GenericPageTableFault::invoke(ThreadContext *tc, StaticInstPtr inst)
{
+ bool handled = false;
+#if !FULL_SYSTEM
Process *p = tc->getProcessPtr();
- if (!p->fixupStackFault(vaddr))
+ handled = p->fixupStackFault(vaddr);
+#endif
+ if (!handled)
panic("Page table fault when accessing virtual address %#x\n", vaddr);
}
@@ -76,4 +75,3 @@
{
panic("Alignment fault when accessing virtual address %#x\n", vaddr);
}
-#endif
diff -r ef28ed90449d -r d0772caaeacd src/sim/faults.hh
--- a/src/sim/faults.hh Mon Sep 26 23:48:54 2011 -0700
+++ b/src/sim/faults.hh Tue Sep 27 00:16:33 2011 -0700
@@ -82,8 +82,6 @@
StaticInstPtr inst = StaticInst::nullStaticInstPtr);
};
-
-#if !FULL_SYSTEM
class GenericPageTableFault : public FaultBase
{
private:
@@ -105,6 +103,5 @@
void invoke(ThreadContext * tc,
StaticInstPtr inst = StaticInst::nullStaticInstPtr);
};
-#endif
#endif // __FAULTS_HH__
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev