diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2014-09-19 10:35:18 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2014-09-19 10:35:18 -0400 |
commit | 41fc8a573ea61b2463606a0714a9e563494da329 (patch) | |
tree | c038491b91eb89fa487781bca6ba5b6b1ba65ec3 /src/cpu/inorder/cpu.hh | |
parent | 619c5519fe214250d537527ec95191a9b3d6fad2 (diff) | |
download | gem5-41fc8a573ea61b2463606a0714a9e563494da329.tar.xz |
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.
Diffstat (limited to 'src/cpu/inorder/cpu.hh')
-rw-r--r-- | src/cpu/inorder/cpu.hh | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/cpu/inorder/cpu.hh b/src/cpu/inorder/cpu.hh index 0104cb95f..7efd5ae21 100644 --- a/src/cpu/inorder/cpu.hh +++ b/src/cpu/inorder/cpu.hh @@ -263,11 +263,11 @@ class InOrderCPU : public BaseCPU public: /** 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); /** 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) { fault = _fault; @@ -291,7 +291,8 @@ class InOrderCPU : public BaseCPU }; /** 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), CPUEventPri event_pri = InOrderCPU_Pri); @@ -471,7 +472,7 @@ class InOrderCPU : public BaseCPU Fault getInterrupts(); /** Processes any an interrupt fault. */ - void processInterrupts(Fault interrupt); + void processInterrupts(const Fault &interrupt); /** Halts the CPU. */ void halt() { panic("Halt not implemented!\n"); } @@ -483,18 +484,18 @@ class InOrderCPU : public BaseCPU bool validDataAddr(Addr addr) { return true; } /** 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)); /** Executes a syscall.*/ void syscall(int64_t callnum, ThreadID tid); /** 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)); /** 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 */ void activateContext(ThreadID tid, Cycles delay = Cycles(0)); |