summaryrefslogtreecommitdiff
path: root/arch/alpha
diff options
context:
space:
mode:
Diffstat (limited to 'arch/alpha')
-rw-r--r--arch/alpha/ev5.cc6
-rw-r--r--arch/alpha/faults.cc4
-rw-r--r--arch/alpha/faults.hh18
3 files changed, 12 insertions, 16 deletions
diff --git a/arch/alpha/ev5.cc b/arch/alpha/ev5.cc
index 23546bbe2..ca26fc257 100644
--- a/arch/alpha/ev5.cc
+++ b/arch/alpha/ev5.cc
@@ -192,7 +192,8 @@ ExecContext::ev5_temp_trap(Fault fault)
if (!inPalMode())
AlphaISA::swap_palshadow(&regs, true);
- regs.pc = ipr[AlphaISA::IPR_PAL_BASE] + ((AlphaFault *)(fault.get()))->vect();
+ regs.pc = ipr[AlphaISA::IPR_PAL_BASE] +
+ (dynamic_cast<AlphaFault *>(fault.get()))->vect();
regs.npc = regs.pc + sizeof(MachInst);
}
@@ -217,7 +218,8 @@ AlphaISA::intr_post(RegFile *regs, Fault fault, Addr pc)
// jump to expection address (PAL PC bit set here as well...)
if (!use_pc)
- regs->npc = ipr[IPR_PAL_BASE] + ((AlphaFault *)(fault.get()))->vect();
+ regs->npc = ipr[IPR_PAL_BASE] +
+ (dynamic_cast<AlphaFault *>(fault.get()))->vect();
else
regs->npc = ipr[IPR_PAL_BASE] + pc;
diff --git a/arch/alpha/faults.cc b/arch/alpha/faults.cc
index 2eedfedbd..78613761d 100644
--- a/arch/alpha/faults.cc
+++ b/arch/alpha/faults.cc
@@ -32,10 +32,6 @@
namespace AlphaISA
{
-FaultName AlphaFault::_name = "alphafault";
-FaultVect AlphaFault::_vect = 0x0000;
-FaultStat AlphaFault::_stat;
-
FaultVect AlphaMachineCheckFault::_vect = 0x0401;
FaultStat AlphaMachineCheckFault::_stat;
diff --git a/arch/alpha/faults.hh b/arch/alpha/faults.hh
index 7c52738c1..156faa8fb 100644
--- a/arch/alpha/faults.hh
+++ b/arch/alpha/faults.hh
@@ -38,22 +38,18 @@ namespace AlphaISA
typedef const Addr FaultVect;
-class AlphaFault : public FaultBase
+class AlphaFault : public virtual FaultBase
{
- private:
- static FaultName _name;
- static FaultVect _vect;
- static FaultStat _stat;
public:
#if FULL_SYSTEM
void ev5_trap(ExecContext * xc);
#endif
- FaultName name() {return _name;}
- virtual FaultVect vect() {return _vect;}
- virtual FaultStat & stat() {return _stat;}
+ virtual FaultVect vect() = 0;
};
-class AlphaMachineCheckFault : public MachineCheckFault
+class AlphaMachineCheckFault :
+ public MachineCheckFault,
+ public AlphaFault
{
private:
static FaultVect _vect;
@@ -66,7 +62,9 @@ class AlphaMachineCheckFault : public MachineCheckFault
FaultStat & stat() {return _stat;}
};
-class AlphaAlignmentFault : public AlignmentFault
+class AlphaAlignmentFault :
+ public AlignmentFault,
+ public AlphaFault
{
private:
static FaultVect _vect;