summaryrefslogtreecommitdiff
path: root/src/arch/power
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2016-11-09 14:27:40 -0600
committerBrandon Potter <brandon.potter@amd.com>2016-11-09 14:27:40 -0600
commit3886c4a8f2e1bfe17cbf7a5a76ba0fc978c6bb48 (patch)
tree5a1ce6cbf42009fc9199c7ecfb068890ca74dbd4 /src/arch/power
parent7b6cf951e2f0fa70d6599f1e1d03f664b674a75e (diff)
downloadgem5-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/power')
-rw-r--r--src/arch/power/linux/process.cc10
-rw-r--r--src/arch/power/linux/process.hh6
-rw-r--r--src/arch/power/process.cc16
-rw-r--r--src/arch/power/process.hh8
4 files changed, 18 insertions, 22 deletions
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);
};