diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/alpha/alpha_memory.cc | 6 | ||||
-rw-r--r-- | arch/alpha/faults.cc | 4 | ||||
-rw-r--r-- | arch/alpha/faults.hh | 31 |
3 files changed, 34 insertions, 7 deletions
diff --git a/arch/alpha/alpha_memory.cc b/arch/alpha/alpha_memory.cc index b2a829711..11baed106 100644 --- a/arch/alpha/alpha_memory.cc +++ b/arch/alpha/alpha_memory.cc @@ -380,7 +380,7 @@ AlphaITB::translate(MemReqPtr &req) const // check that the physical address is ok (catch bad physical addresses) if (req->paddr & ~PAddrImplMask) - return new MachineCheckFault; + return genMachineCheckFault(); checkCacheability(req); @@ -511,7 +511,7 @@ AlphaDTB::translate(MemReqPtr &req, bool write) const fault(req, write ? MM_STAT_WR_MASK : 0); DPRINTF(TLB, "Alignment Fault on %#x, size = %d", req->vaddr, req->size); - return new AlignmentFault; + return genAlignmentFault(); } if (pc & 0x1) { @@ -621,7 +621,7 @@ AlphaDTB::translate(MemReqPtr &req, bool write) const // check that the physical address is ok (catch bad physical addresses) if (req->paddr & ~PAddrImplMask) - return new MachineCheckFault; + return genMachineCheckFault(); checkCacheability(req); diff --git a/arch/alpha/faults.cc b/arch/alpha/faults.cc index bbddadabf..1df0de7c1 100644 --- a/arch/alpha/faults.cc +++ b/arch/alpha/faults.cc @@ -32,6 +32,10 @@ FaultName AlphaFault::_name = "alphafault"; FaultVect AlphaFault::_vect = 0x0000; FaultStat AlphaFault::_stat; +FaultVect AlphaMachineCheckFault::_vect = 0x0401; + +FaultVect AlphaAlignmentFault::_vect = 0x0301; + FaultName ResetFault::_name = "reset"; FaultVect ResetFault::_vect = 0x0001; FaultStat ResetFault::_stat; diff --git a/arch/alpha/faults.hh b/arch/alpha/faults.hh index bd5163a7d..2004c0911 100644 --- a/arch/alpha/faults.hh +++ b/arch/alpha/faults.hh @@ -31,7 +31,7 @@ #include "sim/faults.hh" -// The reasoning behind the name and vect functions is in sim/faults.hh +// The design of the "name" and "vect" functions is in sim/faults.hh typedef const Addr FaultVect; @@ -47,6 +47,32 @@ class AlphaFault : public FaultBase virtual FaultStat & stat() {return _stat;} }; +class AlphaMachineCheckFault : public MachineCheckFault +{ + private: + static FaultVect _vect; + public: + FaultVect vect() {return _vect;} +}; + +class AlphaAlignmentFault : public AlignmentFault +{ + private: + static FaultVect _vect; + public: + FaultVect vect() {return _vect;} +}; + +static inline Fault genMachineCheckFault() +{ + return new AlphaMachineCheckFault; +} + +static inline Fault genAlignmentFault() +{ + return new AlphaAlignmentFault; +} + class ResetFault : public AlphaFault { private: @@ -215,7 +241,4 @@ class IntegerOverflowFault : public AlphaFault FaultStat & stat() {return _stat;} }; -//Fault * ListOfFaults[]; -//int NumFaults; - #endif // __FAULTS_HH__ |