summaryrefslogtreecommitdiff
path: root/src/cpu/base.cc
diff options
context:
space:
mode:
authorAndreas Sandberg <Andreas.Sandberg@ARM.com>2013-02-15 17:40:08 -0500
committerAndreas Sandberg <Andreas.Sandberg@ARM.com>2013-02-15 17:40:08 -0500
commit1eec115c31395e2819c073a1859d75eb5933dac2 (patch)
tree503552557b8a5504bbb9aa9a3515b0bb398a97fc /src/cpu/base.cc
parent1c7aa665bfc678c33cc05829acc52aebb1d2612c (diff)
downloadgem5-1eec115c31395e2819c073a1859d75eb5933dac2.tar.xz
cpu: Refactor memory system checks
CPUs need to test that the memory system is in the right mode in two places, when the CPU is initialized (unless it's switched out) and on a drainResume(). This led to some code duplication in the CPU models. This changeset introduces the verifyMemoryMode() method which is called by BaseCPU::init() if the CPU isn't switched out. The individual CPU models are responsible for calling this method when resuming from a drain as this code is CPU model specific.
Diffstat (limited to 'src/cpu/base.cc')
-rw-r--r--src/cpu/base.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cpu/base.cc b/src/cpu/base.cc
index 3e7a6d4b6..36caea79a 100644
--- a/src/cpu/base.cc
+++ b/src/cpu/base.cc
@@ -254,8 +254,11 @@ BaseCPU::~BaseCPU()
void
BaseCPU::init()
{
- if (!params()->switched_out)
+ if (!params()->switched_out) {
registerThreadContexts();
+
+ verifyMemoryMode();
+ }
}
void