diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2006-11-08 10:27:38 -0500 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2006-11-08 10:27:38 -0500 |
commit | 770b575c30e734b3ed9528558a72c476a9e4bf41 (patch) | |
tree | 82eee9dd3daf76983841d8de42c4af7760ebb88b /src/arch/sparc/faults.hh | |
parent | 9375caa3f1ac8ff8fe5bcf3b7de1f51a20b6cd91 (diff) | |
download | gem5-770b575c30e734b3ed9528558a72c476a9e4bf41.tar.xz |
Sorted faults by the trap type constant, expanded their names, added in new faults for ua2005, and commented out ones which are apparently dropped.
--HG--
extra : convert_revision : 32bd0c3a75d7c036ad4a3cb0bc1c32e0b6cb3d87
Diffstat (limited to 'src/arch/sparc/faults.hh')
-rw-r--r-- | src/arch/sparc/faults.hh | 161 |
1 files changed, 102 insertions, 59 deletions
diff --git a/src/arch/sparc/faults.hh b/src/arch/sparc/faults.hh index 9cc7739d9..e632502aa 100644 --- a/src/arch/sparc/faults.hh +++ b/src/arch/sparc/faults.hh @@ -45,11 +45,21 @@ typedef uint32_t FaultPriority; class SparcFaultBase : public FaultBase { public: + enum PrivilegeLevel + { + U, User = U, + P, Privileged = P, + H, Hyperprivileged = H, + NumLevels, + SH = -1, + ShouldntHappen = SH + }; struct FaultVals { const FaultName name; const TrapType trapType; const FaultPriority priority; + const PrivilegeLevel nextPrivilegeLevel[NumLevels]; FaultStat count; }; #if FULL_SYSTEM @@ -59,6 +69,7 @@ class SparcFaultBase : public FaultBase virtual TrapType trapType() = 0; virtual FaultPriority priority() = 0; virtual FaultStat & countStat() = 0; + virtual PrivilegeLevel getNextLevel(PrivilegeLevel current) = 0; }; template<typename T> @@ -71,48 +82,12 @@ class SparcFault : public SparcFaultBase TrapType trapType() {return vals.trapType;} FaultPriority priority() {return vals.priority;} FaultStat & countStat() {return vals.count;} + PrivilegeLevel getNextLevel(PrivilegeLevel current) + { + return vals.nextPrivilegeLevel[current]; + } }; -class InternalProcessorError : - public SparcFault<InternalProcessorError> -{ - public: - bool isMachineCheckFault() {return true;} -}; - -class MemAddressNotAligned : - public SparcFault<MemAddressNotAligned> -{ - public: - bool isAlignmentFault() {return true;} -}; - -#if !FULL_SYSTEM -class PageTableFault : public SparcFault<PageTableFault> -{ - private: - Addr vaddr; - public: - PageTableFault(Addr va) : vaddr(va) {} - void invoke(ThreadContext * tc); -}; - -static inline Fault genPageTableFault(Addr va) -{ - return new PageTableFault(va); -} -#endif - -static inline Fault genMachineCheckFault() -{ - return new InternalProcessorError; -} - -static inline Fault genAlignmentFault() -{ - return new MemAddressNotAligned; -} - class PowerOnReset : public SparcFault<PowerOnReset> { void invoke(ThreadContext * tc); @@ -126,9 +101,11 @@ class SoftwareInitiatedReset : public SparcFault<SoftwareInitiatedReset> {}; class REDStateException : public SparcFault<REDStateException> {}; +class StoreError : public SparcFault<StoreError> {}; + class InstructionAccessException : public SparcFault<InstructionAccessException> {}; -class InstructionAccessMMUMiss : public SparcFault<InstructionAccessMMUMiss> {}; +//class InstructionAccessMMUMiss : public SparcFault<InstructionAccessMMUMiss> {}; class InstructionAccessError : public SparcFault<InstructionAccessError> {}; @@ -136,9 +113,9 @@ class IllegalInstruction : public SparcFault<IllegalInstruction> {}; class PrivilegedOpcode : public SparcFault<PrivilegedOpcode> {}; -class UnimplementedLDD : public SparcFault<UnimplementedLDD> {}; +//class UnimplementedLDD : public SparcFault<UnimplementedLDD> {}; -class UnimplementedSTD : public SparcFault<UnimplementedSTD> {}; +//class UnimplementedSTD : public SparcFault<UnimplementedSTD> {}; class FpDisabled : public SparcFault<FpDisabled> {}; @@ -148,16 +125,36 @@ class FpExceptionOther : public SparcFault<FpExceptionOther> {}; class TagOverflow : public SparcFault<TagOverflow> {}; +class CleanWindow : public SparcFault<CleanWindow> {}; + class DivisionByZero : public SparcFault<DivisionByZero> {}; +class InternalProcessorError : + public SparcFault<InternalProcessorError> +{ + public: + bool isMachineCheckFault() {return true;} +}; + +class InstructionInvalidTSBEntry : public SparcFault<InstructionInvalidTSBEntry> {}; + +class DataInvalidTSBEntry : public SparcFault<DataInvalidTSBEntry> {}; + class DataAccessException : public SparcFault<DataAccessException> {}; -class DataAccessMMUMiss : public SparcFault<DataAccessMMUMiss> {}; +//class DataAccessMMUMiss : public SparcFault<DataAccessMMUMiss> {}; class DataAccessError : public SparcFault<DataAccessError> {}; class DataAccessProtection : public SparcFault<DataAccessProtection> {}; +class MemAddressNotAligned : + public SparcFault<MemAddressNotAligned> +{ + public: + bool isAlignmentFault() {return true;} +}; + class LDDFMemAddressNotAligned : public SparcFault<LDDFMemAddressNotAligned> {}; class STDFMemAddressNotAligned : public SparcFault<STDFMemAddressNotAligned> {}; @@ -168,9 +165,12 @@ class LDQFMemAddressNotAligned : public SparcFault<LDQFMemAddressNotAligned> {}; class STQFMemAddressNotAligned : public SparcFault<STQFMemAddressNotAligned> {}; -class AsyncDataError : public SparcFault<AsyncDataError> {}; +class InstructionRealTranslationMiss : + public SparcFault<InstructionRealTranslationMiss> {}; -class CleanWindow : public SparcFault<CleanWindow> {}; +class DataRealTranslationMiss : public SparcFault<DataRealTranslationMiss> {}; + +//class AsyncDataError : public SparcFault<AsyncDataError> {}; template <class T> class EnumeratedFault : public SparcFault<T> @@ -185,16 +185,37 @@ class EnumeratedFault : public SparcFault<T> class InterruptLevelN : public EnumeratedFault<InterruptLevelN> { public: - InterruptLevelN(uint32_t n) : - EnumeratedFault<InterruptLevelN>(n) {;} - FaultPriority priority() {return 32 - _n;} + InterruptLevelN(uint32_t n) : EnumeratedFault<InterruptLevelN>(n) {;} + FaultPriority priority() {return 3200 - _n*100;} }; +class HstickMatch : public SparcFault<HstickMatch> {}; + +class TrapLevelZero : public SparcFault<TrapLevelZero> {}; + +class PAWatchpoint : public SparcFault<PAWatchpoint> {}; + +class VAWatchpoint : public SparcFault<VAWatchpoint> {}; + +class FastInstructionAccessMMUMiss : + public SparcFault<FastInstructionAccessMMUMiss> {}; + +class FastDataAccessMMUMiss : public SparcFault<FastDataAccessMMUMiss> {}; + +class FastDataAccessProtection : public SparcFault<FastDataAccessProtection> {}; + +class InstructionBreakpoint : public SparcFault<InstructionBreakpoint> {}; + +class CpuMondo : public SparcFault<CpuMondo> {}; + +class DevMondo : public SparcFault<DevMondo> {}; + +class ResumeableError : public SparcFault<ResumeableError> {}; + class SpillNNormal : public EnumeratedFault<SpillNNormal> { public: - SpillNNormal(uint32_t n) : - EnumeratedFault<SpillNNormal>(n) {;} + SpillNNormal(uint32_t n) : EnumeratedFault<SpillNNormal>(n) {;} //These need to be handled specially to enable spill traps in SE #if !FULL_SYSTEM void invoke(ThreadContext * tc); @@ -204,15 +225,13 @@ class SpillNNormal : public EnumeratedFault<SpillNNormal> class SpillNOther : public EnumeratedFault<SpillNOther> { public: - SpillNOther(uint32_t n) : - EnumeratedFault<SpillNOther>(n) {;} + SpillNOther(uint32_t n) : EnumeratedFault<SpillNOther>(n) {;} }; class FillNNormal : public EnumeratedFault<FillNNormal> { public: - FillNNormal(uint32_t n) : - EnumeratedFault<FillNNormal>(n) {;} + FillNNormal(uint32_t n) : EnumeratedFault<FillNNormal>(n) {;} //These need to be handled specially to enable fill traps in SE #if !FULL_SYSTEM void invoke(ThreadContext * tc); @@ -222,18 +241,42 @@ class FillNNormal : public EnumeratedFault<FillNNormal> class FillNOther : public EnumeratedFault<FillNOther> { public: - FillNOther(uint32_t n) : - EnumeratedFault<FillNOther>(n) {;} + FillNOther(uint32_t n) : EnumeratedFault<FillNOther>(n) {;} }; class TrapInstruction : public EnumeratedFault<TrapInstruction> { public: - TrapInstruction(uint32_t n) : - EnumeratedFault<TrapInstruction>(n) {;} + TrapInstruction(uint32_t n) : EnumeratedFault<TrapInstruction>(n) {;} +}; + +#if !FULL_SYSTEM +class PageTableFault : public SparcFault<PageTableFault> +{ + private: + Addr vaddr; + public: + PageTableFault(Addr va) : vaddr(va) {} + void invoke(ThreadContext * tc); }; +static inline Fault genPageTableFault(Addr va) +{ + return new PageTableFault(va); +} +#endif + +static inline Fault genMachineCheckFault() +{ + return new InternalProcessorError; +} + +static inline Fault genAlignmentFault() +{ + return new MemAddressNotAligned; +} + } // SparcISA namespace |