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/arch/x86/process.cc | 13 ++++++++++--- src/arch/x86/process.hh | 16 ++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) (limited to 'src/arch/x86') diff --git a/src/arch/x86/process.cc b/src/arch/x86/process.cc index 1ad1315da..f11cc3438 100644 --- a/src/arch/x86/process.cc +++ b/src/arch/x86/process.cc @@ -60,6 +60,7 @@ #include "debug/Stack.hh" #include "mem/multi_level_page_table.hh" #include "mem/page_table.hh" +#include "params/Process.hh" #include "sim/aux_vector.hh" #include "sim/process_impl.hh" #include "sim/syscall_desc.hh" @@ -95,10 +96,16 @@ static const int ArgumentReg32[] = { static const int NumArgumentRegs32 M5_VAR_USED = sizeof(ArgumentReg) / sizeof(const int); -X86Process::X86Process(ProcessParams * params, ObjectFile *objFile, +X86Process::X86Process(ProcessParams *params, ObjectFile *objFile, SyscallDesc *_syscallDescs, int _numSyscallDescs) - : Process(params, objFile), syscallDescs(_syscallDescs), - numSyscallDescs(_numSyscallDescs) + : Process(params, params->useArchPT ? + static_cast( + new ArchPageTable(params->name, params->pid, + params->system)) : + static_cast( + new FuncPageTable(params->name, params->pid)), + objFile), + syscallDescs(_syscallDescs), numSyscallDescs(_numSyscallDescs) { } diff --git a/src/arch/x86/process.hh b/src/arch/x86/process.hh index 3eb9620c9..e5e18570d 100644 --- a/src/arch/x86/process.hh +++ b/src/arch/x86/process.hh @@ -59,6 +59,14 @@ namespace X86ISA class X86Process : public Process { protected: + /** + * Declaration of architectural page table for x86. + * + * These page tables are stored in system memory and respect x86 + * specification. + */ + typedef MultiLevelPageTable ArchPageTable; + Addr _gdtStart; Addr _gdtSize; @@ -189,14 +197,6 @@ namespace X86ISA Process *process, TheISA::IntReg flags) override; }; - /** - * Declaration of architectural page table for x86. - * - * These page tables are stored in system memory and respect x86 - * specification. - */ - typedef MultiLevelPageTable ArchPageTable; - } #endif // __ARCH_X86_PROCESS_HH__ -- cgit v1.2.3