Make name, isMachineCheckFault, and isAlignmentFault const.

--HG--
extra : convert_revision : a27e0cbdfcb2a5fdc5979686f887cec7d106542b
This commit is contained in:
Gabe Black 2007-07-18 16:09:00 -07:00
parent 85f32920fb
commit 6fbcb225af
4 changed files with 50 additions and 51 deletions

View file

@ -66,10 +66,10 @@ class MachineCheckFault : public AlphaFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
bool isMachineCheckFault() {return true;}
bool isMachineCheckFault() const {return true;}
};
class AlignmentFault : public AlphaFault
@ -79,10 +79,10 @@ class AlignmentFault : public AlphaFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
bool isAlignmentFault() {return true;}
bool isAlignmentFault() const {return true;}
};
static inline Fault genMachineCheckFault()
@ -102,7 +102,7 @@ class ResetFault : public AlphaFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -116,7 +116,7 @@ class ArithmeticFault : public AlphaFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
#if FULL_SYSTEM
@ -133,7 +133,7 @@ class InterruptFault : public AlphaFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -150,7 +150,7 @@ class DtbFault : public AlphaFault
: vaddr(_vaddr), reqFlags(_reqFlags), flags(_flags)
{ }
#endif
FaultName name() = 0;
FaultName name() const = 0;
FaultVect vect() = 0;
FaultStat & countStat() = 0;
#if FULL_SYSTEM
@ -170,7 +170,7 @@ class NDtbMissFault : public DtbFault
: DtbFault(vaddr, reqFlags, flags)
{ }
#endif
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -187,7 +187,7 @@ class PDtbMissFault : public DtbFault
: DtbFault(vaddr, reqFlags, flags)
{ }
#endif
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -204,7 +204,7 @@ class DtbPageFault : public DtbFault
: DtbFault(vaddr, reqFlags, flags)
{ }
#endif
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -221,7 +221,7 @@ class DtbAcvFault : public DtbFault
: DtbFault(vaddr, reqFlags, flags)
{ }
#endif
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -238,7 +238,7 @@ class DtbAlignmentFault : public DtbFault
: DtbFault(vaddr, reqFlags, flags)
{ }
#endif
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -251,7 +251,7 @@ class ItbFault : public AlphaFault
ItbFault(Addr _pc)
: pc(_pc)
{ }
FaultName name() = 0;
FaultName name() const = 0;
FaultVect vect() = 0;
FaultStat & countStat() = 0;
#if FULL_SYSTEM
@ -269,7 +269,7 @@ class ItbMissFault : public ItbFault
ItbMissFault(Addr pc)
: ItbFault(pc)
{ }
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -284,7 +284,7 @@ class ItbPageFault : public ItbFault
ItbPageFault(Addr pc)
: ItbFault(pc)
{ }
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -299,7 +299,7 @@ class ItbAcvFault : public ItbFault
ItbAcvFault(Addr pc)
: ItbFault(pc)
{ }
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -311,7 +311,7 @@ class UnimplementedOpcodeFault : public AlphaFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -323,7 +323,7 @@ class FloatEnableFault : public AlphaFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -337,7 +337,7 @@ class PalFault : public AlphaFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -349,7 +349,7 @@ class IntegerOverflowFault : public AlphaFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};

View file

@ -61,10 +61,10 @@ class MachineCheckFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
bool isMachineCheckFault() {return true;}
bool isMachineCheckFault() const {return true;}
};
class AlignmentFault : public MipsFault
@ -74,10 +74,10 @@ class AlignmentFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
bool isAlignmentFault() {return true;}
bool isAlignmentFault() const {return true;}
};
class UnimplementedOpcodeFault : public MipsFault
@ -87,7 +87,7 @@ class UnimplementedOpcodeFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -133,7 +133,7 @@ class ResetFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
void invoke(ThreadContext * tc);
@ -146,7 +146,7 @@ class CoprocessorUnusableFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
void invoke(ThreadContext * tc);
@ -159,7 +159,7 @@ class ReservedInstructionFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
void invoke(ThreadContext * tc);
@ -172,7 +172,7 @@ class ThreadFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
void invoke(ThreadContext * tc);
@ -188,7 +188,7 @@ class ArithmeticFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
#if FULL_SYSTEM
@ -205,7 +205,7 @@ class InterruptFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -217,7 +217,7 @@ class NDtbMissFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -229,7 +229,7 @@ class PDtbMissFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -241,7 +241,7 @@ class DtbPageFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -253,7 +253,7 @@ class DtbAcvFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -265,7 +265,7 @@ class ItbMissFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -277,7 +277,7 @@ class ItbPageFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -289,7 +289,7 @@ class ItbAcvFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -301,7 +301,7 @@ class FloatEnableFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -313,7 +313,7 @@ class IntegerOverflowFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
};
@ -325,7 +325,7 @@ class DspStateDisabledFault : public MipsFault
static FaultVect _vect;
static FaultStat _count;
public:
FaultName name() {return _name;}
FaultName name() const {return _name;}
FaultVect vect() {return _vect;}
FaultStat & countStat() {return _count;}
void invoke(ThreadContext * tc);

View file

@ -65,7 +65,6 @@ class SparcFaultBase : public FaultBase
#if FULL_SYSTEM
void invoke(ThreadContext * tc);
#endif
virtual FaultName name() = 0;
virtual TrapType trapType() = 0;
virtual FaultPriority priority() = 0;
virtual FaultStat & countStat() = 0;
@ -78,7 +77,7 @@ class SparcFault : public SparcFaultBase
protected:
static FaultVals vals;
public:
FaultName name() {return vals.name;}
FaultName name() const {return vals.name;}
TrapType trapType() {return vals.trapType;}
FaultPriority priority() {return vals.priority;}
FaultStat & countStat() {return vals.count;}
@ -133,7 +132,7 @@ class InternalProcessorError :
public SparcFault<InternalProcessorError>
{
public:
bool isMachineCheckFault() {return true;}
bool isMachineCheckFault() const {return true;}
};
class InstructionInvalidTSBEntry : public SparcFault<InstructionInvalidTSBEntry> {};
@ -152,7 +151,7 @@ class MemAddressNotAligned :
public SparcFault<MemAddressNotAligned>
{
public:
bool isAlignmentFault() {return true;}
bool isAlignmentFault() const {return true;}
};
class LDDFMemAddressNotAligned : public SparcFault<LDDFMemAddressNotAligned> {};

View file

@ -53,12 +53,12 @@ typedef Stats::Scalar<> FaultStat;
class FaultBase : public RefCounted
{
public:
virtual FaultName name() = 0;
virtual FaultName name() const = 0;
virtual void invoke(ThreadContext * tc);
// template<typename T>
// bool isA() {return dynamic_cast<T *>(this);}
virtual bool isMachineCheckFault() {return false;}
virtual bool isAlignmentFault() {return false;}
virtual bool isMachineCheckFault() const {return false;}
virtual bool isAlignmentFault() const {return false;}
};
FaultBase * const NoFault = 0;
@ -72,7 +72,7 @@ class UnimpFault : public FaultBase
: panicStr(_str)
{ }
FaultName name() {return "Unimplemented simulator feature";}
FaultName name() const {return "Unimplemented simulator feature";}
void invoke(ThreadContext * tc);
};
@ -82,7 +82,7 @@ class PageTableFault : public FaultBase
private:
Addr vaddr;
public:
FaultName name() {return "M5 page table fault";}
FaultName name() const {return "M5 page table fault";}
PageTableFault(Addr va) : vaddr(va) {}
void invoke(ThreadContext * tc);
};