diff --git a/src/arch/arm/freebsd/process.hh b/src/arch/arm/freebsd/process.hh index 835acc5b28..d731b69c79 100644 --- a/src/arch/arm/freebsd/process.hh +++ b/src/arch/arm/freebsd/process.hh @@ -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; diff --git a/src/arch/arm/linux/process.hh b/src/arch/arm/linux/process.hh index 8204f43004..2edd31ef77 100644 --- a/src/arch/arm/linux/process.hh +++ b/src/arch/arm/linux/process.hh @@ -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; diff --git a/src/arch/arm/process.cc b/src/arch/arm/process.cc index 7eb263dced..b997d6c8f8 100644 --- a/src/arch/arm/process.cc +++ b/src/arch/arm/process.cc @@ -478,45 +478,6 @@ const std::vector 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) { diff --git a/src/arch/arm/process.hh b/src/arch/arm/process.hh index 1650ff680a..4ebe614f6a 100644 --- a/src/arch/arm/process.hh +++ b/src/arch/arm/process.hh @@ -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; diff --git a/src/arch/mips/process.cc b/src/arch/mips/process.cc index 93b64ffa3f..f3bb387511 100644 --- a/src/arch/mips/process.cc +++ b/src/arch/mips/process.cc @@ -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) { diff --git a/src/arch/mips/process.hh b/src/arch/mips/process.hh index c153979447..124dd56fc9 100644 --- a/src/arch/mips/process.hh +++ b/src/arch/mips/process.hh @@ -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 diff --git a/src/arch/power/linux/process.cc b/src/arch/power/linux/process.cc index 0653c3123a..3c74ac4f0c 100644 --- a/src/arch/power/linux/process.cc +++ b/src/arch/power/linux/process.cc @@ -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++); -} diff --git a/src/arch/power/linux/process.hh b/src/arch/power/linux/process.hh index 5ff462fc60..43afef8b72 100644 --- a/src/arch/power/linux/process.hh +++ b/src/arch/power/linux/process.hh @@ -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 syscallDescs[]; diff --git a/src/arch/power/process.cc b/src/arch/power/process.cc index d74563b92e..dd161fdf3f 100644 --- a/src/arch/power/process.cc +++ b/src/arch/power/process.cc @@ -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) { diff --git a/src/arch/power/process.hh b/src/arch/power/process.hh index 7f6eede192..91152aadf4 100644 --- a/src/arch/power/process.hh +++ b/src/arch/power/process.hh @@ -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; diff --git a/src/arch/riscv/process.cc b/src/arch/riscv/process.cc index 9041bf3160..88dbf7cd50 100644 --- a/src/arch/riscv/process.cc +++ b/src/arch/riscv/process.cc @@ -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) { diff --git a/src/arch/riscv/process.hh b/src/arch/riscv/process.hh index f3f8462b71..806a914161 100644 --- a/src/arch/riscv/process.hh +++ b/src/arch/riscv/process.hh @@ -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; diff --git a/src/arch/sparc/process.cc b/src/arch/sparc/process.cc index 0104b1a580..046a053a1b 100644 --- a/src/arch/sparc/process.cc +++ b/src/arch/sparc/process.cc @@ -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) { diff --git a/src/arch/sparc/process.hh b/src/arch/sparc/process.hh index 4bd99a8344..c958e7d872 100644 --- a/src/arch/sparc/process.hh +++ b/src/arch/sparc/process.hh @@ -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 {}; diff --git a/src/arch/x86/process.cc b/src/arch/x86/process.cc index 3fed1d3289..9db4eab33a 100644 --- a/src/arch/x86/process.cc +++ b/src/arch/x86/process.cc @@ -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) diff --git a/src/arch/x86/process.hh b/src/arch/x86/process.hh index 3118730049..7a9f691adb 100644 --- a/src/arch/x86/process.hh +++ b/src/arch/x86/process.hh @@ -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; }; diff --git a/src/sim/process.cc b/src/sim/process.cc index 254583b072..7099832274 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -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) { diff --git a/src/sim/process.hh b/src/sim/process.hh index 72a6bba276..e40e741b9e 100644 --- a/src/sim/process.hh +++ b/src/sim/process.hh @@ -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;