sim: Get rid of the now unused getSyscallArg method.

Change-Id: I2f78420d8687da7530feb66784fe3e6d2357baf8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23462
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
Gabe Black
2019-12-08 01:52:06 -08:00
parent 0b5ee2e864
commit f44b7729a3
18 changed files with 0 additions and 157 deletions

View File

@@ -97,9 +97,6 @@ class ArmFreebsdProcess32 : public ArmProcess32, public ArmFreebsdProcessBits
void syscall(ThreadContext *tc, Fault *fault) override;
/// Explicitly import the otherwise hidden getSyscallArg
using ArmProcess::getSyscallArg;
/// A page to hold "kernel" provided functions. The name might be wrong.
static const Addr commPage;

View File

@@ -97,9 +97,6 @@ class ArmLinuxProcess32 : public ArmProcess32, public ArmLinuxProcessBits
void syscall(ThreadContext *tc, Fault *fault) override;
/// Explicitly import the otherwise hidden getSyscallArg
using ArmProcess::getSyscallArg;
/// A page to hold "kernel" provided functions. The name might be wrong.
static const Addr commPage;

View File

@@ -478,45 +478,6 @@ const std::vector<int> ArmProcess64::SyscallABI::ArgumentRegs = {
0, 1, 2, 3, 4, 5, 6
};
RegVal
ArmProcess32::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 6);
return tc->readIntReg(ArgumentReg0 + i++);
}
RegVal
ArmProcess64::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 8);
return tc->readIntReg(ArgumentReg0 + i++);
}
RegVal
ArmProcess32::getSyscallArg(ThreadContext *tc, int &i, int width)
{
assert(width == 32 || width == 64);
if (width == 32)
return getSyscallArg(tc, i);
// 64 bit arguments are passed starting in an even register
if (i % 2 != 0)
i++;
// Registers r0-r6 can be used
assert(i < 5);
uint64_t val;
val = tc->readIntReg(ArgumentReg0 + i++);
val |= ((uint64_t)tc->readIntReg(ArgumentReg0 + i++) << 32);
return val;
}
RegVal
ArmProcess64::getSyscallArg(ThreadContext *tc, int &i, int width)
{
return getSyscallArg(tc, i);
}
void
ArmProcess32::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
{

View File

@@ -86,8 +86,6 @@ class ArmProcess32 : public ArmProcess
public:
RegVal getSyscallArg(ThreadContext *tc, int &i, int width) override;
RegVal getSyscallArg(ThreadContext *tc, int &i) override;
void setSyscallReturn(ThreadContext *tc,
SyscallReturn return_value) override;
@@ -135,8 +133,6 @@ class ArmProcess64 : public ArmProcess
public:
RegVal getSyscallArg(ThreadContext *tc, int &i, int width) override;
RegVal getSyscallArg(ThreadContext *tc, int &i) override;
void setSyscallReturn(ThreadContext *tc,
SyscallReturn return_value) override;

View File

@@ -189,13 +189,6 @@ MipsProcess::argsInit(int pageSize)
}
RegVal
MipsProcess::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 6);
return tc->readIntReg(FirstArgumentReg + i++);
}
void
MipsProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
{

View File

@@ -49,9 +49,6 @@ class MipsProcess : public Process
void argsInit(int pageSize);
public:
RegVal getSyscallArg(ThreadContext *tc, int &i);
/// Explicitly import the otherwise hidden getSyscallArg
using Process::getSyscallArg;
void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value);
struct SyscallABI : public GenericSyscallABI64

View File

@@ -468,12 +468,3 @@ PowerLinuxProcess::syscall(ThreadContext *tc, Fault *fault)
{
doSyscall(tc->readIntReg(0), tc, fault);
}
RegVal
PowerLinuxProcess::getSyscallArg(ThreadContext *tc, int &i)
{
// Linux apparently allows more parameter than the ABI says it should.
// This limit may need to be increased even further.
assert(i < 6);
return tc->readIntReg(ArgumentReg0 + i++);
}

View File

@@ -46,10 +46,6 @@ class PowerLinuxProcess : public PowerProcess
void syscall(ThreadContext *tc, Fault *fault) override;
RegVal getSyscallArg(ThreadContext *tc, int &i) override;
/// Explicitly import the otherwise hidden getSyscallArg
using Process::getSyscallArg;
/// Array of syscall descriptors, indexed by call number.
static SyscallDescABI<SyscallABI> syscallDescs[];

View File

@@ -269,13 +269,6 @@ PowerProcess::argsInit(int intSize, int pageSize)
memState->setStackMin(roundDown(stack_min, pageSize));
}
RegVal
PowerProcess::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 5);
return tc->readIntReg(ArgumentReg0 + i++);
}
void
PowerProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
{

View File

@@ -48,9 +48,6 @@ class PowerProcess : public Process
public:
void argsInit(int intSize, int pageSize);
RegVal getSyscallArg(ThreadContext *tc, int &i) override;
/// Explicitly import the otherwise hidden getSyscallArg
using Process::getSyscallArg;
void setSyscallReturn(ThreadContext *tc,
SyscallReturn return_value) override;

View File

@@ -243,18 +243,6 @@ RiscvProcess::argsInit(int pageSize)
memState->setStackMin(roundDown(memState->getStackMin(), pageSize));
}
RegVal
RiscvProcess::getSyscallArg(ThreadContext *tc, int &i)
{
// If a larger index is requested than there are syscall argument
// registers, return 0
RegVal retval = 0;
if (i < SyscallArgumentRegs.size())
retval = tc->readIntReg(SyscallArgumentRegs[i]);
i++;
return retval;
}
void
RiscvProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
{

View File

@@ -48,9 +48,6 @@ class RiscvProcess : public Process
void argsInit(int pageSize);
public:
RegVal getSyscallArg(ThreadContext *tc, int &i) override;
/// Explicitly import the otherwise hidden getSyscallArg
using Process::getSyscallArg;
void setSyscallReturn(ThreadContext *tc,
SyscallReturn return_value) override;

View File

@@ -493,20 +493,6 @@ Sparc64Process::flushWindows(ThreadContext *tc)
static const int FirstArgumentReg = 8;
RegVal
Sparc32Process::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 6);
return bits(tc->readIntReg(FirstArgumentReg + i++), 31, 0);
}
RegVal
Sparc64Process::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 6);
return tc->readIntReg(FirstArgumentReg + i++);
}
void
SparcProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
{

View File

@@ -152,10 +152,6 @@ class Sparc32Process : public SparcProcess
void flushWindows(ThreadContext *tc) override;
RegVal getSyscallArg(ThreadContext *tc, int &i) override;
/// Explicitly import the otherwise hidden getSyscallArg
using Process::getSyscallArg;
struct SyscallABI : public GenericSyscallABI32,
public SparcProcess::SyscallABI
{};
@@ -220,10 +216,6 @@ class Sparc64Process : public SparcProcess
void flushWindows(ThreadContext *tc) override;
RegVal getSyscallArg(ThreadContext *tc, int &i) override;
/// Explicitly import the otherwise hidden getSyscallArg
using Process::getSyscallArg;
struct SyscallABI : public GenericSyscallABI64,
public SparcProcess::SyscallABI
{};

View File

@@ -1047,13 +1047,6 @@ X86Process::setSyscallReturn(ThreadContext *tc, SyscallReturn retval)
tc->setIntReg(INTREG_RAX, retval.encodedValue());
}
RegVal
X86_64Process::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < NumArgumentRegs);
return tc->readIntReg(ArgumentReg[i++]);
}
void
X86_64Process::clone(ThreadContext *old_tc, ThreadContext *new_tc,
Process *p, RegVal flags)
@@ -1062,24 +1055,6 @@ X86_64Process::clone(ThreadContext *old_tc, ThreadContext *new_tc,
((X86_64Process*)p)->vsyscallPage = vsyscallPage;
}
RegVal
I386Process::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < NumArgumentRegs32);
return tc->readIntReg(ArgumentReg32[i++]);
}
RegVal
I386Process::getSyscallArg(ThreadContext *tc, int &i, int width)
{
assert(width == 32 || width == 64);
assert(i < NumArgumentRegs);
uint64_t retVal = tc->readIntReg(ArgumentReg32[i++]) & mask(32);
if (width == 64)
retVal |= ((uint64_t)tc->readIntReg(ArgumentReg[i++]) << 32);
return retVal;
}
void
I386Process::clone(ThreadContext *old_tc, ThreadContext *new_tc,
Process *p, RegVal flags)

View File

@@ -133,9 +133,6 @@ namespace X86ISA
void argsInit(int pageSize);
void initState() override;
RegVal getSyscallArg(ThreadContext *tc, int &i) override;
/// Explicitly import the otherwise hidden getSyscallArg
using Process::getSyscallArg;
void clone(ThreadContext *old_tc, ThreadContext *new_tc,
Process *process, RegVal flags) override;
};
@@ -174,8 +171,6 @@ namespace X86ISA
void argsInit(int pageSize);
void initState() override;
RegVal getSyscallArg(ThreadContext *tc, int &i) override;
RegVal getSyscallArg(ThreadContext *tc, int &i, int width) override;
void clone(ThreadContext *old_tc, ThreadContext *new_tc,
Process *process, RegVal flags) override;
};

View File

@@ -433,12 +433,6 @@ Process::doSyscall(int64_t callnum, ThreadContext *tc, Fault *fault)
desc->doSyscall(callnum, tc, fault);
}
RegVal
Process::getSyscallArg(ThreadContext *tc, int &i, int width)
{
return getSyscallArg(tc, i);
}
EmulatedDriver *
Process::findDriver(std::string filename)
{

View File

@@ -74,8 +74,6 @@ class Process : public SimObject
DrainState drain() override;
virtual void syscall(ThreadContext *tc, Fault *fault) = 0;
virtual RegVal getSyscallArg(ThreadContext *tc, int &i) = 0;
virtual RegVal getSyscallArg(ThreadContext *tc, int &i, int width);
virtual void setSyscallReturn(ThreadContext *tc,
SyscallReturn return_value) = 0;
virtual SyscallDesc *getDesc(int callnum) = 0;