From 3886c4a8f2e1bfe17cbf7a5a76ba0fc978c6bb48 Mon Sep 17 00:00:00 2001 From: Brandon Potter Date: Wed, 9 Nov 2016 14:27:40 -0600 Subject: 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. --- src/arch/alpha/process.cc | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src/arch/alpha/process.cc') 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 -- cgit v1.2.3