summaryrefslogtreecommitdiff
path: root/src/arch/riscv/process.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/riscv/process.cc')
-rw-r--r--src/arch/riscv/process.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/arch/riscv/process.cc b/src/arch/riscv/process.cc
index 6fe935c13..b4fe1eefc 100644
--- a/src/arch/riscv/process.cc
+++ b/src/arch/riscv/process.cc
@@ -215,10 +215,10 @@ RiscvProcess::argsInit(int pageSize)
RiscvISA::IntReg
RiscvProcess::getSyscallArg(ThreadContext *tc, int &i)
{
- // RISC-V only has four system call argument registers by convention, so
- // if a larger index is requested return 0
+ // If a larger index is requested than there are syscall argument
+ // registers, return 0
RiscvISA::IntReg retval = 0;
- if (i < 4)
+ if (i < SyscallArgumentRegs.size())
retval = tc->readIntReg(SyscallArgumentRegs[i]);
i++;
return retval;