summaryrefslogtreecommitdiff
path: root/src/arch/mips
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/mips')
-rw-r--r--src/arch/mips/linux/process.cc19
-rw-r--r--src/arch/mips/process.cc4
-rw-r--r--src/arch/mips/process.hh2
3 files changed, 15 insertions, 10 deletions
diff --git a/src/arch/mips/linux/process.cc b/src/arch/mips/linux/process.cc
index dde3a4efd..c2a05b73b 100644
--- a/src/arch/mips/linux/process.cc
+++ b/src/arch/mips/linux/process.cc
@@ -51,7 +51,8 @@ static SyscallReturn
unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
ThreadContext *tc)
{
- TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, 0));
+ int index = 0;
+ TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index));
strcpy(name->sysname, "Linux");
strcpy(name->nodename,"m5.eecs.umich.edu");
@@ -70,14 +71,16 @@ static SyscallReturn
sys_getsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
ThreadContext *tc)
{
- unsigned op = process->getSyscallArg(tc, 0);
- // unsigned nbytes = process->getSyscallArg(tc, 2);
+ int index = 0;
+ unsigned op = process->getSyscallArg(tc, index);
+ unsigned bufPtr = process->getSyscallArg(tc, index);
+ // unsigned nbytes = process->getSyscallArg(tc, index);
switch (op) {
case 45:
{
// GSI_IEEE_FP_CONTROL
- TypedBufferArg<uint64_t> fpcr(process->getSyscallArg(tc, 1));
+ TypedBufferArg<uint64_t> fpcr(bufPtr);
// I don't think this exactly matches the HW FPCR
*fpcr = 0;
fpcr.copyOut(tc->getMemPort());
@@ -97,15 +100,17 @@ static SyscallReturn
sys_setsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
ThreadContext *tc)
{
- unsigned op = process->getSyscallArg(tc, 0);
- // unsigned nbytes = process->getSyscallArg(tc, 2);
+ int index = 0;
+ unsigned op = process->getSyscallArg(tc, index);
+ Addr bufPtr = process->getSyscallArg(tc, index);
+ // unsigned nbytes = process->getSyscallArg(tc, index);
switch (op) {
case 14:
{
// SSI_IEEE_FP_CONTROL
- TypedBufferArg<uint64_t> fpcr(process->getSyscallArg(tc, 1));
+ TypedBufferArg<uint64_t> fpcr(bufPtr);
// I don't think this exactly matches the HW FPCR
fpcr.copyIn(tc->getMemPort());
DPRINTFR(SyscallVerbose, "sys_setsysinfo(SSI_IEEE_FP_CONTROL): "
diff --git a/src/arch/mips/process.cc b/src/arch/mips/process.cc
index b9f608922..d96b0c81c 100644
--- a/src/arch/mips/process.cc
+++ b/src/arch/mips/process.cc
@@ -147,10 +147,10 @@ MipsLiveProcess::argsInit(int intSize, int pageSize)
MipsISA::IntReg
-MipsLiveProcess::getSyscallArg(ThreadContext *tc, int i)
+MipsLiveProcess::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 6);
- return tc->readIntReg(FirstArgumentReg + i);
+ return tc->readIntReg(FirstArgumentReg + i++);
}
void
diff --git a/src/arch/mips/process.hh b/src/arch/mips/process.hh
index b8f4de20a..f35ec8554 100644
--- a/src/arch/mips/process.hh
+++ b/src/arch/mips/process.hh
@@ -50,7 +50,7 @@ class MipsLiveProcess : public LiveProcess
void argsInit(int intSize, int pageSize);
public:
- MipsISA::IntReg getSyscallArg(ThreadContext *tc, int i);
+ MipsISA::IntReg getSyscallArg(ThreadContext *tc, int &i);
void setSyscallArg(ThreadContext *tc, int i, MipsISA::IntReg val);
void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value);
};