Got rid of the multiple inheritance in the Fault classes, and the base MachineCheck and Alignment faults.

--HG--
extra : convert_revision : 4b1429ef5c7a11c25e28f2bc868cc1481a08c5d1
This commit is contained in:
Gabe Black 2006-03-01 19:03:42 -05:00
parent b71f9c801e
commit 6b7d627903
4 changed files with 18 additions and 40 deletions

View file

@ -35,11 +35,13 @@
namespace AlphaISA
{
FaultVect AlphaMachineCheckFault::_vect = 0x0401;
FaultStat AlphaMachineCheckFault::_stat;
FaultName MachineCheckFault::_name = "mchk";
FaultVect MachineCheckFault::_vect = 0x0401;
FaultStat MachineCheckFault::_stat;
FaultVect AlphaAlignmentFault::_vect = 0x0301;
FaultStat AlphaAlignmentFault::_stat;
FaultName AlignmentFault::_name = "unalign";
FaultVect AlignmentFault::_vect = 0x0301;
FaultStat AlignmentFault::_stat;
FaultName ResetFault::_name = "reset";
FaultVect ResetFault::_vect = 0x0001;

View file

@ -50,38 +50,40 @@ class AlphaFault : public virtual FaultBase
virtual FaultVect vect() = 0;
};
class AlphaMachineCheckFault :
public MachineCheckFault,
public AlphaFault
class MachineCheckFault : public AlphaFault
{
private:
static FaultName _name;
static FaultVect _vect;
static FaultStat _stat;
public:
FaultName name() {return _name;}
FaultVect vect() {return _vect;}
FaultStat & stat() {return _stat;}
bool isMachineCheckFault() {return true;}
};
class AlphaAlignmentFault :
public AlignmentFault,
public AlphaFault
class AlignmentFault : public AlphaFault
{
private:
static FaultName _name;
static FaultVect _vect;
static FaultStat _stat;
public:
FaultName name() {return _name;}
FaultVect vect() {return _vect;}
FaultStat & stat() {return _stat;}
bool isAlignmentFault() {return true;}
};
static inline Fault genMachineCheckFault()
{
return new AlphaMachineCheckFault;
return new MachineCheckFault;
}
static inline Fault genAlignmentFault()
{
return new AlphaAlignmentFault;
return new AlignmentFault;
}
class ResetFault : public AlphaFault
@ -108,7 +110,9 @@ class ArithmeticFault : public AlphaFault
FaultName name() {return _name;}
FaultVect vect() {return _vect;}
FaultStat & stat() {return _stat;}
#if FULL_SYSTEM
void invoke(ExecContext * xc);
#endif
};
class InterruptFault : public AlphaFault

View file

@ -29,9 +29,6 @@
#include "sim/faults.hh"
#include "cpu/exec_context.hh"
FaultName MachineCheckFault::_name = "mchk";
FaultName AlignmentFault::_name = "unalign";
#if !FULL_SYSTEM
void FaultBase::invoke(ExecContext * xc)
{

View file

@ -65,29 +65,4 @@ class FaultBase : public RefCounted
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 virtual FaultBase
{
private:
static FaultName _name;
public:
FaultName name() {return _name;}
bool isMachineCheckFault() {return true;}
};
class AlignmentFault : public virtual FaultBase
{
private:
static FaultName _name;
public:
FaultName name() {return _name;}
bool isAlignmentFault() {return true;}
};
#endif // __FAULTS_HH__