提交 597c0212 编写于 作者: T takasi-y@ops.dti.ne.jp 提交者: Aurelien Jarno

linux-user: Fix syscall pipe2() retval on sh4

On linux/sh4
 pipe() return values by r0:r1 as SH C calling convention.
 pipe2() return values on memory as traditional unix way.
Signed-off-by: NTakashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
上级 41b1e61f
......@@ -969,10 +969,13 @@ static abi_long do_pipe(void *cpu_env, abi_ulong pipedes, int flags)
#if defined(TARGET_MIPS)
((CPUMIPSState*)cpu_env)->active_tc.gpr[3] = host_pipe[1];
ret = host_pipe[0];
#elif defined(TARGET_SH4)
((CPUSH4State*)cpu_env)->gregs[1] = host_pipe[1];
ret = host_pipe[0];
#else
#if defined(TARGET_SH4)
if (!flags) {
((CPUSH4State*)cpu_env)->gregs[1] = host_pipe[1];
ret = host_pipe[0];
} else
#endif
if (put_user_s32(host_pipe[0], pipedes)
|| put_user_s32(host_pipe[1], pipedes + sizeof(host_pipe[0])))
return -TARGET_EFAULT;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册