summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cpu/base.cc9
-rw-r--r--src/cpu/base.hh1
-rw-r--r--src/cpu/kvm/base.cc4
-rw-r--r--src/cpu/minor/cpu.cc11
-rw-r--r--src/cpu/o3/cpu.cc7
-rw-r--r--src/cpu/simple/base.cc5
6 files changed, 10 insertions, 27 deletions
diff --git a/src/cpu/base.cc b/src/cpu/base.cc
index ac0c7ac5b..5d6a85703 100644
--- a/src/cpu/base.cc
+++ b/src/cpu/base.cc
@@ -321,6 +321,15 @@ BaseCPU::init()
}
void
+BaseCPU::initState()
+{
+ if (FullSystem && !params()->switched_out) {
+ for (auto *tc: threadContexts)
+ TheISA::initCPU(tc, tc->contextId());
+ }
+}
+
+void
BaseCPU::startup()
{
if (FullSystem) {
diff --git a/src/cpu/base.hh b/src/cpu/base.hh
index 5b15f4186..f47bc8e7c 100644
--- a/src/cpu/base.hh
+++ b/src/cpu/base.hh
@@ -314,6 +314,7 @@ class BaseCPU : public ClockedObject
virtual ~BaseCPU();
void init() override;
+ void initState() override;
void startup() override;
void regStats() override;
diff --git a/src/cpu/kvm/base.cc b/src/cpu/kvm/base.cc
index 83cb04f47..cda98b4a5 100644
--- a/src/cpu/kvm/base.cc
+++ b/src/cpu/kvm/base.cc
@@ -114,10 +114,6 @@ BaseKvmCPU::init()
fatal("KVM: Multithreading not supported");
tc->initMemProxies(tc);
-
- // initialize CPU, including PC
- if (FullSystem && !switchedOut())
- TheISA::initCPU(tc, tc->contextId());
}
void
diff --git a/src/cpu/minor/cpu.cc b/src/cpu/minor/cpu.cc
index ddba0cdaa..5edc570c7 100644
--- a/src/cpu/minor/cpu.cc
+++ b/src/cpu/minor/cpu.cc
@@ -108,17 +108,6 @@ MinorCPU::init()
tc->initMemProxies(tc);
}
-
- /* Initialise CPUs (== threads in the ISA) */
- if (FullSystem && !params()->switched_out) {
- for (ThreadID thread_id = 0; thread_id < threads.size(); thread_id++)
- {
- ThreadContext *tc = getContext(thread_id);
-
- /* Initialize CPU, including PC */
- TheISA::initCPU(tc, cpuId());
- }
- }
}
/** Stats interface from SimObject (by way of BaseCPU) */
diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc
index 996f6360b..e4f1c0464 100644
--- a/src/cpu/o3/cpu.cc
+++ b/src/cpu/o3/cpu.cc
@@ -599,13 +599,6 @@ FullO3CPU<Impl>::init()
thread[tid]->initMemProxies(thread[tid]->getTC());
}
- if (FullSystem && !params()->switched_out) {
- for (ThreadID tid = 0; tid < numThreads; tid++) {
- ThreadContext *src_tc = threadContexts[tid];
- TheISA::initCPU(src_tc, src_tc->contextId());
- }
- }
-
// Clear noSquashFromTC.
for (int tid = 0; tid < numThreads; ++tid)
thread[tid]->noSquashFromTC = false;
diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc
index 566533c73..06dd77390 100644
--- a/src/cpu/simple/base.cc
+++ b/src/cpu/simple/base.cc
@@ -130,11 +130,6 @@ BaseSimpleCPU::init()
for (auto tc : threadContexts) {
// Initialise the ThreadContext's memory proxies
tc->initMemProxies(tc);
-
- if (FullSystem && !params()->switched_out) {
- // initialize CPU, including PC
- TheISA::initCPU(tc, tc->contextId());
- }
}
}