From 4670de81004b6bb10cff2cc8c3414d67eda3b0b5 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 24 Nov 2019 23:25:40 -0800 Subject: arch: Get rid of the now unused setSyscallArg. Setting syscall args isn't really something we need to do in gem5, since that will be taken care of by the code actually calling the syscall. We just need to be able to retrieve the value it put there. Jira Issue: https://gem5.atlassian.net/browse/GEM5-187 Change-Id: I0bb6d5d0207a7892414a722b3788cb70ee509582 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23174 Tested-by: kokoro Reviewed-by: Gabe Black Maintainer: Gabe Black --- src/arch/alpha/process.cc | 7 ------- src/arch/alpha/process.hh | 1 - src/arch/arm/process.cc | 15 --------------- src/arch/arm/process.hh | 2 -- src/arch/mips/process.cc | 7 ------- src/arch/mips/process.hh | 1 - src/arch/power/linux/process.cc | 9 --------- src/arch/power/linux/process.hh | 1 - src/arch/power/process.cc | 7 ------- src/arch/power/process.hh | 1 - src/arch/riscv/process.cc | 6 ------ src/arch/riscv/process.hh | 1 - src/arch/sparc/process.cc | 14 -------------- src/arch/sparc/process.hh | 4 ---- src/arch/x86/process.cc | 14 -------------- src/arch/x86/process.hh | 2 -- src/sim/process.hh | 1 - 17 files changed, 93 deletions(-) (limited to 'src') diff --git a/src/arch/alpha/process.cc b/src/arch/alpha/process.cc index b8fb7a99b..02a6899a3 100644 --- a/src/arch/alpha/process.cc +++ b/src/arch/alpha/process.cc @@ -222,13 +222,6 @@ AlphaProcess::getSyscallArg(ThreadContext *tc, int &i) return tc->readIntReg(FirstArgumentReg + i++); } -void -AlphaProcess::setSyscallArg(ThreadContext *tc, int i, RegVal val) -{ - assert(i < 6); - tc->setIntReg(FirstArgumentReg + i, val); -} - void AlphaProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) { diff --git a/src/arch/alpha/process.hh b/src/arch/alpha/process.hh index 5f224880a..c4d4f6b88 100644 --- a/src/arch/alpha/process.hh +++ b/src/arch/alpha/process.hh @@ -52,7 +52,6 @@ class AlphaProcess : public Process RegVal getSyscallArg(ThreadContext *tc, int &i) override; /// Explicitly import the otherwise hidden getSyscallArg using Process::getSyscallArg; - void setSyscallArg(ThreadContext *tc, int i, RegVal val) override; void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value) override; diff --git a/src/arch/arm/process.cc b/src/arch/arm/process.cc index 70024ae68..19ee32bbb 100644 --- a/src/arch/arm/process.cc +++ b/src/arch/arm/process.cc @@ -512,21 +512,6 @@ ArmProcess64::getSyscallArg(ThreadContext *tc, int &i, int width) return getSyscallArg(tc, i); } - -void -ArmProcess32::setSyscallArg(ThreadContext *tc, int i, RegVal val) -{ - assert(i < 6); - tc->setIntReg(ArgumentReg0 + i, val); -} - -void -ArmProcess64::setSyscallArg(ThreadContext *tc, int i, RegVal val) -{ - assert(i < 8); - tc->setIntReg(ArgumentReg0 + i, val); -} - void ArmProcess32::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) { diff --git a/src/arch/arm/process.hh b/src/arch/arm/process.hh index bdd82f847..6b13df106 100644 --- a/src/arch/arm/process.hh +++ b/src/arch/arm/process.hh @@ -89,7 +89,6 @@ class ArmProcess32 : public ArmProcess RegVal getSyscallArg(ThreadContext *tc, int &i, int width) override; RegVal getSyscallArg(ThreadContext *tc, int &i) override; - void setSyscallArg(ThreadContext *tc, int i, RegVal val) override; void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value) override; }; @@ -109,7 +108,6 @@ class ArmProcess64 : public ArmProcess RegVal getSyscallArg(ThreadContext *tc, int &i, int width) override; RegVal getSyscallArg(ThreadContext *tc, int &i) override; - void setSyscallArg(ThreadContext *tc, int i, RegVal val) override; void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value) override; }; diff --git a/src/arch/mips/process.cc b/src/arch/mips/process.cc index 2e66cac82..a62c1deb1 100644 --- a/src/arch/mips/process.cc +++ b/src/arch/mips/process.cc @@ -200,13 +200,6 @@ MipsProcess::getSyscallArg(ThreadContext *tc, int &i) return tc->readIntReg(FirstArgumentReg + i++); } -void -MipsProcess::setSyscallArg(ThreadContext *tc, int i, RegVal val) -{ - assert(i < 6); - tc->setIntReg(FirstArgumentReg + i, val); -} - void MipsProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) { diff --git a/src/arch/mips/process.hh b/src/arch/mips/process.hh index a607bd285..fb31bef6d 100644 --- a/src/arch/mips/process.hh +++ b/src/arch/mips/process.hh @@ -54,7 +54,6 @@ class MipsProcess : public Process RegVal getSyscallArg(ThreadContext *tc, int &i); /// Explicitly import the otherwise hidden getSyscallArg using Process::getSyscallArg; - void setSyscallArg(ThreadContext *tc, int i, RegVal val); void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value); }; diff --git a/src/arch/power/linux/process.cc b/src/arch/power/linux/process.cc index f39de53f8..ac032275e 100644 --- a/src/arch/power/linux/process.cc +++ b/src/arch/power/linux/process.cc @@ -476,12 +476,3 @@ PowerLinuxProcess::getSyscallArg(ThreadContext *tc, int &i) assert(i < 6); return tc->readIntReg(ArgumentReg0 + i++); } - -void -PowerLinuxProcess::setSyscallArg(ThreadContext *tc, int i, RegVal val) -{ - // Linux apparently allows more parameter than the ABI says it should. - // This limit may need to be increased even further. - assert(i < 6); - tc->setIntReg(ArgumentReg0 + i, val); -} diff --git a/src/arch/power/linux/process.hh b/src/arch/power/linux/process.hh index aad4c5f0d..5a2ad92a4 100644 --- a/src/arch/power/linux/process.hh +++ b/src/arch/power/linux/process.hh @@ -48,7 +48,6 @@ class PowerLinuxProcess : public PowerProcess RegVal getSyscallArg(ThreadContext *tc, int &i); /// Explicitly import the otherwise hidden getSyscallArg using Process::getSyscallArg; - void setSyscallArg(ThreadContext *tc, int i, RegVal val); /// Array of syscall descriptors, indexed by call number. static SyscallDesc syscallDescs[]; diff --git a/src/arch/power/process.cc b/src/arch/power/process.cc index b24a51948..fdef2fa30 100644 --- a/src/arch/power/process.cc +++ b/src/arch/power/process.cc @@ -279,13 +279,6 @@ PowerProcess::getSyscallArg(ThreadContext *tc, int &i) return tc->readIntReg(ArgumentReg0 + i++); } -void -PowerProcess::setSyscallArg(ThreadContext *tc, int i, RegVal val) -{ - assert(i < 5); - tc->setIntReg(ArgumentReg0 + i, val); -} - void PowerProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) { diff --git a/src/arch/power/process.hh b/src/arch/power/process.hh index 186bc8745..f746f1155 100644 --- a/src/arch/power/process.hh +++ b/src/arch/power/process.hh @@ -53,7 +53,6 @@ class PowerProcess : public Process RegVal getSyscallArg(ThreadContext *tc, int &i); /// Explicitly import the otherwise hidden getSyscallArg using Process::getSyscallArg; - void setSyscallArg(ThreadContext *tc, int i, RegVal val); void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value); }; diff --git a/src/arch/riscv/process.cc b/src/arch/riscv/process.cc index 617efa0ee..ce4983609 100644 --- a/src/arch/riscv/process.cc +++ b/src/arch/riscv/process.cc @@ -259,12 +259,6 @@ RiscvProcess::getSyscallArg(ThreadContext *tc, int &i) return retval; } -void -RiscvProcess::setSyscallArg(ThreadContext *tc, int i, RegVal val) -{ - tc->setIntReg(SyscallArgumentRegs[i], val); -} - void RiscvProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) { diff --git a/src/arch/riscv/process.hh b/src/arch/riscv/process.hh index 63e379931..71a0c7b60 100644 --- a/src/arch/riscv/process.hh +++ b/src/arch/riscv/process.hh @@ -54,7 +54,6 @@ class RiscvProcess : public Process RegVal getSyscallArg(ThreadContext *tc, int &i) override; /// Explicitly import the otherwise hidden getSyscallArg using Process::getSyscallArg; - void setSyscallArg(ThreadContext *tc, int i, RegVal val) override; void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value) override; diff --git a/src/arch/sparc/process.cc b/src/arch/sparc/process.cc index 23a9b004f..189afac82 100644 --- a/src/arch/sparc/process.cc +++ b/src/arch/sparc/process.cc @@ -505,13 +505,6 @@ Sparc32Process::getSyscallArg(ThreadContext *tc, int &i) return bits(tc->readIntReg(FirstArgumentReg + i++), 31, 0); } -void -Sparc32Process::setSyscallArg(ThreadContext *tc, int i, RegVal val) -{ - assert(i < 6); - tc->setIntReg(FirstArgumentReg + i, bits(val, 31, 0)); -} - RegVal Sparc64Process::getSyscallArg(ThreadContext *tc, int &i) { @@ -519,13 +512,6 @@ Sparc64Process::getSyscallArg(ThreadContext *tc, int &i) return tc->readIntReg(FirstArgumentReg + i++); } -void -Sparc64Process::setSyscallArg(ThreadContext *tc, int i, RegVal val) -{ - assert(i < 6); - tc->setIntReg(FirstArgumentReg + i, val); -} - void SparcProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) { diff --git a/src/arch/sparc/process.hh b/src/arch/sparc/process.hh index 0ef34352b..2e5379bc5 100644 --- a/src/arch/sparc/process.hh +++ b/src/arch/sparc/process.hh @@ -111,8 +111,6 @@ class Sparc32Process : public SparcProcess RegVal getSyscallArg(ThreadContext *tc, int &i); /// Explicitly import the otherwise hidden getSyscallArg using Process::getSyscallArg; - - void setSyscallArg(ThreadContext *tc, int i, RegVal val); }; class Sparc64Process : public SparcProcess @@ -154,8 +152,6 @@ class Sparc64Process : public SparcProcess RegVal getSyscallArg(ThreadContext *tc, int &i); /// Explicitly import the otherwise hidden getSyscallArg using Process::getSyscallArg; - - void setSyscallArg(ThreadContext *tc, int i, RegVal val); }; #endif // __SPARC_PROCESS_HH__ diff --git a/src/arch/x86/process.cc b/src/arch/x86/process.cc index 09ff71f52..f0e8ead98 100644 --- a/src/arch/x86/process.cc +++ b/src/arch/x86/process.cc @@ -1068,13 +1068,6 @@ X86_64Process::getSyscallArg(ThreadContext *tc, int &i) return tc->readIntReg(ArgumentReg[i++]); } -void -X86_64Process::setSyscallArg(ThreadContext *tc, int i, RegVal val) -{ - assert(i < NumArgumentRegs); - return tc->setIntReg(ArgumentReg[i], val); -} - void X86_64Process::clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *p, RegVal flags) @@ -1101,13 +1094,6 @@ I386Process::getSyscallArg(ThreadContext *tc, int &i, int width) return retVal; } -void -I386Process::setSyscallArg(ThreadContext *tc, int i, RegVal val) -{ - assert(i < NumArgumentRegs); - return tc->setIntReg(ArgumentReg[i], val); -} - 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 544d5f61f..37545e9d9 100644 --- a/src/arch/x86/process.hh +++ b/src/arch/x86/process.hh @@ -138,7 +138,6 @@ namespace X86ISA RegVal getSyscallArg(ThreadContext *tc, int &i) override; /// Explicitly import the otherwise hidden getSyscallArg using Process::getSyscallArg; - void setSyscallArg(ThreadContext *tc, int i, RegVal val) override; void clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *process, RegVal flags) override; }; @@ -181,7 +180,6 @@ namespace X86ISA Fault *fault) override; RegVal getSyscallArg(ThreadContext *tc, int &i) override; RegVal getSyscallArg(ThreadContext *tc, int &i, int width) override; - void setSyscallArg(ThreadContext *tc, int i, RegVal val) override; void clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *process, RegVal flags) override; }; diff --git a/src/sim/process.hh b/src/sim/process.hh index a28d58e9a..5d4a9672e 100644 --- a/src/sim/process.hh +++ b/src/sim/process.hh @@ -77,7 +77,6 @@ class Process : public SimObject virtual void syscall(int64_t callnum, ThreadContext *tc, Fault *fault); virtual RegVal getSyscallArg(ThreadContext *tc, int &i) = 0; virtual RegVal getSyscallArg(ThreadContext *tc, int &i, int width); - virtual void setSyscallArg(ThreadContext *tc, int i, RegVal val) = 0; virtual void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value) = 0; virtual SyscallDesc *getDesc(int callnum) = 0; -- cgit v1.2.3