CPU: Eliminate the hwrei function.

This commit is contained in:
Gabe Black
2008-10-11 02:27:21 -07:00
parent 3af428606a
commit da7209ec93
15 changed files with 12 additions and 100 deletions

View File

@@ -552,23 +552,6 @@ copyIprs(ThreadContext *src, ThreadContext *dest)
using namespace AlphaISA;
Fault
SimpleThread::hwrei()
{
if (!(readPC() & 0x3))
return new UnimplementedOpcodeFault;
setNextPC(readMiscRegNoEffect(IPR_EXC_ADDR));
if (!misspeculating()) {
if (kernelStats)
kernelStats->hwrei();
}
// FIXME: XXX check for interrupts? XXX
return NoFault;
}
/**
* Check for special simulator handling of specific PAL calls.
* If return value is false, actual PAL call will be suppressed.

View File

@@ -786,7 +786,16 @@ decode OPCODE default Unknown::unknown() {
format BasicOperate {
0x1e: decode PALMODE {
0: OpcdecFault::hw_rei();
1:hw_rei({{ xc->hwrei(); }}, IsSerializing, IsSerializeBefore);
1: hw_rei({{
NPC = ExcAddr;
ThreadContext * tc = xc->tcBase();
if (!tc->misspeculating()) {
AlphaISA::Kernel::Statistics * kernelStats =
tc->getKernelStats();
if (kernelStats)
kernelStats->hwrei();
}
}}, IsSerializing, IsSerializeBefore);
}
// M5 special opcodes use the reserved 0x01 opcode space

View File

@@ -69,6 +69,7 @@ output exec {{
#include <math.h>
#if FULL_SYSTEM
#include "arch/alpha/kernel_stats.hh"
#include "sim/pseudo_inst.hh"
#endif
#include "arch/alpha/ipr.hh"
@@ -187,6 +188,7 @@ def operands {{
'Runiq': ('ControlReg', 'uq', 'MISCREG_UNIQ', None, 1),
'FPCR': ('ControlReg', 'uq', 'MISCREG_FPCR', None, 1),
'IntrFlag': ('ControlReg', 'uq', 'MISCREG_INTR', None, 1),
'ExcAddr': ('ControlReg', 'uq', 'IPR_EXC_ADDR', None, 1),
# The next two are hacks for non-full-system call-pal emulation
'R0': ('IntReg', 'uq', '0', None, 1),
'R16': ('IntReg', 'uq', '16', None, 1),

View File

@@ -336,7 +336,6 @@ class CheckerCPU : public BaseCPU
void translateDataReadReq(Request *req);
#if FULL_SYSTEM
Fault hwrei() { return thread->hwrei(); }
void ev5_trap(Fault fault) { fault->invoke(tc); }
bool simPalCheck(int palFunc) { return thread->simPalCheck(palFunc); }
#else

View File

@@ -144,10 +144,6 @@ class ExecContext {
void writeHint(Addr addr, int size, unsigned flags);
#if FULL_SYSTEM
/** Somewhat Alpha-specific function that handles returning from
* an error or interrupt. */
Fault hwrei();
/**
* Check for special simulator handling of specific PAL calls. If
* return value is false, actual PAL call will be suppressed.

View File

@@ -905,21 +905,6 @@ FullO3CPU<Impl>::post_interrupt(int int_num, int index)
}
}
template <class Impl>
Fault
FullO3CPU<Impl>::hwrei(unsigned tid)
{
#if THE_ISA == ALPHA_ISA
// Need to clear the lock flag upon returning from an interrupt.
this->setMiscRegNoEffect(AlphaISA::MISCREG_LOCKFLAG, false, tid);
this->thread[tid]->kernelStats->hwrei();
// FIXME: XXX check for interrupts? XXX
#endif
return NoFault;
}
template <class Impl>
bool
FullO3CPU<Impl>::simPalCheck(int palFunc, unsigned tid)

View File

@@ -414,9 +414,6 @@ class FullO3CPU : public BaseO3CPU
/** Posts an interrupt. */
void post_interrupt(int int_num, int index);
/** HW return from error interrupt. */
Fault hwrei(unsigned tid);
bool simPalCheck(int palFunc, unsigned tid);
/** Returns the Fault for any valid interrupt. */

View File

@@ -168,8 +168,6 @@ class BaseO3DynInst : public BaseDynInst<Impl>
}
#if FULL_SYSTEM
/** Calls hardware return from error interrupt. */
Fault hwrei();
/** Traps to handle specified fault. */
void trap(Fault fault);
bool simPalCheck(int palFunc);

View File

@@ -124,28 +124,6 @@ BaseO3DynInst<Impl>::completeAcc(PacketPtr pkt)
}
#if FULL_SYSTEM
template <class Impl>
Fault
BaseO3DynInst<Impl>::hwrei()
{
#if THE_ISA == ALPHA_ISA
// Can only do a hwrei when in pal mode.
if (!(this->readPC() & 0x3))
return new AlphaISA::UnimplementedOpcodeFault;
// Set the next PC based on the value of the EXC_ADDR IPR.
this->setNextPC(this->cpu->readMiscRegNoEffect(AlphaISA::IPR_EXC_ADDR,
this->threadNumber));
// Tell CPU to clear any state it needs to if a hwrei is taken.
this->cpu->hwrei(this->threadNumber);
#else
#endif
// FIXME: XXX check for interrupts? XXX
return NoFault;
}
template <class Impl>
void
BaseO3DynInst<Impl>::trap(Fault fault)

View File

@@ -510,7 +510,6 @@ class OzoneCPU : public BaseCPU
void dumpInsts() { frontEnd->dumpInsts(); }
#if FULL_SYSTEM
Fault hwrei();
bool simPalCheck(int palFunc);
void processInterrupts();
#else

View File

@@ -668,21 +668,6 @@ OzoneCPU<Impl>::setSyscallReturn(SyscallReturn return_value, int tid)
}
}
#else
template <class Impl>
Fault
OzoneCPU<Impl>::hwrei()
{
// Need to move this to ISA code
// May also need to make this per thread
lockFlag = false;
lockAddrList.clear();
thread.kernelStats->hwrei();
// FIXME: XXX check for interrupts? XXX
return NoFault;
}
template <class Impl>
void
OzoneCPU<Impl>::processInterrupts()

View File

@@ -240,7 +240,6 @@ class OzoneDynInst : public BaseDynInst<Impl>
void setMiscReg(int misc_reg, const MiscReg &val);
#if FULL_SYSTEM
Fault hwrei();
void trap(Fault fault);
bool simPalCheck(int palFunc);
#else

View File

@@ -248,21 +248,6 @@ OzoneDynInst<Impl>::setMiscReg(int misc_reg, const MiscReg &val)
#if FULL_SYSTEM
template <class Impl>
Fault
OzoneDynInst<Impl>::hwrei()
{
if (!(this->readPC() & 0x3))
return new AlphaISA::UnimplementedOpcodeFault;
this->setNextPC(this->thread->readMiscRegNoEffect(AlphaISA::IPR_EXC_ADDR));
this->cpu->hwrei();
// FIXME: XXX check for interrupts? XXX
return NoFault;
}
template <class Impl>
void
OzoneDynInst<Impl>::trap(Fault fault)

View File

@@ -413,7 +413,6 @@ class BaseSimpleCPU : public BaseCPU
//Fault CacheOp(uint8_t Op, Addr EA);
#if FULL_SYSTEM
Fault hwrei() { return thread->hwrei(); }
void ev5_trap(Fault fault) { fault->invoke(tc); }
bool simPalCheck(int palFunc) { return thread->simPalCheck(palFunc); }
#else

View File

@@ -185,8 +185,6 @@ class SimpleThread : public ThreadState
void dumpFuncProfile();
Fault hwrei();
bool simPalCheck(int palFunc);
#endif