On Fri, Aug 05, 2011 at 10:27:21AM +0100, Peter Maydell wrote: > On 5 August 2011 01:05, An-Cheng Huang <anch...@ubnt.com> wrote: > > Ok the following patch changes the number of arguments for sys_syscall > > to 8 in mips_syscall_args and also skips the do_syscall() call if any > > of the get_user() calls fails. Do you think combining these makes sense > > or should they be two separate patches? Thanks. > > The code in this patch looks good, but yes, I think they should > be two separate patches.
Here's the first patch for the indirect syscall: This patch changes the number of arguments for sys_syscall on MIPS to 8, which allows the arguments for the actual syscall to be handled correctly. Signed-off-by: An-Cheng Huang <anch...@ubnt.com> --- linux-user/main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 6a8f4bd..9e67b24 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1669,7 +1669,7 @@ void cpu_loop(CPUPPCState *env) #define MIPS_SYS(name, args) args, static const uint8_t mips_syscall_args[] = { - MIPS_SYS(sys_syscall , 0) /* 4000 */ + MIPS_SYS(sys_syscall , 8) /* 4000 */ MIPS_SYS(sys_exit , 1) MIPS_SYS(sys_fork , 0) MIPS_SYS(sys_read , 3)