diff options
author | Brandon Potter <brandon.potter@amd.com> | 2016-11-09 14:27:40 -0600 |
---|---|---|
committer | Brandon Potter <brandon.potter@amd.com> | 2016-11-09 14:27:40 -0600 |
commit | 3886c4a8f2e1bfe17cbf7a5a76ba0fc978c6bb48 (patch) | |
tree | 5a1ce6cbf42009fc9199c7ecfb068890ca74dbd4 /src/arch | |
parent | 7b6cf951e2f0fa70d6599f1e1d03f664b674a75e (diff) | |
download | gem5-3886c4a8f2e1bfe17cbf7a5a76ba0fc978c6bb48.tar.xz |
syscall_emul: [patch 5/22] remove LiveProcess class and use Process instead
The EIOProcess class was removed recently and it was the only other class
which derived from Process. Since every Process invocation is also a
LiveProcess invocation, it makes sense to simplify the organization by
combining the fields from LiveProcess into Process.
Diffstat (limited to 'src/arch')
34 files changed, 258 insertions, 278 deletions
diff --git a/src/arch/alpha/linux/process.cc b/src/arch/alpha/linux/process.cc index c5e25c4d1..4a5dbd24f 100644 --- a/src/arch/alpha/linux/process.cc +++ b/src/arch/alpha/linux/process.cc @@ -46,7 +46,7 @@ using namespace AlphaISA; /// Target uname() handler. static SyscallReturn -unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process, +unameFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -66,7 +66,7 @@ unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process, /// borrowed from Tru64, the subcases that get used appear to be /// different in practice from those used by Tru64 processes. static SyscallReturn -osf_getsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process, +osf_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -95,7 +95,7 @@ osf_getsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process, /// Target osf_setsysinfo() handler. static SyscallReturn -osf_setsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process, +osf_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -572,9 +572,9 @@ SyscallDesc AlphaLinuxProcess::syscallDescs[] = { /* 441 */ SyscallDesc("keyctl", unimplementedFunc) }; -AlphaLinuxProcess::AlphaLinuxProcess(LiveProcessParams * params, +AlphaLinuxProcess::AlphaLinuxProcess(ProcessParams * params, ObjectFile *objFile) - : AlphaLiveProcess(params, objFile), + : AlphaProcess(params, objFile), Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc)) { //init_regs->intRegFile[0] = 0; diff --git a/src/arch/alpha/linux/process.hh b/src/arch/alpha/linux/process.hh index 9ab7b0501..46c22d288 100644 --- a/src/arch/alpha/linux/process.hh +++ b/src/arch/alpha/linux/process.hh @@ -36,11 +36,11 @@ namespace AlphaISA { /// A process with emulated Alpha/Linux syscalls. -class AlphaLinuxProcess : public AlphaLiveProcess +class AlphaLinuxProcess : public AlphaProcess { public: /// Constructor. - AlphaLinuxProcess(LiveProcessParams * params, ObjectFile *objFile); + AlphaLinuxProcess(ProcessParams * params, ObjectFile *objFile); virtual SyscallDesc* getDesc(int callnum); diff --git a/src/arch/alpha/process.cc b/src/arch/alpha/process.cc index 669f7da80..2ed6a5f21 100644 --- a/src/arch/alpha/process.cc +++ b/src/arch/alpha/process.cc @@ -46,9 +46,8 @@ using namespace AlphaISA; using namespace std; -AlphaLiveProcess::AlphaLiveProcess(LiveProcessParams *params, - ObjectFile *objFile) - : LiveProcess(params, objFile) +AlphaProcess::AlphaProcess(ProcessParams *params, ObjectFile *objFile) + : Process(params, objFile) { brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize(); brk_point = roundUp(brk_point, PageBytes); @@ -67,7 +66,7 @@ AlphaLiveProcess::AlphaLiveProcess(LiveProcessParams *params, } void -AlphaLiveProcess::argsInit(int intSize, int pageSize) +AlphaProcess::argsInit(int intSize, int pageSize) { // Patch the ld_bias for dynamic executables. updateBias(); @@ -176,7 +175,7 @@ AlphaLiveProcess::argsInit(int intSize, int pageSize) } void -AlphaLiveProcess::setupASNReg() +AlphaProcess::setupASNReg() { ThreadContext *tc = system->getThreadContext(contextIds[0]); tc->setMiscRegNoEffect(IPR_DTB_ASN, _pid << 57); @@ -184,9 +183,9 @@ AlphaLiveProcess::setupASNReg() void -AlphaLiveProcess::loadState(CheckpointIn &cp) +AlphaProcess::loadState(CheckpointIn &cp) { - LiveProcess::loadState(cp); + Process::loadState(cp); // need to set up ASN after unserialization since _pid value may // come from checkpoint setupASNReg(); @@ -194,13 +193,13 @@ AlphaLiveProcess::loadState(CheckpointIn &cp) void -AlphaLiveProcess::initState() +AlphaProcess::initState() { // need to set up ASN before further initialization since init // will involve writing to virtual memory addresses setupASNReg(); - LiveProcess::initState(); + Process::initState(); argsInit(MachineBytes, PageBytes); @@ -214,22 +213,21 @@ AlphaLiveProcess::initState() } AlphaISA::IntReg -AlphaLiveProcess::getSyscallArg(ThreadContext *tc, int &i) +AlphaProcess::getSyscallArg(ThreadContext *tc, int &i) { assert(i < 6); return tc->readIntReg(FirstArgumentReg + i++); } void -AlphaLiveProcess::setSyscallArg(ThreadContext *tc, - int i, AlphaISA::IntReg val) +AlphaProcess::setSyscallArg(ThreadContext *tc, int i, AlphaISA::IntReg val) { assert(i < 6); tc->setIntReg(FirstArgumentReg + i, val); } void -AlphaLiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) +AlphaProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) { // check for error condition. Alpha syscall convention is to // indicate success/failure in reg a3 (r19) and put the diff --git a/src/arch/alpha/process.hh b/src/arch/alpha/process.hh index e5320564f..5851c866d 100644 --- a/src/arch/alpha/process.hh +++ b/src/arch/alpha/process.hh @@ -35,13 +35,13 @@ #include "mem/page_table.hh" #include "sim/process.hh" -class AlphaLiveProcess : public LiveProcess +class AlphaProcess : public Process { private: void setupASNReg(); protected: - AlphaLiveProcess(LiveProcessParams *params, ObjectFile *objFile); + AlphaProcess(ProcessParams *params, ObjectFile *objFile); void loadState(CheckpointIn &cp) override; void initState() override; @@ -51,12 +51,12 @@ class AlphaLiveProcess : public LiveProcess public: AlphaISA::IntReg getSyscallArg(ThreadContext *tc, int &i) override; /// Explicitly import the otherwise hidden getSyscallArg - using LiveProcess::getSyscallArg; + using Process::getSyscallArg; void setSyscallArg(ThreadContext *tc, int i, AlphaISA::IntReg val) override; void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value) override; - // override default implementation in LiveProcess as the mmap + // override default implementation in Process as the mmap // region for Alpha platforms grows upward virtual bool mmapGrowsDown() const override { return false; } }; diff --git a/src/arch/arm/freebsd/process.cc b/src/arch/arm/freebsd/process.cc index 266bab8bf..1ecbdd678 100644 --- a/src/arch/arm/freebsd/process.cc +++ b/src/arch/arm/freebsd/process.cc @@ -53,7 +53,7 @@ using namespace std; using namespace ArmISA; static SyscallReturn -issetugidFunc(SyscallDesc *desc, int callnum, LiveProcess *process, +issetugidFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { @@ -61,7 +61,7 @@ issetugidFunc(SyscallDesc *desc, int callnum, LiveProcess *process, } static SyscallReturn -sysctlFunc(SyscallDesc *desc, int callnum, LiveProcess *process, +sysctlFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -1206,9 +1206,9 @@ static SyscallDesc syscallDescs64[] = { /* 547 */ SyscallDesc("unused#547", unimplementedFunc), }; -ArmFreebsdProcess32::ArmFreebsdProcess32(LiveProcessParams * params, +ArmFreebsdProcess32::ArmFreebsdProcess32(ProcessParams * params, ObjectFile *objFile, ObjectFile::Arch _arch) - : ArmLiveProcess32(params, objFile, _arch) + : ArmProcess32(params, objFile, _arch) { SyscallTable table; @@ -1218,9 +1218,9 @@ ArmFreebsdProcess32::ArmFreebsdProcess32(LiveProcessParams * params, syscallTables.push_back(table); } -ArmFreebsdProcess64::ArmFreebsdProcess64(LiveProcessParams * params, +ArmFreebsdProcess64::ArmFreebsdProcess64(ProcessParams * params, ObjectFile *objFile, ObjectFile::Arch _arch) - : ArmLiveProcess64(params, objFile, _arch) + : ArmProcess64(params, objFile, _arch) { SyscallTable table; @@ -1269,13 +1269,13 @@ ArmFreebsdProcess64::getDesc(int callnum) void ArmFreebsdProcess32::initState() { - ArmLiveProcess32::initState(); + ArmProcess32::initState(); // The 32 bit equivalent of the comm page would be set up here. } void ArmFreebsdProcess64::initState() { - ArmLiveProcess64::initState(); + ArmProcess64::initState(); // The 64 bit equivalent of the comm page would be set up here. } diff --git a/src/arch/arm/freebsd/process.hh b/src/arch/arm/freebsd/process.hh index 4907c2020..28504d7d8 100644 --- a/src/arch/arm/freebsd/process.hh +++ b/src/arch/arm/freebsd/process.hh @@ -55,16 +55,16 @@ class ArmFreebsdProcessBits }; /// A process with emulated Arm/Freebsd syscalls. -class ArmFreebsdProcess32 : public ArmLiveProcess32, public ArmFreebsdProcessBits +class ArmFreebsdProcess32 : public ArmProcess32, public ArmFreebsdProcessBits { public: - ArmFreebsdProcess32(LiveProcessParams * params, ObjectFile *objFile, - ObjectFile::Arch _arch); + ArmFreebsdProcess32(ProcessParams * params, ObjectFile *objFile, + ObjectFile::Arch _arch); void initState(); /// Explicitly import the otherwise hidden getSyscallArg - using ArmLiveProcess::getSyscallArg; + using ArmProcess::getSyscallArg; /// A page to hold "kernel" provided functions. The name might be wrong. static const Addr commPage; @@ -73,11 +73,11 @@ class ArmFreebsdProcess32 : public ArmLiveProcess32, public ArmFreebsdProcessBit }; /// A process with emulated Arm/Freebsd syscalls. -class ArmFreebsdProcess64 : public ArmLiveProcess64, public ArmFreebsdProcessBits +class ArmFreebsdProcess64 : public ArmProcess64, public ArmFreebsdProcessBits { public: - ArmFreebsdProcess64(LiveProcessParams * params, ObjectFile *objFile, - ObjectFile::Arch _arch); + ArmFreebsdProcess64(ProcessParams * params, ObjectFile *objFile, + ObjectFile::Arch _arch); void initState(); SyscallDesc* getDesc(int callnum); diff --git a/src/arch/arm/linux/process.cc b/src/arch/arm/linux/process.cc index 36a628d52..b8f40be81 100644 --- a/src/arch/arm/linux/process.cc +++ b/src/arch/arm/linux/process.cc @@ -61,7 +61,7 @@ using namespace ArmISA; /// Target uname() handler. static SyscallReturn -unameFunc32(SyscallDesc *desc, int callnum, LiveProcess *process, +unameFunc32(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -79,7 +79,7 @@ unameFunc32(SyscallDesc *desc, int callnum, LiveProcess *process, /// Target uname() handler. static SyscallReturn -unameFunc64(SyscallDesc *desc, int callnum, LiveProcess *process, +unameFunc64(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -97,7 +97,7 @@ unameFunc64(SyscallDesc *desc, int callnum, LiveProcess *process, /// Target set_tls() handler. static SyscallReturn -setTLSFunc32(SyscallDesc *desc, int callnum, LiveProcess *process, +setTLSFunc32(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -110,7 +110,7 @@ setTLSFunc32(SyscallDesc *desc, int callnum, LiveProcess *process, } static SyscallReturn -setTLSFunc64(SyscallDesc *desc, int callnum, LiveProcess *process, +setTLSFunc64(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -1589,9 +1589,9 @@ static SyscallDesc privSyscallDescs64[] = { /* 5 */ SyscallDesc("set_tls", setTLSFunc64) }; -ArmLinuxProcess32::ArmLinuxProcess32(LiveProcessParams * params, +ArmLinuxProcess32::ArmLinuxProcess32(ProcessParams * params, ObjectFile *objFile, ObjectFile::Arch _arch) - : ArmLiveProcess32(params, objFile, _arch) + : ArmProcess32(params, objFile, _arch) { SyscallTable table; @@ -1608,9 +1608,9 @@ ArmLinuxProcess32::ArmLinuxProcess32(LiveProcessParams * params, syscallTables.push_back(table); } -ArmLinuxProcess64::ArmLinuxProcess64(LiveProcessParams * params, +ArmLinuxProcess64::ArmLinuxProcess64(ProcessParams * params, ObjectFile *objFile, ObjectFile::Arch _arch) - : ArmLiveProcess64(params, objFile, _arch) + : ArmProcess64(params, objFile, _arch) { SyscallTable table; @@ -1667,7 +1667,7 @@ ArmLinuxProcess64::getDesc(int callnum) void ArmLinuxProcess32::initState() { - ArmLiveProcess32::initState(); + ArmProcess32::initState(); allocateMem(commPage, PageBytes); ThreadContext *tc = system->getThreadContext(contextIds[0]); @@ -1714,6 +1714,6 @@ ArmLinuxProcess32::initState() void ArmLinuxProcess64::initState() { - ArmLiveProcess64::initState(); + ArmProcess64::initState(); // The 64 bit equivalent of the comm page would be set up here. } diff --git a/src/arch/arm/linux/process.hh b/src/arch/arm/linux/process.hh index 670739438..d4b7ca7d3 100644 --- a/src/arch/arm/linux/process.hh +++ b/src/arch/arm/linux/process.hh @@ -65,16 +65,16 @@ class ArmLinuxProcessBits }; /// A process with emulated Arm/Linux syscalls. -class ArmLinuxProcess32 : public ArmLiveProcess32, public ArmLinuxProcessBits +class ArmLinuxProcess32 : public ArmProcess32, public ArmLinuxProcessBits { public: - ArmLinuxProcess32(LiveProcessParams * params, ObjectFile *objFile, + ArmLinuxProcess32(ProcessParams * params, ObjectFile *objFile, ObjectFile::Arch _arch); void initState(); /// Explicitly import the otherwise hidden getSyscallArg - using ArmLiveProcess::getSyscallArg; + using ArmProcess::getSyscallArg; /// A page to hold "kernel" provided functions. The name might be wrong. static const Addr commPage; @@ -83,10 +83,10 @@ class ArmLinuxProcess32 : public ArmLiveProcess32, public ArmLinuxProcessBits }; /// A process with emulated Arm/Linux syscalls. -class ArmLinuxProcess64 : public ArmLiveProcess64, public ArmLinuxProcessBits +class ArmLinuxProcess64 : public ArmProcess64, public ArmLinuxProcessBits { public: - ArmLinuxProcess64(LiveProcessParams * params, ObjectFile *objFile, + ArmLinuxProcess64(ProcessParams * params, ObjectFile *objFile, ObjectFile::Arch _arch); void initState(); diff --git a/src/arch/arm/process.cc b/src/arch/arm/process.cc index 41bfa5b13..0bedcb58c 100644 --- a/src/arch/arm/process.cc +++ b/src/arch/arm/process.cc @@ -59,15 +59,15 @@ using namespace std; using namespace ArmISA; -ArmLiveProcess::ArmLiveProcess(LiveProcessParams *params, ObjectFile *objFile, - ObjectFile::Arch _arch) - : LiveProcess(params, objFile), arch(_arch) +ArmProcess::ArmProcess(ProcessParams *params, ObjectFile *objFile, + ObjectFile::Arch _arch) + : Process(params, objFile), arch(_arch) { } -ArmLiveProcess32::ArmLiveProcess32(LiveProcessParams *params, - ObjectFile *objFile, ObjectFile::Arch _arch) - : ArmLiveProcess(params, objFile, _arch) +ArmProcess32::ArmProcess32(ProcessParams *params, ObjectFile *objFile, + ObjectFile::Arch _arch) + : ArmProcess(params, objFile, _arch) { stack_base = 0xbf000000L; @@ -82,9 +82,9 @@ ArmLiveProcess32::ArmLiveProcess32(LiveProcessParams *params, mmap_end = 0x40000000L; } -ArmLiveProcess64::ArmLiveProcess64(LiveProcessParams *params, - ObjectFile *objFile, ObjectFile::Arch _arch) - : ArmLiveProcess(params, objFile, _arch) +ArmProcess64::ArmProcess64(ProcessParams *params, ObjectFile *objFile, + ObjectFile::Arch _arch) + : ArmProcess(params, objFile, _arch) { stack_base = 0x7fffff0000L; @@ -100,9 +100,9 @@ ArmLiveProcess64::ArmLiveProcess64(LiveProcessParams *params, } void -ArmLiveProcess32::initState() +ArmProcess32::initState() { - LiveProcess::initState(); + Process::initState(); argsInit<uint32_t>(PageBytes, INTREG_SP); for (int i = 0; i < contextIds.size(); i++) { ThreadContext * tc = system->getThreadContext(contextIds[i]); @@ -119,9 +119,9 @@ ArmLiveProcess32::initState() } void -ArmLiveProcess64::initState() +ArmProcess64::initState() { - LiveProcess::initState(); + Process::initState(); argsInit<uint64_t>(PageBytes, INTREG_SP0); for (int i = 0; i < contextIds.size(); i++) { ThreadContext * tc = system->getThreadContext(contextIds[i]); @@ -142,7 +142,7 @@ ArmLiveProcess64::initState() template <class IntType> void -ArmLiveProcess::argsInit(int pageSize, IntRegIndex spIndex) +ArmProcess::argsInit(int pageSize, IntRegIndex spIndex) { int intSize = sizeof(IntType); @@ -405,21 +405,21 @@ ArmLiveProcess::argsInit(int pageSize, IntRegIndex spIndex) } ArmISA::IntReg -ArmLiveProcess32::getSyscallArg(ThreadContext *tc, int &i) +ArmProcess32::getSyscallArg(ThreadContext *tc, int &i) { assert(i < 6); return tc->readIntReg(ArgumentReg0 + i++); } ArmISA::IntReg -ArmLiveProcess64::getSyscallArg(ThreadContext *tc, int &i) +ArmProcess64::getSyscallArg(ThreadContext *tc, int &i) { assert(i < 8); return tc->readIntReg(ArgumentReg0 + i++); } ArmISA::IntReg -ArmLiveProcess32::getSyscallArg(ThreadContext *tc, int &i, int width) +ArmProcess32::getSyscallArg(ThreadContext *tc, int &i, int width) { assert(width == 32 || width == 64); if (width == 32) @@ -438,29 +438,28 @@ ArmLiveProcess32::getSyscallArg(ThreadContext *tc, int &i, int width) } ArmISA::IntReg -ArmLiveProcess64::getSyscallArg(ThreadContext *tc, int &i, int width) +ArmProcess64::getSyscallArg(ThreadContext *tc, int &i, int width) { return getSyscallArg(tc, i); } void -ArmLiveProcess32::setSyscallArg(ThreadContext *tc, int i, ArmISA::IntReg val) +ArmProcess32::setSyscallArg(ThreadContext *tc, int i, ArmISA::IntReg val) { assert(i < 6); tc->setIntReg(ArgumentReg0 + i, val); } void -ArmLiveProcess64::setSyscallArg(ThreadContext *tc, - int i, ArmISA::IntReg val) +ArmProcess64::setSyscallArg(ThreadContext *tc, int i, ArmISA::IntReg val) { assert(i < 8); tc->setIntReg(ArgumentReg0 + i, val); } void -ArmLiveProcess32::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) +ArmProcess32::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) { if (objFile->getOpSys() == ObjectFile::FreeBSD) { @@ -477,7 +476,7 @@ ArmLiveProcess32::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) } void -ArmLiveProcess64::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) +ArmProcess64::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) { if (objFile->getOpSys() == ObjectFile::FreeBSD) { diff --git a/src/arch/arm/process.hh b/src/arch/arm/process.hh index 657f30af8..f8e6542ff 100644 --- a/src/arch/arm/process.hh +++ b/src/arch/arm/process.hh @@ -51,25 +51,23 @@ #include "mem/page_table.hh" #include "sim/process.hh" -class LiveProcess; class ObjectFile; -class System; -class ArmLiveProcess : public LiveProcess +class ArmProcess : public Process { protected: ObjectFile::Arch arch; - ArmLiveProcess(LiveProcessParams * params, ObjectFile *objFile, - ObjectFile::Arch _arch); + ArmProcess(ProcessParams * params, ObjectFile *objFile, + ObjectFile::Arch _arch); template<class IntType> void argsInit(int pageSize, ArmISA::IntRegIndex spIndex); }; -class ArmLiveProcess32 : public ArmLiveProcess +class ArmProcess32 : public ArmProcess { protected: - ArmLiveProcess32(LiveProcessParams * params, ObjectFile *objFile, - ObjectFile::Arch _arch); + ArmProcess32(ProcessParams * params, ObjectFile *objFile, + ObjectFile::Arch _arch); void initState(); @@ -81,11 +79,11 @@ class ArmLiveProcess32 : public ArmLiveProcess void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value); }; -class ArmLiveProcess64 : public ArmLiveProcess +class ArmProcess64 : public ArmProcess { protected: - ArmLiveProcess64(LiveProcessParams * params, ObjectFile *objFile, - ObjectFile::Arch _arch); + ArmProcess64(ProcessParams * params, ObjectFile *objFile, + ObjectFile::Arch _arch); void initState(); diff --git a/src/arch/mips/linux/process.cc b/src/arch/mips/linux/process.cc index 170a3edcc..b36a26fbf 100644 --- a/src/arch/mips/linux/process.cc +++ b/src/arch/mips/linux/process.cc @@ -49,7 +49,7 @@ using namespace MipsISA; /// Target uname() handler. static SyscallReturn -unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process, +unameFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -69,7 +69,7 @@ unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process, /// borrowed from Tru64, the subcases that get used appear to be /// different in practice from those used by Tru64 processes. static SyscallReturn -sys_getsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process, +sys_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -98,7 +98,7 @@ sys_getsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process, /// Target sys_setsysinfo() handler. static SyscallReturn -sys_setsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process, +sys_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -128,7 +128,7 @@ sys_setsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process, } static SyscallReturn -setThreadAreaFunc(SyscallDesc *desc, int callnum, LiveProcess *process, +setThreadAreaFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -460,10 +460,10 @@ SyscallDesc MipsLinuxProcess::syscallDescs[] = { /* 319 */ SyscallDesc("eventfd", unimplementedFunc) }; -MipsLinuxProcess::MipsLinuxProcess(LiveProcessParams * params, - ObjectFile *objFile) - : MipsLiveProcess(params, objFile), - Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc)) +MipsLinuxProcess::MipsLinuxProcess(ProcessParams * params, + ObjectFile *objFile) + : MipsProcess(params, objFile), + Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc)) { } SyscallDesc* diff --git a/src/arch/mips/linux/process.hh b/src/arch/mips/linux/process.hh index fd96be4c1..cbf0d78ea 100644 --- a/src/arch/mips/linux/process.hh +++ b/src/arch/mips/linux/process.hh @@ -37,11 +37,11 @@ #include "sim/eventq.hh" /// A process with emulated Mips/Linux syscalls. -class MipsLinuxProcess : public MipsLiveProcess +class MipsLinuxProcess : public MipsProcess { public: /// Constructor. - MipsLinuxProcess(LiveProcessParams * params, ObjectFile *objFile); + MipsLinuxProcess(ProcessParams * params, ObjectFile *objFile); virtual SyscallDesc* getDesc(int callnum); diff --git a/src/arch/mips/process.cc b/src/arch/mips/process.cc index d26850604..9abe410c7 100644 --- a/src/arch/mips/process.cc +++ b/src/arch/mips/process.cc @@ -47,9 +47,8 @@ using namespace std; using namespace MipsISA; -MipsLiveProcess::MipsLiveProcess(LiveProcessParams * params, - ObjectFile *objFile) - : LiveProcess(params, objFile) +MipsProcess::MipsProcess(ProcessParams * params, ObjectFile *objFile) + : Process(params, objFile) { // Set up stack. On MIPS, stack starts at the top of kuseg // user address space. MIPS stack grows down from here @@ -67,16 +66,16 @@ MipsLiveProcess::MipsLiveProcess(LiveProcessParams * params, } void -MipsLiveProcess::initState() +MipsProcess::initState() { - LiveProcess::initState(); + Process::initState(); argsInit<uint32_t>(PageBytes); } template<class IntType> void -MipsLiveProcess::argsInit(int pageSize) +MipsProcess::argsInit(int pageSize) { int intSize = sizeof(IntType); @@ -191,22 +190,21 @@ MipsLiveProcess::argsInit(int pageSize) MipsISA::IntReg -MipsLiveProcess::getSyscallArg(ThreadContext *tc, int &i) +MipsProcess::getSyscallArg(ThreadContext *tc, int &i) { assert(i < 6); return tc->readIntReg(FirstArgumentReg + i++); } void -MipsLiveProcess::setSyscallArg(ThreadContext *tc, - int i, MipsISA::IntReg val) +MipsProcess::setSyscallArg(ThreadContext *tc, int i, MipsISA::IntReg val) { assert(i < 6); tc->setIntReg(FirstArgumentReg + i, val); } void -MipsLiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) +MipsProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) { if (sysret.successful()) { // no error diff --git a/src/arch/mips/process.hh b/src/arch/mips/process.hh index e05118e9f..ed6561c1a 100644 --- a/src/arch/mips/process.hh +++ b/src/arch/mips/process.hh @@ -38,14 +38,12 @@ #include "mem/page_table.hh" #include "sim/process.hh" -class LiveProcess; class ObjectFile; -class System; -class MipsLiveProcess : public LiveProcess +class MipsProcess : public Process { protected: - MipsLiveProcess(LiveProcessParams * params, ObjectFile *objFile); + MipsProcess(ProcessParams * params, ObjectFile *objFile); void initState(); @@ -55,7 +53,7 @@ class MipsLiveProcess : public LiveProcess public: MipsISA::IntReg getSyscallArg(ThreadContext *tc, int &i); /// Explicitly import the otherwise hidden getSyscallArg - using LiveProcess::getSyscallArg; + using Process::getSyscallArg; void setSyscallArg(ThreadContext *tc, int i, MipsISA::IntReg val); void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value); }; diff --git a/src/arch/power/linux/process.cc b/src/arch/power/linux/process.cc index b39027dee..801274969 100644 --- a/src/arch/power/linux/process.cc +++ b/src/arch/power/linux/process.cc @@ -49,7 +49,7 @@ using namespace PowerISA; /// Target uname() handler. static SyscallReturn -unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process, +unameFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -415,10 +415,10 @@ SyscallDesc PowerLinuxProcess::syscallDescs[] = { /* 346 */ SyscallDesc("epoll_pwait", unimplementedFunc), }; -PowerLinuxProcess::PowerLinuxProcess(LiveProcessParams * params, +PowerLinuxProcess::PowerLinuxProcess(ProcessParams * params, ObjectFile *objFile) - : PowerLiveProcess(params, objFile), - Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc)) + : PowerProcess(params, objFile), + Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc)) { } @@ -434,7 +434,7 @@ PowerLinuxProcess::getDesc(int callnum) void PowerLinuxProcess::initState() { - PowerLiveProcess::initState(); + PowerProcess::initState(); } PowerISA::IntReg diff --git a/src/arch/power/linux/process.hh b/src/arch/power/linux/process.hh index e3f3071b8..9874123dc 100644 --- a/src/arch/power/linux/process.hh +++ b/src/arch/power/linux/process.hh @@ -36,10 +36,10 @@ #include "arch/power/process.hh" /// A process with emulated PPC/Linux syscalls. -class PowerLinuxProcess : public PowerLiveProcess +class PowerLinuxProcess : public PowerProcess { public: - PowerLinuxProcess(LiveProcessParams * params, ObjectFile *objFile); + PowerLinuxProcess(ProcessParams * params, ObjectFile *objFile); virtual SyscallDesc* getDesc(int callnum); @@ -47,7 +47,7 @@ class PowerLinuxProcess : public PowerLiveProcess PowerISA::IntReg getSyscallArg(ThreadContext *tc, int &i); /// Explicitly import the otherwise hidden getSyscallArg - using LiveProcess::getSyscallArg; + using Process::getSyscallArg; void setSyscallArg(ThreadContext *tc, int i, PowerISA::IntReg val); /// Array of syscall descriptors, indexed by call number. diff --git a/src/arch/power/process.cc b/src/arch/power/process.cc index f7cb41dbb..91e91b672 100644 --- a/src/arch/power/process.cc +++ b/src/arch/power/process.cc @@ -47,9 +47,8 @@ using namespace std; using namespace PowerISA; -PowerLiveProcess::PowerLiveProcess(LiveProcessParams *params, - ObjectFile *objFile) - : LiveProcess(params, objFile) +PowerProcess::PowerProcess(ProcessParams *params, ObjectFile *objFile) + : Process(params, objFile) { stack_base = 0xbf000000L; @@ -65,7 +64,7 @@ PowerLiveProcess::PowerLiveProcess(LiveProcessParams *params, } void -PowerLiveProcess::initState() +PowerProcess::initState() { Process::initState(); @@ -73,7 +72,7 @@ PowerLiveProcess::initState() } void -PowerLiveProcess::argsInit(int intSize, int pageSize) +PowerProcess::argsInit(int intSize, int pageSize) { typedef AuxVector<uint32_t> auxv_t; std::vector<auxv_t> auxv; @@ -266,22 +265,21 @@ PowerLiveProcess::argsInit(int intSize, int pageSize) } PowerISA::IntReg -PowerLiveProcess::getSyscallArg(ThreadContext *tc, int &i) +PowerProcess::getSyscallArg(ThreadContext *tc, int &i) { assert(i < 5); return tc->readIntReg(ArgumentReg0 + i++); } void -PowerLiveProcess::setSyscallArg(ThreadContext *tc, - int i, PowerISA::IntReg val) +PowerProcess::setSyscallArg(ThreadContext *tc, int i, PowerISA::IntReg val) { assert(i < 5); tc->setIntReg(ArgumentReg0 + i, val); } void -PowerLiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) +PowerProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) { Cr cr = tc->readIntReg(INTREG_CR); if (sysret.successful()) { diff --git a/src/arch/power/process.hh b/src/arch/power/process.hh index cc023e2c9..08efdfeec 100644 --- a/src/arch/power/process.hh +++ b/src/arch/power/process.hh @@ -39,14 +39,12 @@ #include "mem/page_table.hh" #include "sim/process.hh" -class LiveProcess; class ObjectFile; -class System; -class PowerLiveProcess : public LiveProcess +class PowerProcess : public Process { protected: - PowerLiveProcess(LiveProcessParams * params, ObjectFile *objFile); + PowerProcess(ProcessParams * params, ObjectFile *objFile); void initState(); @@ -54,7 +52,7 @@ class PowerLiveProcess : public LiveProcess void argsInit(int intSize, int pageSize); PowerISA::IntReg getSyscallArg(ThreadContext *tc, int &i); /// Explicitly import the otherwise hidden getSyscallArg - using LiveProcess::getSyscallArg; + using Process::getSyscallArg; void setSyscallArg(ThreadContext *tc, int i, PowerISA::IntReg val); void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value); }; diff --git a/src/arch/riscv/linux/process.cc b/src/arch/riscv/linux/process.cc index c6c61c751..24ea056cd 100644 --- a/src/arch/riscv/linux/process.cc +++ b/src/arch/riscv/linux/process.cc @@ -53,7 +53,7 @@ using namespace RiscvISA; /// Target uname() handler. static SyscallReturn -unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process, +unameFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -126,8 +126,8 @@ std::map<int, SyscallDesc> RiscvLinuxProcess::syscallDescs = { {2011, SyscallDesc("getmainvars", unimplementedFunc)}, }; -RiscvLinuxProcess::RiscvLinuxProcess(LiveProcessParams * params, - ObjectFile *objFile) : RiscvLiveProcess(params, objFile) +RiscvLinuxProcess::RiscvLinuxProcess(ProcessParams * params, + ObjectFile *objFile) : RiscvProcess(params, objFile) {} SyscallDesc* diff --git a/src/arch/riscv/linux/process.hh b/src/arch/riscv/linux/process.hh index 5edc0e149..f83037fd4 100644 --- a/src/arch/riscv/linux/process.hh +++ b/src/arch/riscv/linux/process.hh @@ -41,11 +41,11 @@ #include "sim/eventq.hh" /// A process with emulated Riscv/Linux syscalls. -class RiscvLinuxProcess : public RiscvLiveProcess +class RiscvLinuxProcess : public RiscvProcess { public: /// Constructor. - RiscvLinuxProcess(LiveProcessParams * params, ObjectFile *objFile); + RiscvLinuxProcess(ProcessParams * params, ObjectFile *objFile); virtual SyscallDesc* getDesc(int callnum); diff --git a/src/arch/riscv/process.cc b/src/arch/riscv/process.cc index 4eb3159af..8629a57d6 100644 --- a/src/arch/riscv/process.cc +++ b/src/arch/riscv/process.cc @@ -50,8 +50,8 @@ using namespace std; using namespace RiscvISA; -RiscvLiveProcess::RiscvLiveProcess(LiveProcessParams * params, - ObjectFile *objFile) : LiveProcess(params, objFile) +RiscvProcess::RiscvProcess(ProcessParams * params, + ObjectFile *objFile) : Process(params, objFile) { // Set up stack. On RISC-V, stack starts at the top of kuseg // user address space. RISC-V stack grows down from here @@ -68,15 +68,15 @@ RiscvLiveProcess::RiscvLiveProcess(LiveProcessParams * params, } void -RiscvLiveProcess::initState() +RiscvProcess::initState() { - LiveProcess::initState(); + Process::initState(); argsInit<uint64_t>(PageBytes); } template<class IntType> void -RiscvLiveProcess::argsInit(int pageSize) +RiscvProcess::argsInit(int pageSize) { updateBias(); @@ -215,7 +215,7 @@ RiscvLiveProcess::argsInit(int pageSize) } RiscvISA::IntReg -RiscvLiveProcess::getSyscallArg(ThreadContext *tc, int &i) +RiscvProcess::getSyscallArg(ThreadContext *tc, int &i) { // RISC-V only has four system call argument registers by convention, so // if a larger index is requested return 0 @@ -227,13 +227,13 @@ RiscvLiveProcess::getSyscallArg(ThreadContext *tc, int &i) } void -RiscvLiveProcess::setSyscallArg(ThreadContext *tc, int i, RiscvISA::IntReg val) +RiscvProcess::setSyscallArg(ThreadContext *tc, int i, RiscvISA::IntReg val) { tc->setIntReg(SyscallArgumentRegs[i], val); } void -RiscvLiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) +RiscvProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) { if (sysret.successful()) { // no error diff --git a/src/arch/riscv/process.hh b/src/arch/riscv/process.hh index 53aa7c00a..8275a118a 100644 --- a/src/arch/riscv/process.hh +++ b/src/arch/riscv/process.hh @@ -38,14 +38,13 @@ #include "mem/page_table.hh" #include "sim/process.hh" -class LiveProcess; class ObjectFile; class System; -class RiscvLiveProcess : public LiveProcess +class RiscvProcess : public Process { protected: - RiscvLiveProcess(LiveProcessParams * params, ObjectFile *objFile); + RiscvProcess(ProcessParams * params, ObjectFile *objFile); void initState(); @@ -55,7 +54,7 @@ class RiscvLiveProcess : public LiveProcess public: RiscvISA::IntReg getSyscallArg(ThreadContext *tc, int &i); /// Explicitly import the otherwise hidden getSyscallArg - using LiveProcess::getSyscallArg; + using Process::getSyscallArg; void setSyscallArg(ThreadContext *tc, int i, RiscvISA::IntReg val); void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value); }; diff --git a/src/arch/sparc/faults.cc b/src/arch/sparc/faults.cc index e2ff87726..6c3b35c9a 100644 --- a/src/arch/sparc/faults.cc +++ b/src/arch/sparc/faults.cc @@ -768,12 +768,11 @@ SpillNNormal::invoke(ThreadContext *tc, const StaticInstPtr &inst) Process *p = tc->getProcessPtr(); - //XXX This will only work in faults from a SparcLiveProcess - SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p); - assert(lp); + SparcProcess *sp = dynamic_cast<SparcProcess *>(p); + assert(sp); // Then adjust the PC and NPC - tc->pcState(lp->readSpillStart()); + tc->pcState(sp->readSpillStart()); } void @@ -788,12 +787,11 @@ FillNNormal::invoke(ThreadContext *tc, const StaticInstPtr &inst) Process *p = tc->getProcessPtr(); - //XXX This will only work in faults from a SparcLiveProcess - SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p); - assert(lp); + SparcProcess *sp = dynamic_cast<SparcProcess *>(p); + assert(sp); // Then adjust the PC and NPC - tc->pcState(lp->readFillStart()); + tc->pcState(sp->readFillStart()); } void @@ -810,10 +808,10 @@ TrapInstruction::invoke(ThreadContext *tc, const StaticInstPtr &inst) Process *p = tc->getProcessPtr(); - SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p); - assert(lp); + SparcProcess *sp = dynamic_cast<SparcProcess *>(p); + assert(sp); - lp->handleTrap(_n, tc); + sp->handleTrap(_n, tc); // We need to explicitly advance the pc, since that's not done for us // on a faulting instruction diff --git a/src/arch/sparc/linux/process.cc b/src/arch/sparc/linux/process.cc index a95498ea0..0f72c69c7 100644 --- a/src/arch/sparc/linux/process.cc +++ b/src/arch/sparc/linux/process.cc @@ -60,9 +60,9 @@ SparcLinuxProcess::getDesc32(int callnum) return &syscall32Descs[callnum]; } -Sparc32LinuxProcess::Sparc32LinuxProcess(LiveProcessParams * params, +Sparc32LinuxProcess::Sparc32LinuxProcess(ProcessParams * params, ObjectFile *objFile) - : Sparc32LiveProcess(params, objFile) + : Sparc32Process(params, objFile) {} void Sparc32LinuxProcess::handleTrap(int trapNum, ThreadContext *tc) @@ -72,13 +72,13 @@ void Sparc32LinuxProcess::handleTrap(int trapNum, ThreadContext *tc) tc->syscall(tc->readIntReg(1)); break; default: - SparcLiveProcess::handleTrap(trapNum, tc); + SparcProcess::handleTrap(trapNum, tc); } } -Sparc64LinuxProcess::Sparc64LinuxProcess(LiveProcessParams * params, +Sparc64LinuxProcess::Sparc64LinuxProcess(ProcessParams * params, ObjectFile *objFile) - : Sparc64LiveProcess(params, objFile) + : Sparc64Process(params, objFile) {} void Sparc64LinuxProcess::handleTrap(int trapNum, ThreadContext *tc) @@ -89,6 +89,6 @@ void Sparc64LinuxProcess::handleTrap(int trapNum, ThreadContext *tc) tc->syscall(tc->readIntReg(1)); break; default: - SparcLiveProcess::handleTrap(trapNum, tc); + SparcProcess::handleTrap(trapNum, tc); } } diff --git a/src/arch/sparc/linux/process.hh b/src/arch/sparc/linux/process.hh index 022b1176d..1c38576fd 100644 --- a/src/arch/sparc/linux/process.hh +++ b/src/arch/sparc/linux/process.hh @@ -58,11 +58,11 @@ class SparcLinuxProcess }; /// A process with emulated SPARC/Linux syscalls. -class Sparc32LinuxProcess : public SparcLinuxProcess, public Sparc32LiveProcess +class Sparc32LinuxProcess : public SparcLinuxProcess, public Sparc32Process { public: /// Constructor. - Sparc32LinuxProcess(LiveProcessParams * params, ObjectFile *objFile); + Sparc32LinuxProcess(ProcessParams * params, ObjectFile *objFile); SyscallDesc* getDesc(int callnum) @@ -74,11 +74,11 @@ class Sparc32LinuxProcess : public SparcLinuxProcess, public Sparc32LiveProcess }; /// A process with emulated 32 bit SPARC/Linux syscalls. -class Sparc64LinuxProcess : public SparcLinuxProcess, public Sparc64LiveProcess +class Sparc64LinuxProcess : public SparcLinuxProcess, public Sparc64Process { public: /// Constructor. - Sparc64LinuxProcess(LiveProcessParams * params, ObjectFile *objFile); + Sparc64LinuxProcess(ProcessParams * params, ObjectFile *objFile); SyscallDesc* getDesc(int callnum) @@ -90,7 +90,7 @@ class Sparc64LinuxProcess : public SparcLinuxProcess, public Sparc64LiveProcess }; SyscallReturn getresuidFunc(SyscallDesc *desc, int num, - LiveProcess *p, ThreadContext *tc); + Process *p, ThreadContext *tc); } // namespace SparcISA #endif // __SPARC_LINUX_PROCESS_HH__ diff --git a/src/arch/sparc/linux/syscalls.cc b/src/arch/sparc/linux/syscalls.cc index 33140f1b8..6825b2abb 100644 --- a/src/arch/sparc/linux/syscalls.cc +++ b/src/arch/sparc/linux/syscalls.cc @@ -32,15 +32,15 @@ #include "sim/syscall_desc.hh" #include "sim/syscall_emul.hh" -class LiveProcess; +class Process; class ThreadContext; namespace SparcISA { /// Target uname() handler. static SyscallReturn -unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process, - ThreadContext *tc) +unameFunc(SyscallDesc *desc, int callnum, Process *process, + ThreadContext *tc) { int index = 0; TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index)); @@ -58,7 +58,7 @@ unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process, SyscallReturn -getresuidFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) +getresuidFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc) { const IntReg id = htog(100); int index = 0; diff --git a/src/arch/sparc/process.cc b/src/arch/sparc/process.cc index 75c2529ef..87790e9c3 100644 --- a/src/arch/sparc/process.cc +++ b/src/arch/sparc/process.cc @@ -52,9 +52,9 @@ using namespace SparcISA; static const int FirstArgumentReg = 8; -SparcLiveProcess::SparcLiveProcess(LiveProcessParams * params, - ObjectFile *objFile, Addr _StackBias) - : LiveProcess(params, objFile), StackBias(_StackBias) +SparcProcess::SparcProcess(ProcessParams * params, ObjectFile *objFile, + Addr _StackBias) + : Process(params, objFile), StackBias(_StackBias) { // XXX all the below need to be updated for SPARC - Ali @@ -70,7 +70,7 @@ SparcLiveProcess::SparcLiveProcess(LiveProcessParams * params, } void -SparcLiveProcess::handleTrap(int trapNum, ThreadContext *tc) +SparcProcess::handleTrap(int trapNum, ThreadContext *tc) { PCState pc = tc->pcState(); switch (trapNum) { @@ -111,9 +111,9 @@ SparcLiveProcess::handleTrap(int trapNum, ThreadContext *tc) } void -SparcLiveProcess::initState() +SparcProcess::initState() { - LiveProcess::initState(); + Process::initState(); ThreadContext *tc = system->getThreadContext(contextIds[0]); // From the SPARC ABI @@ -160,9 +160,9 @@ SparcLiveProcess::initState() } void -Sparc32LiveProcess::initState() +Sparc32Process::initState() { - SparcLiveProcess::initState(); + SparcProcess::initState(); ThreadContext *tc = system->getThreadContext(contextIds[0]); // The process runs in user mode with 32 bit addresses @@ -175,9 +175,9 @@ Sparc32LiveProcess::initState() } void -Sparc64LiveProcess::initState() +Sparc64Process::initState() { - SparcLiveProcess::initState(); + SparcProcess::initState(); ThreadContext *tc = system->getThreadContext(contextIds[0]); // The process runs in user mode @@ -190,7 +190,7 @@ Sparc64LiveProcess::initState() template<class IntType> void -SparcLiveProcess::argsInit(int pageSize) +SparcProcess::argsInit(int pageSize) { int intSize = sizeof(IntType); @@ -419,9 +419,9 @@ SparcLiveProcess::argsInit(int pageSize) } void -Sparc64LiveProcess::argsInit(int intSize, int pageSize) +Sparc64Process::argsInit(int intSize, int pageSize) { - SparcLiveProcess::argsInit<uint64_t>(pageSize); + SparcProcess::argsInit<uint64_t>(pageSize); // Stuff the trap handlers into the process address space initVirtMem.writeBlob(fillStart, @@ -431,9 +431,9 @@ Sparc64LiveProcess::argsInit(int intSize, int pageSize) } void -Sparc32LiveProcess::argsInit(int intSize, int pageSize) +Sparc32Process::argsInit(int intSize, int pageSize) { - SparcLiveProcess::argsInit<uint32_t>(pageSize); + SparcProcess::argsInit<uint32_t>(pageSize); // Stuff the trap handlers into the process address space initVirtMem.writeBlob(fillStart, @@ -442,7 +442,7 @@ Sparc32LiveProcess::argsInit(int intSize, int pageSize) (uint8_t*)spillHandler32, sizeof(MachInst) * numSpillInsts); } -void Sparc32LiveProcess::flushWindows(ThreadContext *tc) +void Sparc32Process::flushWindows(ThreadContext *tc) { IntReg Cansave = tc->readIntReg(NumIntArchRegs + 3); IntReg Canrestore = tc->readIntReg(NumIntArchRegs + 4); @@ -477,7 +477,7 @@ void Sparc32LiveProcess::flushWindows(ThreadContext *tc) } void -Sparc64LiveProcess::flushWindows(ThreadContext *tc) +Sparc64Process::flushWindows(ThreadContext *tc) { IntReg Cansave = tc->readIntReg(NumIntArchRegs + 3); IntReg Canrestore = tc->readIntReg(NumIntArchRegs + 4); @@ -512,35 +512,35 @@ Sparc64LiveProcess::flushWindows(ThreadContext *tc) } IntReg -Sparc32LiveProcess::getSyscallArg(ThreadContext *tc, int &i) +Sparc32Process::getSyscallArg(ThreadContext *tc, int &i) { assert(i < 6); return bits(tc->readIntReg(FirstArgumentReg + i++), 31, 0); } void -Sparc32LiveProcess::setSyscallArg(ThreadContext *tc, int i, IntReg val) +Sparc32Process::setSyscallArg(ThreadContext *tc, int i, IntReg val) { assert(i < 6); tc->setIntReg(FirstArgumentReg + i, bits(val, 31, 0)); } IntReg -Sparc64LiveProcess::getSyscallArg(ThreadContext *tc, int &i) +Sparc64Process::getSyscallArg(ThreadContext *tc, int &i) { assert(i < 6); return tc->readIntReg(FirstArgumentReg + i++); } void -Sparc64LiveProcess::setSyscallArg(ThreadContext *tc, int i, IntReg val) +Sparc64Process::setSyscallArg(ThreadContext *tc, int i, IntReg val) { assert(i < 6); tc->setIntReg(FirstArgumentReg + i, val); } void -SparcLiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) +SparcProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) { // check for error condition. SPARC syscall convention is to // indicate success/failure in reg the carry bit of the ccr diff --git a/src/arch/sparc/process.hh b/src/arch/sparc/process.hh index 23a1a8c52..69ea6b41f 100644 --- a/src/arch/sparc/process.hh +++ b/src/arch/sparc/process.hh @@ -40,9 +40,8 @@ #include "sim/process.hh" class ObjectFile; -class System; -class SparcLiveProcess : public LiveProcess +class SparcProcess : public Process { protected: @@ -51,8 +50,8 @@ class SparcLiveProcess : public LiveProcess // The locations of the fill and spill handlers Addr fillStart, spillStart; - SparcLiveProcess(LiveProcessParams * params, - ObjectFile *objFile, Addr _StackBias); + SparcProcess(ProcessParams * params, ObjectFile *objFile, + Addr _StackBias); void initState(); @@ -71,12 +70,12 @@ class SparcLiveProcess : public LiveProcess void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value); }; -class Sparc32LiveProcess : public SparcLiveProcess +class Sparc32Process : public SparcProcess { protected: - Sparc32LiveProcess(LiveProcessParams * params, ObjectFile *objFile) : - SparcLiveProcess(params, objFile, 0) + Sparc32Process(ProcessParams * params, ObjectFile *objFile) + : SparcProcess(params, objFile, 0) { // Set up stack. On SPARC Linux, stack goes from the top of memory // downward, less the hole for the kernel address space. @@ -96,17 +95,17 @@ class Sparc32LiveProcess : public SparcLiveProcess SparcISA::IntReg getSyscallArg(ThreadContext *tc, int &i); /// Explicitly import the otherwise hidden getSyscallArg - using LiveProcess::getSyscallArg; + using Process::getSyscallArg; void setSyscallArg(ThreadContext *tc, int i, SparcISA::IntReg val); }; -class Sparc64LiveProcess : public SparcLiveProcess +class Sparc64Process : public SparcProcess { protected: - Sparc64LiveProcess(LiveProcessParams * params, ObjectFile *objFile) : - SparcLiveProcess(params, objFile, 2047) + Sparc64Process(ProcessParams * params, ObjectFile *objFile) + : SparcProcess(params, objFile, 2047) { // Set up stack. On SPARC Linux, stack goes from the top of memory // downward, less the hole for the kernel address space. @@ -126,7 +125,7 @@ class Sparc64LiveProcess : public SparcLiveProcess SparcISA::IntReg getSyscallArg(ThreadContext *tc, int &i); /// Explicitly import the otherwise hidden getSyscallArg - using LiveProcess::getSyscallArg; + using Process::getSyscallArg; void setSyscallArg(ThreadContext *tc, int i, SparcISA::IntReg val); }; diff --git a/src/arch/sparc/solaris/process.cc b/src/arch/sparc/solaris/process.cc index b26d37fe7..1afa35398 100644 --- a/src/arch/sparc/solaris/process.cc +++ b/src/arch/sparc/solaris/process.cc @@ -45,7 +45,7 @@ using namespace SparcISA; /// Target uname() handler. static SyscallReturn -unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process, +unameFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -322,9 +322,9 @@ SyscallDesc SparcSolarisProcess::syscallDescs[] = { /* 255 */ SyscallDesc("umount2", unimplementedFunc) }; -SparcSolarisProcess::SparcSolarisProcess(LiveProcessParams * params, - ObjectFile *objFile) - : Sparc64LiveProcess(params, objFile), +SparcSolarisProcess::SparcSolarisProcess(ProcessParams * params, + ObjectFile *objFile) + : Sparc64Process(params, objFile), Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc)) { // The sparc syscall table must be <= 284 entries because that is all there diff --git a/src/arch/sparc/solaris/process.hh b/src/arch/sparc/solaris/process.hh index 2cf56f6ba..660802cef 100644 --- a/src/arch/sparc/solaris/process.hh +++ b/src/arch/sparc/solaris/process.hh @@ -38,11 +38,11 @@ namespace SparcISA { /// A process with emulated SPARC/Solaris syscalls. -class SparcSolarisProcess : public Sparc64LiveProcess +class SparcSolarisProcess : public Sparc64Process { public: /// Constructor. - SparcSolarisProcess(LiveProcessParams * params, ObjectFile *objFile); + SparcSolarisProcess(ProcessParams * params, ObjectFile *objFile); virtual SyscallDesc* getDesc(int callnum); diff --git a/src/arch/x86/linux/process.cc b/src/arch/x86/linux/process.cc index e4221511d..cf3a1d3d0 100644 --- a/src/arch/x86/linux/process.cc +++ b/src/arch/x86/linux/process.cc @@ -54,7 +54,7 @@ using namespace X86ISA; /// Target uname() handler. static SyscallReturn -unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process, +unameFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { int index = 0; @@ -72,7 +72,7 @@ unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process, } static SyscallReturn -archPrctlFunc(SyscallDesc *desc, int callnum, LiveProcess *process, +archPrctlFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { enum ArchPrctlCodes @@ -139,22 +139,22 @@ struct UserDesc64 { static SyscallReturn setThreadArea32Func(SyscallDesc *desc, int callnum, - LiveProcess *process, ThreadContext *tc) + Process *process, ThreadContext *tc) { const int minTLSEntry = 6; const int numTLSEntries = 3; const int maxTLSEntry = minTLSEntry + numTLSEntries - 1; - X86LiveProcess *x86lp = dynamic_cast<X86LiveProcess *>(process); - assert(x86lp); + X86Process *x86p = dynamic_cast<X86Process *>(process); + assert(x86p); - assert((maxTLSEntry + 1) * sizeof(uint64_t) <= x86lp->gdtSize()); + assert((maxTLSEntry + 1) * sizeof(uint64_t) <= x86p->gdtSize()); int argIndex = 0; TypedBufferArg<UserDesc32> userDesc(process->getSyscallArg(tc, argIndex)); TypedBufferArg<uint64_t> - gdt(x86lp->gdtStart() + minTLSEntry * sizeof(uint64_t), - numTLSEntries * sizeof(uint64_t)); + gdt(x86p->gdtStart() + minTLSEntry * sizeof(uint64_t), + numTLSEntries * sizeof(uint64_t)); if (!userDesc.copyIn(tc->getMemProxy())) return -EFAULT; @@ -536,10 +536,10 @@ static SyscallDesc syscallDescs64[] = { /* 313 */ SyscallDesc("finit_module", unimplementedFunc), }; -X86_64LinuxProcess::X86_64LinuxProcess(LiveProcessParams * params, - ObjectFile *objFile) - : X86_64LiveProcess(params, objFile, syscallDescs64, - sizeof(syscallDescs64) / sizeof(SyscallDesc)) +X86_64LinuxProcess::X86_64LinuxProcess(ProcessParams * params, + ObjectFile *objFile) + : X86_64Process(params, objFile, syscallDescs64, + sizeof(syscallDescs64) / sizeof(SyscallDesc)) {} static SyscallDesc syscallDescs32[] = { @@ -869,8 +869,7 @@ static SyscallDesc syscallDescs32[] = { /* 323 */ SyscallDesc("eventfd", unimplementedFunc) }; -I386LinuxProcess::I386LinuxProcess(LiveProcessParams * params, - ObjectFile *objFile) - : I386LiveProcess(params, objFile, syscallDescs32, - sizeof(syscallDescs32) / sizeof(SyscallDesc)) +I386LinuxProcess::I386LinuxProcess(ProcessParams * params, ObjectFile *objFile) + : I386Process(params, objFile, syscallDescs32, + sizeof(syscallDescs32) / sizeof(SyscallDesc)) {} diff --git a/src/arch/x86/linux/process.hh b/src/arch/x86/linux/process.hh index 69cdf01f2..70370960b 100644 --- a/src/arch/x86/linux/process.hh +++ b/src/arch/x86/linux/process.hh @@ -46,18 +46,18 @@ namespace X86ISA { -class X86_64LinuxProcess : public X86_64LiveProcess +class X86_64LinuxProcess : public X86_64Process { public: /// Constructor. - X86_64LinuxProcess(LiveProcessParams * params, ObjectFile *objFile); + X86_64LinuxProcess(ProcessParams * params, ObjectFile *objFile); }; -class I386LinuxProcess : public I386LiveProcess +class I386LinuxProcess : public I386Process { public: /// Constructor. - I386LinuxProcess(LiveProcessParams * params, ObjectFile *objFile); + I386LinuxProcess(ProcessParams * params, ObjectFile *objFile); }; } // namespace X86ISA diff --git a/src/arch/x86/process.cc b/src/arch/x86/process.cc index a37468a88..a774dd000 100644 --- a/src/arch/x86/process.cc +++ b/src/arch/x86/process.cc @@ -91,19 +91,18 @@ static const int ArgumentReg32[] = { static const int NumArgumentRegs32 M5_VAR_USED = sizeof(ArgumentReg) / sizeof(const int); -X86LiveProcess::X86LiveProcess(LiveProcessParams * params, ObjectFile *objFile, - SyscallDesc *_syscallDescs, int _numSyscallDescs) : - LiveProcess(params, objFile), syscallDescs(_syscallDescs), - numSyscallDescs(_numSyscallDescs) +X86Process::X86Process(ProcessParams * params, ObjectFile *objFile, + SyscallDesc *_syscallDescs, int _numSyscallDescs) + : Process(params, objFile), syscallDescs(_syscallDescs), + numSyscallDescs(_numSyscallDescs) { brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize(); brk_point = roundUp(brk_point, PageBytes); } -X86_64LiveProcess::X86_64LiveProcess(LiveProcessParams *params, - ObjectFile *objFile, SyscallDesc *_syscallDescs, - int _numSyscallDescs) : - X86LiveProcess(params, objFile, _syscallDescs, _numSyscallDescs) +X86_64Process::X86_64Process(ProcessParams *params, ObjectFile *objFile, + SyscallDesc *_syscallDescs, int _numSyscallDescs) + : X86Process(params, objFile, _syscallDescs, _numSyscallDescs) { vsyscallPage.base = 0xffffffffff600000ULL; @@ -131,7 +130,7 @@ X86_64LiveProcess::X86_64LiveProcess(LiveProcessParams *params, } void -I386LiveProcess::syscall(int64_t callnum, ThreadContext *tc) +I386Process::syscall(int64_t callnum, ThreadContext *tc) { TheISA::PCState pc = tc->pcState(); Addr eip = pc.pc(); @@ -140,14 +139,13 @@ I386LiveProcess::syscall(int64_t callnum, ThreadContext *tc) pc.npc(vsyscallPage.base + vsyscallPage.vsysexitOffset); tc->pcState(pc); } - X86LiveProcess::syscall(callnum, tc); + X86Process::syscall(callnum, tc); } -I386LiveProcess::I386LiveProcess(LiveProcessParams *params, - ObjectFile *objFile, SyscallDesc *_syscallDescs, - int _numSyscallDescs) : - X86LiveProcess(params, objFile, _syscallDescs, _numSyscallDescs) +I386Process::I386Process(ProcessParams *params, ObjectFile *objFile, + SyscallDesc *_syscallDescs, int _numSyscallDescs) + : X86Process(params, objFile, _syscallDescs, _numSyscallDescs) { _gdtStart = ULL(0xffffd000); _gdtSize = PageBytes; @@ -174,7 +172,7 @@ I386LiveProcess::I386LiveProcess(LiveProcessParams *params, } SyscallDesc* -X86LiveProcess::getDesc(int callnum) +X86Process::getDesc(int callnum) { if (callnum < 0 || callnum >= numSyscallDescs) return NULL; @@ -182,9 +180,9 @@ X86LiveProcess::getDesc(int callnum) } void -X86_64LiveProcess::initState() +X86_64Process::initState() { - X86LiveProcess::initState(); + X86Process::initState(); argsInit(sizeof(uint64_t), PageBytes); @@ -626,9 +624,9 @@ X86_64LiveProcess::initState() } void -I386LiveProcess::initState() +I386Process::initState() { - X86LiveProcess::initState(); + X86Process::initState(); argsInit(sizeof(uint32_t), PageBytes); @@ -746,7 +744,7 @@ I386LiveProcess::initState() template<class IntType> void -X86LiveProcess::argsInit(int pageSize, +X86Process::argsInit(int pageSize, std::vector<AuxVector<IntType> > extraAuxvs) { int intSize = sizeof(IntType); @@ -1034,16 +1032,16 @@ X86LiveProcess::argsInit(int pageSize, } void -X86_64LiveProcess::argsInit(int intSize, int pageSize) +X86_64Process::argsInit(int intSize, int pageSize) { std::vector<AuxVector<uint64_t> > extraAuxvs; extraAuxvs.push_back(AuxVector<uint64_t>(M5_AT_SYSINFO_EHDR, vsyscallPage.base)); - X86LiveProcess::argsInit<uint64_t>(pageSize, extraAuxvs); + X86Process::argsInit<uint64_t>(pageSize, extraAuxvs); } void -I386LiveProcess::argsInit(int intSize, int pageSize) +I386Process::argsInit(int intSize, int pageSize) { std::vector<AuxVector<uint32_t> > extraAuxvs; //Tell the binary where the vsyscall part of the vsyscall page is. @@ -1051,38 +1049,38 @@ I386LiveProcess::argsInit(int intSize, int pageSize) vsyscallPage.base + vsyscallPage.vsyscallOffset)); extraAuxvs.push_back(AuxVector<uint32_t>(M5_AT_SYSINFO_EHDR, vsyscallPage.base)); - X86LiveProcess::argsInit<uint32_t>(pageSize, extraAuxvs); + X86Process::argsInit<uint32_t>(pageSize, extraAuxvs); } void -X86LiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn retval) +X86Process::setSyscallReturn(ThreadContext *tc, SyscallReturn retval) { tc->setIntReg(INTREG_RAX, retval.encodedValue()); } X86ISA::IntReg -X86_64LiveProcess::getSyscallArg(ThreadContext *tc, int &i) +X86_64Process::getSyscallArg(ThreadContext *tc, int &i) { assert(i < NumArgumentRegs); return tc->readIntReg(ArgumentReg[i++]); } void -X86_64LiveProcess::setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val) +X86_64Process::setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val) { assert(i < NumArgumentRegs); return tc->setIntReg(ArgumentReg[i], val); } X86ISA::IntReg -I386LiveProcess::getSyscallArg(ThreadContext *tc, int &i) +I386Process::getSyscallArg(ThreadContext *tc, int &i) { assert(i < NumArgumentRegs32); return tc->readIntReg(ArgumentReg32[i++]); } X86ISA::IntReg -I386LiveProcess::getSyscallArg(ThreadContext *tc, int &i, int width) +I386Process::getSyscallArg(ThreadContext *tc, int &i, int width) { assert(width == 32 || width == 64); assert(i < NumArgumentRegs); @@ -1093,7 +1091,7 @@ I386LiveProcess::getSyscallArg(ThreadContext *tc, int &i, int width) } void -I386LiveProcess::setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val) +I386Process::setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val) { assert(i < NumArgumentRegs); return tc->setIntReg(ArgumentReg[i], val); diff --git a/src/arch/x86/process.hh b/src/arch/x86/process.hh index ab513d839..34a275095 100644 --- a/src/arch/x86/process.hh +++ b/src/arch/x86/process.hh @@ -55,7 +55,7 @@ namespace X86ISA M5_AT_SYSINFO_EHDR = 33 }; - class X86LiveProcess : public LiveProcess + class X86Process : public Process { protected: Addr _gdtStart; @@ -64,8 +64,8 @@ namespace X86ISA SyscallDesc *syscallDescs; const int numSyscallDescs; - X86LiveProcess(LiveProcessParams * params, ObjectFile *objFile, - SyscallDesc *_syscallDescs, int _numSyscallDescs); + X86Process(ProcessParams * params, ObjectFile *objFile, + SyscallDesc *_syscallDescs, int _numSyscallDescs); template<class IntType> void argsInit(int pageSize, @@ -83,11 +83,11 @@ namespace X86ISA void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value); }; - class X86_64LiveProcess : public X86LiveProcess + class X86_64Process : public X86Process { protected: - X86_64LiveProcess(LiveProcessParams *params, ObjectFile *objFile, - SyscallDesc *_syscallDescs, int _numSyscallDescs); + X86_64Process(ProcessParams *params, ObjectFile *objFile, + SyscallDesc *_syscallDescs, int _numSyscallDescs); class VSyscallPage { @@ -105,15 +105,15 @@ namespace X86ISA X86ISA::IntReg getSyscallArg(ThreadContext *tc, int &i); /// Explicitly import the otherwise hidden getSyscallArg - using LiveProcess::getSyscallArg; + using Process::getSyscallArg; void setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val); }; - class I386LiveProcess : public X86LiveProcess + class I386Process : public X86Process { protected: - I386LiveProcess(LiveProcessParams *params, ObjectFile *objFile, - SyscallDesc *_syscallDescs, int _numSyscallDescs); + I386Process(ProcessParams *params, ObjectFile *objFile, + SyscallDesc *_syscallDescs, int _numSyscallDescs); class VSyscallPage { |