From 54a9d471faab2b4ab3ef26932957b2e0d496e84e Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 22 Dec 2017 16:14:03 -0800 Subject: arch,mem: Move page table construction into the arch classes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This gets rid of an awkward NoArchPageTable class, and also gives the arch a place to inject ISA specific parameters (specifically page size) without having to have TheISA:: in the generic version of these types. Change-Id: I1412f303460d5c43dafdb9b3cd07af81c908a441 Reviewed-on: https://gem5-review.googlesource.com/6981 Reviewed-by: Alexandru Duțu Maintainer: Gabe Black --- src/sim/process.cc | 8 +++----- src/sim/process.hh | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src/sim') diff --git a/src/sim/process.cc b/src/sim/process.cc index ee90667ff..77d7903a7 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -101,14 +101,12 @@ using namespace std; using namespace TheISA; -Process::Process(ProcessParams * params, ObjectFile * obj_file) +Process::Process(ProcessParams *params, PageTableBase *pTable, + ObjectFile *obj_file) : SimObject(params), system(params->system), useArchPT(params->useArchPT), kvmInSE(params->kvmInSE), - pTable(useArchPT ? - static_cast(new ArchPageTable(name(), params->pid, - system)) : - static_cast(new FuncPageTable(name(), params->pid))), + pTable(pTable), initVirtMem(system->getSystemPort(), this, SETranslatingPortProxy::Always), objFile(obj_file), diff --git a/src/sim/process.hh b/src/sim/process.hh index e4a52e3de..6d465aca9 100644 --- a/src/sim/process.hh +++ b/src/sim/process.hh @@ -63,7 +63,8 @@ class ThreadContext; class Process : public SimObject { public: - Process(ProcessParams *params, ObjectFile *obj_file); + Process(ProcessParams *params, PageTableBase *pTable, + ObjectFile *obj_file); void serialize(CheckpointOut &cp) const override; void unserialize(CheckpointIn &cp) override; -- cgit v1.2.3