riscv: Fix crash when syscall argument reg index is too high
riscv: Fix crash when syscall argument reg index is too high

By default, doSyscall gets the values of six registers to be used for
system call arguments.  RISC-V, by convention, only has four.  Because
RISC-V's implementation of these indices is as arrays of integers rather
than as base indices plus offsets, trying to get the fifth argument
register's value will cause a crash.  This patch fixes that by returning 0
for any index higher than 3.

Signed-off-by: Jason Lowe-Power <68c46a606457643eab92053c1c05574abb26f861@lowepower.com>

TUD-OS/gem5-dtu,powerjg/gem5-ci-test,gedare/gem5,powerjg/gem5-ci-test,TUD-OS/gem5-dtu,TUD-OS/gem5-dtu,gem5/gem5,TUD-OS/gem5-dtu,Weil0ng/gem5,sobercoder/gem5,rallylee/gem5,gem5/gem5,gedare/gem5,powerjg/gem5-ci-test,Weil0ng/gem5,sobercoder/gem5,rallylee/gem5,HwisooSo/gemV-update,Weil0ng/gem5,sobercoder/gem5,HwisooSo/gemV-update,HwisooSo/gemV-update,rallylee/gem5,Weil0ng/gem5,HwisooSo/gemV-update,gedare/gem5,TUD-OS/gem5-dtu,HwisooSo/gemV-update,powerjg/gem5-ci-test,gem5/gem5,powerjg/gem5-ci-test,KuroeKurose/gem5,gedare/gem5,TUD-OS/gem5-dtu,Weil0ng/gem5,gedare/gem5,Weil0ng/gem5,KuroeKurose/gem5,gem5/gem5,rallylee/gem5,KuroeKurose/gem5,TUD-OS/gem5-dtu,KuroeKurose/gem5,KuroeKurose/gem5,sobercoder/gem5,gedare/gem5,powerjg/gem5-ci-test,sobercoder/gem5,sobercoder/gem5,HwisooSo/gemV-update,Weil0ng/gem5,KuroeKurose/gem5,gem5/gem5,rallylee/gem5,rallylee/gem5,rallylee/gem5,sobercoder/gem5,gem5/gem5,gem5/gem5,HwisooSo/gemV-update,powerjg/gem5-ci-test,KuroeKurose/gem5,gedare/gem5