{
//Check for the system wide faults
if(fault == NoFault) return 0x0000;
- else if(fault->isA<MachineCheckFault>()) return 0x0401;
- else if(fault->isA<AlignmentFault>()) return 0x0301;
+ else if(fault->isMachineCheckFault()) return 0x0401;
+ else if(fault->isAlignmentFault()) return 0x0301;
//Deal with the alpha specific faults
return ((AlphaFault *)(fault.get()))->vect();
};
// translate to physical address
Fault fault = xc->translateDataReadReq(memReq);
- assert(!fault->isA<AlignmentFault>());
+ assert(!fault->isAlignmentFault());
if (fault == NoFault) {
xc->copySrcAddr = src;
// translate to physical address
Fault fault = xc->translateDataWriteReq(memReq);
- assert(!fault->isA<AlignmentFault>());
+ assert(!fault->isAlignmentFault());
if (fault == NoFault) {
Addr dest_addr = memReq->paddr + offset;
virtual FaultStat & stat() = 0;
template<typename T>
bool isA() {return dynamic_cast<T *>(this);}
+ virtual bool isMachineCheckFault() {return false;}
+ virtual bool isAlignmentFault() {return false;}
};
-static FaultBase * const NoFault __attribute__ ((unused)) = 0;
+FaultBase * const NoFault = 0;
+
+//The ISAs are each responsible for providing a genMachineCheckFault and a
+//genAlignmentFault functions, which return faults to use in the case of a
+//machine check fault or an alignment fault, respectively. Base classes which
+//provide the name() function, and the isMachineCheckFault and isAlignmentFault
+//functions are provided below.
class MachineCheckFault : public FaultBase
{
public:
FaultName name() {return _name;}
FaultStat & stat() {return _stat;}
+ bool isMachineCheckFault() {return true;}
};
class AlignmentFault : public FaultBase
public:
FaultName name() {return _name;}
FaultStat & stat() {return _stat;}
+ bool isAlignmentFault() {return true;}
};