#ifndef __FAULTS_HH__
#define __FAULTS_HH__
-#include "base/refcnt.hh"
#include "base/types.hh"
-#include "config/full_system.hh"
#include "cpu/static_inst.hh"
-#include "sim/fault_fwd.hh"
#include "sim/stats.hh"
class ThreadContext;
// all faults returned using the Fault type) will use the
// generic FaultBase name.
-class FaultBase : public RefCounted
+class FaultBase
{
public:
virtual FaultName name() const = 0;
- virtual void invoke(ThreadContext * tc,
- StaticInstPtr inst = StaticInst::nullStaticInstPtr);
- virtual bool isMachineCheckFault() const {return false;}
- virtual bool isAlignmentFault() const {return false;}
+ virtual void invoke(ThreadContext * tc, const StaticInstPtr &inst =
+ StaticInst::nullStaticInstPtr);
};
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
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);
};
-
-#if !FULL_SYSTEM
class GenericPageTableFault : public FaultBase
{
private:
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
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
#endif // __FAULTS_HH__