arch: Pass faults by const reference where possible

This patch changes how faults are passed between methods in an attempt
to copy as few reference-counting pointer instances as possible. This
should avoid unecessary copies being created, contributing to the
increment/decrement of the reference counters.
This commit is contained in:
Andreas Hansson 2014-09-19 10:35:18 -04:00
parent 619c5519fe
commit 41fc8a573e
36 changed files with 71 additions and 69 deletions

View file

@ -171,7 +171,7 @@ Stage2LookUp::mergeTe(RequestPtr req, BaseTLB::Mode mode)
} }
void void
Stage2LookUp::finish(Fault _fault, RequestPtr req, Stage2LookUp::finish(const Fault &_fault, RequestPtr req,
ThreadContext *tc, BaseTLB::Mode mode) ThreadContext *tc, BaseTLB::Mode mode)
{ {
fault = _fault; fault = _fault;

View file

@ -97,7 +97,7 @@ class Stage2LookUp : public BaseTLB::Translation
void markDelayed() {} void markDelayed() {}
void finish(Fault fault, RequestPtr req, ThreadContext *tc, void finish(const Fault &fault, RequestPtr req, ThreadContext *tc,
BaseTLB::Mode mode); BaseTLB::Mode mode);
}; };

View file

@ -114,8 +114,8 @@ Stage2MMU::Stage2Translation::Stage2Translation(Stage2MMU &_parent,
} }
void void
Stage2MMU::Stage2Translation::finish(Fault _fault, RequestPtr req, ThreadContext *tc, Stage2MMU::Stage2Translation::finish(const Fault &_fault, RequestPtr req,
BaseTLB::Mode mode) ThreadContext *tc, BaseTLB::Mode mode)
{ {
fault = _fault; fault = _fault;

View file

@ -78,7 +78,7 @@ class Stage2MMU : public SimObject
markDelayed() {} markDelayed() {}
void void
finish(Fault fault, RequestPtr req, ThreadContext *tc, finish(const Fault &fault, RequestPtr req, ThreadContext *tc,
BaseTLB::Mode mode); BaseTLB::Mode mode);
void setVirt(Addr vaddr, int size, Request::Flags flags, int masterId) void setVirt(Addr vaddr, int size, Request::Flags flags, int masterId)

View file

@ -426,7 +426,7 @@ class Checker : public CheckerCPU
void switchOut(); void switchOut();
void takeOverFrom(BaseCPU *oldCPU); void takeOverFrom(BaseCPU *oldCPU);
void advancePC(Fault fault); void advancePC(const Fault &fault);
void verify(DynInstPtr &inst); void verify(DynInstPtr &inst);

View file

@ -69,7 +69,7 @@ using namespace TheISA;
template <class Impl> template <class Impl>
void void
Checker<Impl>::advancePC(Fault fault) Checker<Impl>::advancePC(const Fault &fault)
{ {
if (fault != NoFault) { if (fault != NoFault) {
curMacroStaticInst = StaticInst::nullStaticInstPtr; curMacroStaticInst = StaticInst::nullStaticInstPtr;

View file

@ -128,8 +128,8 @@ InOrderCPU::TickEvent::description() const
} }
InOrderCPU::CPUEvent::CPUEvent(InOrderCPU *_cpu, CPUEventType e_type, InOrderCPU::CPUEvent::CPUEvent(InOrderCPU *_cpu, CPUEventType e_type,
Fault fault, ThreadID _tid, DynInstPtr inst, const Fault &fault, ThreadID _tid,
CPUEventPri event_pri) DynInstPtr inst, CPUEventPri event_pri)
: Event(event_pri), cpu(_cpu) : Event(event_pri), cpu(_cpu)
{ {
setEvent(e_type, fault, _tid, inst); setEvent(e_type, fault, _tid, inst);
@ -910,7 +910,7 @@ InOrderCPU::getInterrupts()
} }
void void
InOrderCPU::processInterrupts(Fault interrupt) InOrderCPU::processInterrupts(const Fault &interrupt)
{ {
// Check for interrupts here. For now can copy the code that // Check for interrupts here. For now can copy the code that
// exists within isa_fullsys_traits.hh. Also assume that thread 0 // exists within isa_fullsys_traits.hh. Also assume that thread 0
@ -928,7 +928,7 @@ InOrderCPU::processInterrupts(Fault interrupt)
} }
void void
InOrderCPU::trapContext(Fault fault, ThreadID tid, DynInstPtr inst, InOrderCPU::trapContext(const Fault &fault, ThreadID tid, DynInstPtr inst,
Cycles delay) Cycles delay)
{ {
scheduleCpuEvent(Trap, fault, tid, inst, delay); scheduleCpuEvent(Trap, fault, tid, inst, delay);
@ -936,7 +936,7 @@ InOrderCPU::trapContext(Fault fault, ThreadID tid, DynInstPtr inst,
} }
void void
InOrderCPU::trap(Fault fault, ThreadID tid, DynInstPtr inst) InOrderCPU::trap(const Fault &fault, ThreadID tid, DynInstPtr inst)
{ {
fault->invoke(tcBase(tid), inst->staticInst); fault->invoke(tcBase(tid), inst->staticInst);
removePipelineStalls(tid); removePipelineStalls(tid);
@ -970,7 +970,7 @@ InOrderCPU::squashDueToMemStall(int stage_num, InstSeqNum seq_num,
} }
void void
InOrderCPU::scheduleCpuEvent(CPUEventType c_event, Fault fault, InOrderCPU::scheduleCpuEvent(CPUEventType c_event, const Fault &fault,
ThreadID tid, DynInstPtr inst, ThreadID tid, DynInstPtr inst,
Cycles delay, CPUEventPri event_pri) Cycles delay, CPUEventPri event_pri)
{ {
@ -1847,7 +1847,7 @@ InOrderCPU::wakeup()
} }
void void
InOrderCPU::syscallContext(Fault fault, ThreadID tid, DynInstPtr inst, InOrderCPU::syscallContext(const Fault &fault, ThreadID tid, DynInstPtr inst,
Cycles delay) Cycles delay)
{ {
// Syscall must be non-speculative, so squash from last stage // Syscall must be non-speculative, so squash from last stage

View file

@ -263,11 +263,11 @@ class InOrderCPU : public BaseCPU
public: public:
/** Constructs a CPU event. */ /** Constructs a CPU event. */
CPUEvent(InOrderCPU *_cpu, CPUEventType e_type, Fault fault, CPUEvent(InOrderCPU *_cpu, CPUEventType e_type, const Fault &fault,
ThreadID _tid, DynInstPtr inst, CPUEventPri event_pri); ThreadID _tid, DynInstPtr inst, CPUEventPri event_pri);
/** Set Type of Event To Be Scheduled */ /** Set Type of Event To Be Scheduled */
void setEvent(CPUEventType e_type, Fault _fault, ThreadID _tid, void setEvent(CPUEventType e_type, const Fault &_fault, ThreadID _tid,
DynInstPtr _inst) DynInstPtr _inst)
{ {
fault = _fault; fault = _fault;
@ -291,7 +291,8 @@ class InOrderCPU : public BaseCPU
}; };
/** Schedule a CPU Event */ /** Schedule a CPU Event */
void scheduleCpuEvent(CPUEventType cpu_event, Fault fault, ThreadID tid, void scheduleCpuEvent(CPUEventType cpu_event, const Fault &fault,
ThreadID tid,
DynInstPtr inst, Cycles delay = Cycles(0), DynInstPtr inst, Cycles delay = Cycles(0),
CPUEventPri event_pri = InOrderCPU_Pri); CPUEventPri event_pri = InOrderCPU_Pri);
@ -471,7 +472,7 @@ class InOrderCPU : public BaseCPU
Fault getInterrupts(); Fault getInterrupts();
/** Processes any an interrupt fault. */ /** Processes any an interrupt fault. */
void processInterrupts(Fault interrupt); void processInterrupts(const Fault &interrupt);
/** Halts the CPU. */ /** Halts the CPU. */
void halt() { panic("Halt not implemented!\n"); } void halt() { panic("Halt not implemented!\n"); }
@ -483,18 +484,18 @@ class InOrderCPU : public BaseCPU
bool validDataAddr(Addr addr) { return true; } bool validDataAddr(Addr addr) { return true; }
/** Schedule a syscall on the CPU */ /** Schedule a syscall on the CPU */
void syscallContext(Fault fault, ThreadID tid, DynInstPtr inst, void syscallContext(const Fault &fault, ThreadID tid, DynInstPtr inst,
Cycles delay = Cycles(0)); Cycles delay = Cycles(0));
/** Executes a syscall.*/ /** Executes a syscall.*/
void syscall(int64_t callnum, ThreadID tid); void syscall(int64_t callnum, ThreadID tid);
/** Schedule a trap on the CPU */ /** Schedule a trap on the CPU */
void trapContext(Fault fault, ThreadID tid, DynInstPtr inst, void trapContext(const Fault &fault, ThreadID tid, DynInstPtr inst,
Cycles delay = Cycles(0)); Cycles delay = Cycles(0));
/** Perform trap to Handle Given Fault */ /** Perform trap to Handle Given Fault */
void trap(Fault fault, ThreadID tid, DynInstPtr inst); void trap(const Fault &fault, ThreadID tid, DynInstPtr inst);
/** Schedule thread activation on the CPU */ /** Schedule thread activation on the CPU */
void activateContext(ThreadID tid, Cycles delay = Cycles(0)); void activateContext(ThreadID tid, Cycles delay = Cycles(0));

View file

@ -298,7 +298,7 @@ InOrderDynInst::hwrei()
void void
InOrderDynInst::trap(Fault fault) InOrderDynInst::trap(const Fault &fault)
{ {
this->cpu->trap(fault, this->threadNumber, this); this->cpu->trap(fault, this->threadNumber, this);
} }

View file

@ -524,7 +524,7 @@ class InOrderDynInst : public ExecContext, public RefCounted
/** Calls hardware return from error interrupt. */ /** Calls hardware return from error interrupt. */
Fault hwrei(); Fault hwrei();
/** Traps to handle specified fault. */ /** Traps to handle specified fault. */
void trap(Fault fault); void trap(const Fault &fault);
bool simPalCheck(int palFunc); bool simPalCheck(int palFunc);
short syscallNum; short syscallNum;

View file

@ -104,7 +104,7 @@ class Resource {
virtual void instGraduated(InstSeqNum seq_num, ThreadID tid) { } virtual void instGraduated(InstSeqNum seq_num, ThreadID tid) { }
/** Post-processsing for Trap Generated from this instruction */ /** Post-processsing for Trap Generated from this instruction */
virtual void trap(Fault fault, ThreadID tid, DynInstPtr inst) { } virtual void trap(const Fault &fault, ThreadID tid, DynInstPtr inst) { }
/** Request usage of this resource. Returns a ResourceRequest object /** Request usage of this resource. Returns a ResourceRequest object
* with all the necessary resource information * with all the necessary resource information

View file

@ -206,7 +206,7 @@ ResourcePool::squash(DynInstPtr inst, int res_idx, InstSeqNum done_seq_num,
} }
void void
ResourcePool::trap(Fault fault, ThreadID tid, DynInstPtr inst) ResourcePool::trap(const Fault &fault, ThreadID tid, DynInstPtr inst)
{ {
DPRINTF(Resource, "[tid:%i] Broadcasting Trap to all " DPRINTF(Resource, "[tid:%i] Broadcasting Trap to all "
"resources.\n", tid); "resources.\n", tid);

View file

@ -193,7 +193,7 @@ class ResourcePool {
void instGraduated(InstSeqNum seq_num, ThreadID tid); void instGraduated(InstSeqNum seq_num, ThreadID tid);
/** Broadcast trap to all resources */ /** Broadcast trap to all resources */
void trap(Fault fault, ThreadID tid, DynInstPtr inst); void trap(const Fault &fault, ThreadID tid, DynInstPtr inst);
/** The number of instructions available that a resource can /** The number of instructions available that a resource can
* can still process. * can still process.

View file

@ -405,7 +405,7 @@ CacheUnit::doTLBAccess(DynInstPtr inst, CacheReqPtr cache_req, int acc_size,
} }
void void
CacheUnit::trap(Fault fault, ThreadID tid, DynInstPtr inst) CacheUnit::trap(const Fault &fault, ThreadID tid, DynInstPtr inst)
{ {
tlbBlocked[tid] = false; tlbBlocked[tid] = false;
} }

View file

@ -113,7 +113,7 @@ class CacheUnit : public Resource
bool processSquash(CacheReqPacket *cache_pkt); bool processSquash(CacheReqPacket *cache_pkt);
void trap(Fault fault, ThreadID tid, DynInstPtr inst); void trap(const Fault &fault, ThreadID tid, DynInstPtr inst);
void recvRetry(); void recvRetry();

View file

@ -304,7 +304,7 @@ FetchSeqUnit::suspendThread(ThreadID tid)
} }
void void
FetchSeqUnit::trap(Fault fault, ThreadID tid, DynInstPtr inst) FetchSeqUnit::trap(const Fault &fault, ThreadID tid, DynInstPtr inst)
{ {
pcValid[tid] = true; pcValid[tid] = true;
pc[tid] = cpu->pcState(tid); pc[tid] = cpu->pcState(tid);

View file

@ -71,7 +71,7 @@ class FetchSeqUnit : public Resource {
InstSeqNum squash_seq_num, ThreadID tid); InstSeqNum squash_seq_num, ThreadID tid);
/** Update to correct PC from a trap */ /** Update to correct PC from a trap */
void trap(Fault fault, ThreadID tid, DynInstPtr inst); void trap(const Fault &fault, ThreadID tid, DynInstPtr inst);
protected: protected:
unsigned instSize; unsigned instSize;

View file

@ -574,7 +574,7 @@ FetchUnit::squashCacheRequest(CacheReqPtr req_ptr)
} }
void void
FetchUnit::trap(Fault fault, ThreadID tid, DynInstPtr inst) FetchUnit::trap(const Fault &fault, ThreadID tid, DynInstPtr inst)
{ {
//@todo: per thread? //@todo: per thread?
decoder[tid]->reset(); decoder[tid]->reset();

View file

@ -87,7 +87,7 @@ class FetchUnit : public CacheUnit
/** Executes one of the commands from the "Command" enum */ /** Executes one of the commands from the "Command" enum */
void execute(int slot_num); void execute(int slot_num);
void trap(Fault fault, ThreadID tid, DynInstPtr inst); void trap(const Fault &fault, ThreadID tid, DynInstPtr inst);
TheISA::Decoder *decoder[ThePipeline::MaxThreads]; TheISA::Decoder *decoder[ThePipeline::MaxThreads];

View file

@ -204,8 +204,8 @@ Fetch1::FetchRequest::makePacket()
} }
void void
Fetch1::FetchRequest::finish( Fetch1::FetchRequest::finish(const Fault &fault_, RequestPtr request_,
Fault fault_, RequestPtr request_, ThreadContext *tc, BaseTLB::Mode mode) ThreadContext *tc, BaseTLB::Mode mode)
{ {
fault = fault_; fault = fault_;

View file

@ -163,8 +163,8 @@ class Fetch1 : public Named
/** Interface for ITLB responses. Populates self and then passes /** Interface for ITLB responses. Populates self and then passes
* the request on to the ports' handleTLBResponse member * the request on to the ports' handleTLBResponse member
* function */ * function */
void finish(Fault fault_, RequestPtr request_, ThreadContext *tc, void finish(const Fault &fault_, RequestPtr request_,
BaseTLB::Mode mode); ThreadContext *tc, BaseTLB::Mode mode);
public: public:
FetchRequest(Fetch1 &fetch_, InstId id_, TheISA::PCState pc_) : FetchRequest(Fetch1 &fetch_, InstId id_, TheISA::PCState pc_) :

View file

@ -226,8 +226,8 @@ LSQ::clearMemBarrier(MinorDynInstPtr inst)
} }
void void
LSQ::SingleDataRequest::finish(Fault fault_, RequestPtr request_, LSQ::SingleDataRequest::finish(const Fault &fault_, RequestPtr request_,
ThreadContext *tc, BaseTLB::Mode mode) ThreadContext *tc, BaseTLB::Mode mode)
{ {
fault = fault_; fault = fault_;
@ -273,8 +273,8 @@ LSQ::SingleDataRequest::retireResponse(PacketPtr packet_)
} }
void void
LSQ::SplitDataRequest::finish(Fault fault_, RequestPtr request_, LSQ::SplitDataRequest::finish(const Fault &fault_, RequestPtr request_,
ThreadContext *tc, BaseTLB::Mode mode) ThreadContext *tc, BaseTLB::Mode mode)
{ {
fault = fault_; fault = fault_;

View file

@ -268,8 +268,8 @@ class LSQ : public Named
{ {
protected: protected:
/** TLB interace */ /** TLB interace */
void finish(Fault fault_, RequestPtr request_, ThreadContext *tc, void finish(const Fault &fault_, RequestPtr request_,
BaseTLB::Mode mode) ThreadContext *tc, BaseTLB::Mode mode)
{ } { }
public: public:
@ -329,8 +329,8 @@ class LSQ : public Named
{ {
protected: protected:
/** TLB interace */ /** TLB interace */
void finish(Fault fault_, RequestPtr request_, ThreadContext *tc, void finish(const Fault &fault_, RequestPtr request_,
BaseTLB::Mode mode); ThreadContext *tc, BaseTLB::Mode mode);
/** Has my only packet been sent to the memory system but has not /** Has my only packet been sent to the memory system but has not
* yet been responded to */ * yet been responded to */
@ -415,8 +415,8 @@ class LSQ : public Named
protected: protected:
/** TLB response interface */ /** TLB response interface */
void finish(Fault fault_, RequestPtr request_, ThreadContext *tc, void finish(const Fault &fault_, RequestPtr request_,
BaseTLB::Mode mode); ThreadContext *tc, BaseTLB::Mode mode);
public: public:
SplitDataRequest(LSQ &port_, MinorDynInstPtr inst_, SplitDataRequest(LSQ &port_, MinorDynInstPtr inst_,

View file

@ -1095,7 +1095,7 @@ FullO3CPU<Impl>::getInterrupts()
template <class Impl> template <class Impl>
void void
FullO3CPU<Impl>::processInterrupts(Fault interrupt) FullO3CPU<Impl>::processInterrupts(const Fault &interrupt)
{ {
// Check for interrupts here. For now can copy the code that // Check for interrupts here. For now can copy the code that
// exists within isa_fullsys_traits.hh. Also assume that thread 0 // exists within isa_fullsys_traits.hh. Also assume that thread 0
@ -1112,7 +1112,7 @@ FullO3CPU<Impl>::processInterrupts(Fault interrupt)
template <class Impl> template <class Impl>
void void
FullO3CPU<Impl>::trap(Fault fault, ThreadID tid, StaticInstPtr inst) FullO3CPU<Impl>::trap(const Fault &fault, ThreadID tid, StaticInstPtr inst)
{ {
// Pass the thread's TC into the invoke method. // Pass the thread's TC into the invoke method.
fault->invoke(this->threadContexts[tid], inst); fault->invoke(this->threadContexts[tid], inst);

View file

@ -498,7 +498,7 @@ class FullO3CPU : public BaseO3CPU
{ return globalSeqNum++; } { return globalSeqNum++; }
/** Traps to handle given fault. */ /** Traps to handle given fault. */
void trap(Fault fault, ThreadID tid, StaticInstPtr inst); void trap(const Fault &fault, ThreadID tid, StaticInstPtr inst);
/** HW return from error interrupt. */ /** HW return from error interrupt. */
Fault hwrei(ThreadID tid); Fault hwrei(ThreadID tid);
@ -509,7 +509,7 @@ class FullO3CPU : public BaseO3CPU
Fault getInterrupts(); Fault getInterrupts();
/** Processes any an interrupt fault. */ /** Processes any an interrupt fault. */
void processInterrupts(Fault interrupt); void processInterrupts(const Fault &interrupt);
/** Halts the CPU. */ /** Halts the CPU. */
void halt() { panic("Halt not implemented!\n"); } void halt() { panic("Halt not implemented!\n"); }

View file

@ -230,7 +230,7 @@ class BaseO3DynInst : public BaseDynInst<Impl>
/** Calls hardware return from error interrupt. */ /** Calls hardware return from error interrupt. */
Fault hwrei(); Fault hwrei();
/** Traps to handle specified fault. */ /** Traps to handle specified fault. */
void trap(Fault fault); void trap(const Fault &fault);
bool simPalCheck(int palFunc); bool simPalCheck(int palFunc);
/** Emulates a syscall. */ /** Emulates a syscall. */

View file

@ -225,7 +225,7 @@ BaseO3DynInst<Impl>::hwrei()
template <class Impl> template <class Impl>
void void
BaseO3DynInst<Impl>::trap(Fault fault) BaseO3DynInst<Impl>::trap(const Fault &fault)
{ {
this->cpu->trap(fault, this->threadNumber, this->staticInst); this->cpu->trap(fault, this->threadNumber, this->staticInst);
} }

View file

@ -100,7 +100,7 @@ class DefaultFetch
{} {}
void void
finish(Fault fault, RequestPtr req, ThreadContext *tc, finish(const Fault &fault, RequestPtr req, ThreadContext *tc,
BaseTLB::Mode mode) BaseTLB::Mode mode)
{ {
assert(mode == BaseTLB::Execute); assert(mode == BaseTLB::Execute);
@ -294,7 +294,7 @@ class DefaultFetch
* @return Any fault that occured. * @return Any fault that occured.
*/ */
bool fetchCacheLine(Addr vaddr, ThreadID tid, Addr pc); bool fetchCacheLine(Addr vaddr, ThreadID tid, Addr pc);
void finishTranslation(Fault fault, RequestPtr mem_req); void finishTranslation(const Fault &fault, RequestPtr mem_req);
/** Check if an interrupt is pending and that we need to handle /** Check if an interrupt is pending and that we need to handle

View file

@ -633,7 +633,7 @@ DefaultFetch<Impl>::fetchCacheLine(Addr vaddr, ThreadID tid, Addr pc)
template <class Impl> template <class Impl>
void void
DefaultFetch<Impl>::finishTranslation(Fault fault, RequestPtr mem_req) DefaultFetch<Impl>::finishTranslation(const Fault &fault, RequestPtr mem_req)
{ {
ThreadID tid = mem_req->threadId(); ThreadID tid = mem_req->threadId();
Addr fetchBufferBlockPC = mem_req->getVaddr(); Addr fetchBufferBlockPC = mem_req->getVaddr();

View file

@ -255,7 +255,7 @@ OzoneDynInst<Impl>::hwrei()
template <class Impl> template <class Impl>
void void
OzoneDynInst<Impl>::trap(Fault fault) OzoneDynInst<Impl>::trap(const Fault &fault)
{ {
fault->invoke(this->thread->getTC()); fault->invoke(this->thread->getTC());
} }

View file

@ -555,7 +555,7 @@ BaseSimpleCPU::postExecute()
} }
void void
BaseSimpleCPU::advancePC(Fault fault) BaseSimpleCPU::advancePC(const Fault &fault)
{ {
const bool branching(thread->pcState().branching()); const bool branching(thread->pcState().branching());

View file

@ -168,7 +168,7 @@ class BaseSimpleCPU : public BaseCPU, public ExecContext
void setupFetchRequest(Request *req); void setupFetchRequest(Request *req);
void preExecute(); void preExecute();
void postExecute(); void postExecute();
void advancePC(Fault fault); void advancePC(const Fault &fault);
virtual void deallocateContext(ThreadID thread_num); virtual void deallocateContext(ThreadID thread_num);
virtual void haltContext(ThreadID thread_num); virtual void haltContext(ThreadID thread_num);

View file

@ -328,7 +328,7 @@ TimingSimpleCPU::sendSplitData(RequestPtr req1, RequestPtr req2,
} }
void void
TimingSimpleCPU::translationFault(Fault fault) TimingSimpleCPU::translationFault(const Fault &fault)
{ {
// fault may be NoFault in cases where a fault is suppressed, // fault may be NoFault in cases where a fault is suppressed,
// for instance prefetches. // for instance prefetches.
@ -576,7 +576,8 @@ TimingSimpleCPU::fetch()
void void
TimingSimpleCPU::sendFetch(Fault fault, RequestPtr req, ThreadContext *tc) TimingSimpleCPU::sendFetch(const Fault &fault, RequestPtr req,
ThreadContext *tc)
{ {
if (fault == NoFault) { if (fault == NoFault) {
DPRINTF(SimpleCPU, "Sending fetch for addr %#x(pa: %#x)\n", DPRINTF(SimpleCPU, "Sending fetch for addr %#x(pa: %#x)\n",
@ -608,7 +609,7 @@ TimingSimpleCPU::sendFetch(Fault fault, RequestPtr req, ThreadContext *tc)
void void
TimingSimpleCPU::advanceInst(Fault fault) TimingSimpleCPU::advanceInst(const Fault &fault)
{ {
if (_status == Faulting) if (_status == Faulting)
return; return;

View file

@ -123,7 +123,7 @@ class TimingSimpleCPU : public BaseSimpleCPU
} }
void void
finish(Fault fault, RequestPtr req, ThreadContext *tc, finish(const Fault &fault, RequestPtr req, ThreadContext *tc,
BaseTLB::Mode mode) BaseTLB::Mode mode)
{ {
cpu->sendFetch(fault, req, tc); cpu->sendFetch(fault, req, tc);
@ -135,7 +135,7 @@ class TimingSimpleCPU : public BaseSimpleCPU
void sendSplitData(RequestPtr req1, RequestPtr req2, RequestPtr req, void sendSplitData(RequestPtr req1, RequestPtr req2, RequestPtr req,
uint8_t *data, bool read); uint8_t *data, bool read);
void translationFault(Fault fault); void translationFault(const Fault &fault);
void buildPacket(PacketPtr &pkt, RequestPtr req, bool read); void buildPacket(PacketPtr &pkt, RequestPtr req, bool read);
void buildSplitPacket(PacketPtr &pkt1, PacketPtr &pkt2, void buildSplitPacket(PacketPtr &pkt1, PacketPtr &pkt2,
@ -280,10 +280,10 @@ class TimingSimpleCPU : public BaseSimpleCPU
Addr addr, unsigned flags, uint64_t *res); Addr addr, unsigned flags, uint64_t *res);
void fetch(); void fetch();
void sendFetch(Fault fault, RequestPtr req, ThreadContext *tc); void sendFetch(const Fault &fault, RequestPtr req, ThreadContext *tc);
void completeIfetch(PacketPtr ); void completeIfetch(PacketPtr );
void completeDataAccess(PacketPtr pkt); void completeDataAccess(PacketPtr pkt);
void advanceInst(Fault fault); void advanceInst(const Fault &fault);
/** This function is used by the page table walker to determine if it could /** This function is used by the page table walker to determine if it could
* translate the a pending request or if the underlying request has been * translate the a pending request or if the underlying request has been

View file

@ -111,7 +111,7 @@ class WholeTranslationState
* request to make it easier to access them later on. * request to make it easier to access them later on.
*/ */
bool bool
finish(Fault fault, int index) finish(const Fault &fault, int index)
{ {
assert(outstanding); assert(outstanding);
faults[index] = fault; faults[index] = fault;
@ -249,7 +249,7 @@ class DataTranslation : public BaseTLB::Translation
* translation is complete if the state says so. * translation is complete if the state says so.
*/ */
void void
finish(Fault fault, RequestPtr req, ThreadContext *tc, finish(const Fault &fault, RequestPtr req, ThreadContext *tc,
BaseTLB::Mode mode) BaseTLB::Mode mode)
{ {
assert(state); assert(state);

View file

@ -104,8 +104,8 @@ class BaseTLB : public SimObject
* be responsible for cleaning itself up which will happen in this * be responsible for cleaning itself up which will happen in this
* function. Once it's called, the object is no longer valid. * function. Once it's called, the object is no longer valid.
*/ */
virtual void finish(Fault fault, RequestPtr req, ThreadContext *tc, virtual void finish(const Fault &fault, RequestPtr req,
Mode mode) = 0; ThreadContext *tc, Mode mode) = 0;
/** This function is used by the page table walker to determine if it /** This function is used by the page table walker to determine if it
* should translate the a pending request or if the underlying request * should translate the a pending request or if the underlying request