summaryrefslogtreecommitdiff
path: root/arch/alpha/faults.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-03-01 00:09:08 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-03-01 00:09:08 -0500
commit69e91d761765b84429dc069b8fa1cd3f25925688 (patch)
treee2fe131e39c1ba9aeb5882bd231670a3f8e30304 /arch/alpha/faults.cc
parent34da58a698e4119876f04d13c337e9974970f49a (diff)
downloadgem5-69e91d761765b84429dc069b8fa1cd3f25925688.tar.xz
moved ev5_trap fully into the fault class.
--HG-- extra : convert_revision : 182cdec9a4e05f55edff0c6a114844b9ad2ca8db
Diffstat (limited to 'arch/alpha/faults.cc')
-rw-r--r--arch/alpha/faults.cc34
1 files changed, 25 insertions, 9 deletions
diff --git a/arch/alpha/faults.cc b/arch/alpha/faults.cc
index 78613761d..8c7dc3194 100644
--- a/arch/alpha/faults.cc
+++ b/arch/alpha/faults.cc
@@ -28,6 +28,9 @@
#include "arch/alpha/faults.hh"
#include "cpu/exec_context.hh"
+#include "cpu/base.hh"
+#include "base/trace.hh"
+#include "kern/kernel_stats.hh"
namespace AlphaISA
{
@@ -98,17 +101,30 @@ FaultStat IntegerOverflowFault::_stat;
void AlphaFault::ev5_trap(ExecContext * xc)
{
- xc->ev5_temp_trap(this);
-}
+ DPRINTF(Fault, "Fault %s at PC: %#x\n", name(), xc->regs.pc);
+ xc->cpu->recordEvent(csprintf("Fault %s", name()));
-void AlphaMachineCheckFault::ev5_trap(ExecContext * xc)
-{
- xc->ev5_temp_trap(this);
-}
+ assert(!xc->misspeculating());
+ xc->kernelStats->fault(this);
-void AlphaAlignmentFault::ev5_trap(ExecContext * xc)
-{
- xc->ev5_temp_trap(this);
+ if (isA<ArithmeticFault>())
+ panic("Arithmetic traps are unimplemented!");
+
+ // exception restart address
+ if (!isA<InterruptFault>() || !xc->inPalMode())
+ xc->setMiscReg(AlphaISA::IPR_EXC_ADDR, xc->regs.pc);
+
+ if (isA<PalFault>() || isA<ArithmeticFault>()) {
+ // traps... skip faulting instruction.
+ xc->setMiscReg(AlphaISA::IPR_EXC_ADDR,
+ xc->readMiscReg(AlphaISA::IPR_EXC_ADDR) + 4);
+ }
+
+ if (!xc->inPalMode())
+ AlphaISA::swap_palshadow(&(xc->regs), true);
+
+ xc->regs.pc = xc->readMiscReg(AlphaISA::IPR_PAL_BASE) + vect();
+ xc->regs.npc = xc->regs.pc + sizeof(MachInst);
}
#endif