Changed ev5_trap from a function of the execution context to a function of the fault. The actual function still resides in the execution context.
--HG-- extra : convert_revision : 56e33536cdd9079ace03896b85ea3c84b6eb4e57
This commit is contained in:
parent
36b2d9815e
commit
6165419d35
|
@ -166,7 +166,7 @@ AlphaISA::zeroRegisters(CPU *cpu)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExecContext::ev5_trap(Fault fault)
|
ExecContext::ev5_temp_trap(Fault fault)
|
||||||
{
|
{
|
||||||
DPRINTF(Fault, "Fault %s at PC: %#x\n", fault->name(), regs.pc);
|
DPRINTF(Fault, "Fault %s at PC: %#x\n", fault->name(), regs.pc);
|
||||||
cpu->recordEvent(csprintf("Fault %s", fault->name()));
|
cpu->recordEvent(csprintf("Fault %s", fault->name()));
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "arch/alpha/faults.hh"
|
#include "arch/alpha/faults.hh"
|
||||||
|
#include "cpu/exec_context.hh"
|
||||||
|
|
||||||
namespace AlphaISA
|
namespace AlphaISA
|
||||||
{
|
{
|
||||||
|
@ -97,6 +98,25 @@ FaultName IntegerOverflowFault::_name = "intover";
|
||||||
FaultVect IntegerOverflowFault::_vect = 0x0501;
|
FaultVect IntegerOverflowFault::_vect = 0x0501;
|
||||||
FaultStat IntegerOverflowFault::_stat;
|
FaultStat IntegerOverflowFault::_stat;
|
||||||
|
|
||||||
|
#if FULL_SYSTEM
|
||||||
|
|
||||||
|
void AlphaFault::ev5_trap(ExecContext * xc)
|
||||||
|
{
|
||||||
|
xc->ev5_temp_trap(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AlphaMachineCheckFault::ev5_trap(ExecContext * xc)
|
||||||
|
{
|
||||||
|
xc->ev5_temp_trap(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AlphaAlignmentFault::ev5_trap(ExecContext * xc)
|
||||||
|
{
|
||||||
|
xc->ev5_temp_trap(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace AlphaISA
|
} // namespace AlphaISA
|
||||||
|
|
||||||
/*Fault * ListOfFaults[] = {
|
/*Fault * ListOfFaults[] = {
|
||||||
|
|
|
@ -45,6 +45,9 @@ class AlphaFault : public FaultBase
|
||||||
static FaultVect _vect;
|
static FaultVect _vect;
|
||||||
static FaultStat _stat;
|
static FaultStat _stat;
|
||||||
public:
|
public:
|
||||||
|
#if FULL_SYSTEM
|
||||||
|
void ev5_trap(ExecContext * xc);
|
||||||
|
#endif
|
||||||
FaultName name() {return _name;}
|
FaultName name() {return _name;}
|
||||||
virtual FaultVect vect() {return _vect;}
|
virtual FaultVect vect() {return _vect;}
|
||||||
virtual FaultStat & stat() {return _stat;}
|
virtual FaultStat & stat() {return _stat;}
|
||||||
|
@ -56,6 +59,9 @@ class AlphaMachineCheckFault : public MachineCheckFault
|
||||||
static FaultVect _vect;
|
static FaultVect _vect;
|
||||||
static FaultStat _stat;
|
static FaultStat _stat;
|
||||||
public:
|
public:
|
||||||
|
#if FULL_SYSTEM
|
||||||
|
void ev5_trap(ExecContext * xc);
|
||||||
|
#endif
|
||||||
FaultVect vect() {return _vect;}
|
FaultVect vect() {return _vect;}
|
||||||
FaultStat & stat() {return _stat;}
|
FaultStat & stat() {return _stat;}
|
||||||
};
|
};
|
||||||
|
@ -66,6 +72,9 @@ class AlphaAlignmentFault : public AlignmentFault
|
||||||
static FaultVect _vect;
|
static FaultVect _vect;
|
||||||
static FaultStat _stat;
|
static FaultStat _stat;
|
||||||
public:
|
public:
|
||||||
|
#if FULL_SYSTEM
|
||||||
|
void ev5_trap(ExecContext * xc);
|
||||||
|
#endif
|
||||||
FaultVect vect() {return _vect;}
|
FaultVect vect() {return _vect;}
|
||||||
FaultStat & stat() {return _stat;}
|
FaultStat & stat() {return _stat;}
|
||||||
};
|
};
|
||||||
|
|
|
@ -227,7 +227,7 @@ ExecContext::trap(Fault fault)
|
||||||
|
|
||||||
/** @todo: Going to hack it for now. Do a true fixup later. */
|
/** @todo: Going to hack it for now. Do a true fixup later. */
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
ev5_trap(fault);
|
fault->ev5_trap(this);
|
||||||
#else
|
#else
|
||||||
fatal("fault (%d) detected @ PC 0x%08p", fault, readPC());
|
fatal("fault (%d) detected @ PC 0x%08p", fault, readPC());
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -425,7 +425,7 @@ class ExecContext
|
||||||
void setIntrFlag(int val) { regs.intrflag = val; }
|
void setIntrFlag(int val) { regs.intrflag = val; }
|
||||||
Fault hwrei();
|
Fault hwrei();
|
||||||
bool inPalMode() { return AlphaISA::PcPAL(regs.pc); }
|
bool inPalMode() { return AlphaISA::PcPAL(regs.pc); }
|
||||||
void ev5_trap(Fault fault);
|
void ev5_temp_trap(Fault fault);
|
||||||
bool simPalCheck(int palFunc);
|
bool simPalCheck(int palFunc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -688,7 +688,7 @@ SimpleCPU::tick()
|
||||||
if (ipl && ipl > xc->regs.ipr[IPR_IPLR]) {
|
if (ipl && ipl > xc->regs.ipr[IPR_IPLR]) {
|
||||||
ipr[IPR_ISR] = summary;
|
ipr[IPR_ISR] = summary;
|
||||||
ipr[IPR_INTID] = ipl;
|
ipr[IPR_INTID] = ipl;
|
||||||
xc->ev5_trap(new InterruptFault);
|
(new InterruptFault)->ev5_trap(xc);
|
||||||
|
|
||||||
DPRINTF(Flow, "Interrupt! IPLR=%d ipl=%d summary=%x\n",
|
DPRINTF(Flow, "Interrupt! IPLR=%d ipl=%d summary=%x\n",
|
||||||
ipr[IPR_IPLR], ipl, summary);
|
ipr[IPR_IPLR], ipl, summary);
|
||||||
|
@ -812,7 +812,7 @@ SimpleCPU::tick()
|
||||||
|
|
||||||
if (fault != NoFault) {
|
if (fault != NoFault) {
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
xc->ev5_trap(fault);
|
fault->ev5_trap(xc);
|
||||||
#else // !FULL_SYSTEM
|
#else // !FULL_SYSTEM
|
||||||
fatal("fault (%d) detected @ PC 0x%08p", fault, xc->regs.pc);
|
fatal("fault (%d) detected @ PC 0x%08p", fault, xc->regs.pc);
|
||||||
#endif // FULL_SYSTEM
|
#endif // FULL_SYSTEM
|
||||||
|
|
|
@ -334,7 +334,7 @@ class SimpleCPU : public BaseCPU
|
||||||
int readIntrFlag() { return xc->readIntrFlag(); }
|
int readIntrFlag() { return xc->readIntrFlag(); }
|
||||||
void setIntrFlag(int val) { xc->setIntrFlag(val); }
|
void setIntrFlag(int val) { xc->setIntrFlag(val); }
|
||||||
bool inPalMode() { return xc->inPalMode(); }
|
bool inPalMode() { return xc->inPalMode(); }
|
||||||
void ev5_trap(Fault fault) { xc->ev5_trap(fault); }
|
void ev5_trap(Fault fault) { fault->ev5_trap(xc); }
|
||||||
bool simPalCheck(int palFunc) { return xc->simPalCheck(palFunc); }
|
bool simPalCheck(int palFunc) { return xc->simPalCheck(palFunc); }
|
||||||
#else
|
#else
|
||||||
void syscall() { xc->syscall(); }
|
void syscall() { xc->syscall(); }
|
||||||
|
|
|
@ -31,7 +31,9 @@
|
||||||
|
|
||||||
#include "base/refcnt.hh"
|
#include "base/refcnt.hh"
|
||||||
#include "sim/stats.hh"
|
#include "sim/stats.hh"
|
||||||
|
#include "config/full_system.hh"
|
||||||
|
|
||||||
|
class ExecContext;
|
||||||
class FaultBase;
|
class FaultBase;
|
||||||
typedef RefCountingPtr<FaultBase> Fault;
|
typedef RefCountingPtr<FaultBase> Fault;
|
||||||
|
|
||||||
|
@ -53,6 +55,9 @@ class FaultBase : public RefCounted
|
||||||
return "none";
|
return "none";
|
||||||
}
|
}
|
||||||
virtual FaultStat & stat() = 0;
|
virtual FaultStat & stat() = 0;
|
||||||
|
#if FULL_SYSTEM
|
||||||
|
virtual void ev5_trap(ExecContext * xc) = 0;
|
||||||
|
#endif
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool isA() {return dynamic_cast<T *>(this);}
|
bool isA() {return dynamic_cast<T *>(this);}
|
||||||
virtual bool isMachineCheckFault() {return false;}
|
virtual bool isMachineCheckFault() {return false;}
|
||||||
|
|
Loading…
Reference in a new issue