summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-10-09 20:14:21 -0700
committerGabe Black <gabeblack@google.com>2019-10-25 22:42:31 +0000
commit21b58d19ad2996d34da9d3143f47059636c6cd84 (patch)
treebfd49c42bcdcc0d0543c5643003de9bb36cb748a /src
parent6f42417144fe1a2e3ca37a3b419a57fc825030e2 (diff)
downloadgem5-21b58d19ad2996d34da9d3143f47059636c6cd84.tar.xz
cpu: Pass the address to check into the PCEventQueue service method.
This prevents having to access it from within the ThreadContext. Change-Id: I34f5815a11201b8fc41871c18bdbbcd0f40305cf Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22102 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Gabe Black <gabeblack@google.com> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cpu/checker/cpu_impl.hh2
-rw-r--r--src/cpu/minor/execute.cc2
-rw-r--r--src/cpu/o3/commit_impl.hh3
-rw-r--r--src/cpu/pc_event.cc7
-rw-r--r--src/cpu/pc_event.hh6
-rw-r--r--src/cpu/simple/base.cc2
6 files changed, 11 insertions, 11 deletions
diff --git a/src/cpu/checker/cpu_impl.hh b/src/cpu/checker/cpu_impl.hh
index 86f022d41..95ea3f7bb 100644
--- a/src/cpu/checker/cpu_impl.hh
+++ b/src/cpu/checker/cpu_impl.hh
@@ -412,7 +412,7 @@ Checker<Impl>::verify(const DynInstPtr &completed_inst)
int count = 0;
do {
oldpc = thread->instAddr();
- system->pcEventQueue.service(tc);
+ system->pcEventQueue.service(oldpc, tc);
count++;
} while (oldpc != thread->instAddr());
if (count > 1) {
diff --git a/src/cpu/minor/execute.cc b/src/cpu/minor/execute.cc
index dc7986616..a9d51b717 100644
--- a/src/cpu/minor/execute.cc
+++ b/src/cpu/minor/execute.cc
@@ -841,7 +841,7 @@ Execute::tryPCEvents(ThreadID thread_id)
Addr oldPC;
do {
oldPC = thread->instAddr();
- cpu.system->pcEventQueue.service(thread);
+ cpu.system->pcEventQueue.service(oldPC, thread);
num_pc_event_checks++;
} while (oldPC != thread->instAddr());
diff --git a/src/cpu/o3/commit_impl.hh b/src/cpu/o3/commit_impl.hh
index 2aa9d7824..df439454b 100644
--- a/src/cpu/o3/commit_impl.hh
+++ b/src/cpu/o3/commit_impl.hh
@@ -1112,7 +1112,8 @@ DefaultCommit<Impl>::commitInsts()
!thread[tid]->trapPending);
do {
oldpc = pc[tid].instAddr();
- cpu->system->pcEventQueue.service(thread[tid]->getTC());
+ cpu->system->pcEventQueue.service(
+ oldpc, thread[tid]->getTC());
count++;
} while (oldpc != pc[tid].instAddr());
if (count > 1) {
diff --git a/src/cpu/pc_event.cc b/src/cpu/pc_event.cc
index 90c87334a..725c051b7 100644
--- a/src/cpu/pc_event.cc
+++ b/src/cpu/pc_event.cc
@@ -84,11 +84,10 @@ PCEventQueue::schedule(PCEvent *event)
}
bool
-PCEventQueue::doService(ThreadContext *tc)
+PCEventQueue::doService(Addr pc, ThreadContext *tc)
{
- // This will fail to break on Alpha PALcode addresses, but that is
- // a rare use case.
- Addr pc = tc->instAddr();
+ // Using the raw PC address will fail to break on Alpha PALcode addresses,
+ // but that is a rare use case.
int serviced = 0;
range_t range = equal_range(pc);
for (iterator i = range.first; i != range.second; ++i) {
diff --git a/src/cpu/pc_event.hh b/src/cpu/pc_event.hh
index 0654ca54e..d5fd4ea70 100644
--- a/src/cpu/pc_event.hh
+++ b/src/cpu/pc_event.hh
@@ -105,7 +105,7 @@ class PCEventQueue : public PCEventScope
protected:
Map pcMap;
- bool doService(ThreadContext *tc);
+ bool doService(Addr pc, ThreadContext *tc);
public:
PCEventQueue();
@@ -113,12 +113,12 @@ class PCEventQueue : public PCEventScope
bool remove(PCEvent *event) override;
bool schedule(PCEvent *event) override;
- bool service(ThreadContext *tc)
+ bool service(Addr pc, ThreadContext *tc)
{
if (pcMap.empty())
return false;
- return doService(tc);
+ return doService(pc, tc);
}
range_t equal_range(Addr pc);
diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc
index 461f00fca..df3d981ad 100644
--- a/src/cpu/simple/base.cc
+++ b/src/cpu/simple/base.cc
@@ -144,7 +144,7 @@ BaseSimpleCPU::checkPcEventQueue()
Addr oldpc, pc = threadInfo[curThread]->thread->instAddr();
do {
oldpc = pc;
- system->pcEventQueue.service(threadContexts[curThread]);
+ system->pcEventQueue.service(oldpc, threadContexts[curThread]);
pc = threadInfo[curThread]->thread->instAddr();
} while (oldpc != pc);
}