summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/faults.cc10
-rw-r--r--src/sim/faults.hh20
2 files changed, 15 insertions, 15 deletions
diff --git a/src/sim/faults.cc b/src/sim/faults.cc
index c409aa95b..e2562fca6 100644
--- a/src/sim/faults.cc
+++ b/src/sim/faults.cc
@@ -39,7 +39,7 @@
#include "sim/full_system.hh"
#include "sim/process.hh"
-void FaultBase::invoke(ThreadContext * tc, StaticInstPtr inst)
+void FaultBase::invoke(ThreadContext * tc, const StaticInstPtr &inst)
{
if (FullSystem) {
DPRINTF(Fault, "Fault %s at PC: %s\n", name(), tc->pcState());
@@ -49,17 +49,17 @@ void FaultBase::invoke(ThreadContext * tc, StaticInstPtr inst)
}
}
-void UnimpFault::invoke(ThreadContext * tc, StaticInstPtr inst)
+void UnimpFault::invoke(ThreadContext * tc, const StaticInstPtr &inst)
{
panic("Unimpfault: %s\n", panicStr.c_str());
}
-void ReExec::invoke(ThreadContext *tc, StaticInstPtr inst)
+void ReExec::invoke(ThreadContext *tc, const StaticInstPtr &inst)
{
tc->pcState(tc->pcState());
}
-void GenericPageTableFault::invoke(ThreadContext *tc, StaticInstPtr inst)
+void GenericPageTableFault::invoke(ThreadContext *tc, const StaticInstPtr &inst)
{
bool handled = false;
if (!FullSystem) {
@@ -71,7 +71,7 @@ void GenericPageTableFault::invoke(ThreadContext *tc, StaticInstPtr inst)
}
-void GenericAlignmentFault::invoke(ThreadContext *tc, StaticInstPtr inst)
+void GenericAlignmentFault::invoke(ThreadContext *tc, const StaticInstPtr &inst)
{
panic("Alignment fault when accessing virtual address %#x\n", vaddr);
}
diff --git a/src/sim/faults.hh b/src/sim/faults.hh
index 4cdb24aee..0377c0893 100644
--- a/src/sim/faults.hh
+++ b/src/sim/faults.hh
@@ -54,8 +54,8 @@ class FaultBase : public RefCounted
{
public:
virtual FaultName name() const = 0;
- virtual void invoke(ThreadContext * tc,
- StaticInstPtr inst = StaticInst::nullStaticInstPtr);
+ virtual void invoke(ThreadContext * tc, const StaticInstPtr &inst =
+ StaticInst::nullStaticInstPtr);
};
class UnimpFault : public FaultBase
@@ -68,8 +68,8 @@ class UnimpFault : public FaultBase
{ }
FaultName name() const {return "Unimplemented simulator feature";}
- void invoke(ThreadContext * tc,
- StaticInstPtr inst = StaticInst::nullStaticInstPtr);
+ void invoke(ThreadContext * tc, const StaticInstPtr &inst =
+ StaticInst::nullStaticInstPtr);
};
class ReExec : public FaultBase
@@ -77,8 +77,8 @@ class ReExec : public FaultBase
public:
virtual FaultName name() const { return "Re-execution fault";}
ReExec() {}
- void invoke(ThreadContext *tc,
- StaticInstPtr inst = StaticInst::nullStaticInstPtr);
+ void invoke(ThreadContext *tc, const StaticInstPtr &inst =
+ StaticInst::nullStaticInstPtr);
};
class GenericPageTableFault : public FaultBase
@@ -88,8 +88,8 @@ class GenericPageTableFault : public FaultBase
public:
FaultName name() const {return "Generic page table fault";}
GenericPageTableFault(Addr va) : vaddr(va) {}
- void invoke(ThreadContext * tc,
- StaticInstPtr inst = StaticInst::nullStaticInstPtr);
+ void invoke(ThreadContext * tc, const StaticInstPtr &inst =
+ StaticInst::nullStaticInstPtr);
};
class GenericAlignmentFault : public FaultBase
@@ -99,8 +99,8 @@ class GenericAlignmentFault : public FaultBase
public:
FaultName name() const {return "Generic alignment fault";}
GenericAlignmentFault(Addr va) : vaddr(va) {}
- void invoke(ThreadContext * tc,
- StaticInstPtr inst = StaticInst::nullStaticInstPtr);
+ void invoke(ThreadContext * tc, const StaticInstPtr &inst =
+ StaticInst::nullStaticInstPtr);
};
#endif // __FAULTS_HH__