Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nhlvl-00009I-B8 for qemu-devel@nongnu.org; Wed, 17 Feb 2010 10:35:13 -0500 Received: from [199.232.76.173] (port=60381 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nhlvk-000099-KO for qemu-devel@nongnu.org; Wed, 17 Feb 2010 10:35:12 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nhlvj-0007XU-SC for qemu-devel@nongnu.org; Wed, 17 Feb 2010 10:35:12 -0500 Received: from smtp09.dti.ne.jp ([202.216.231.184]:56514) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nhlvj-0007X8-1E for qemu-devel@nongnu.org; Wed, 17 Feb 2010 10:35:11 -0500 Date: Thu, 18 Feb 2010 00:35:03 +0900 (JST) Message-Id: <201002171535.o1HFZ3Ra009730@smtp09.dti.ne.jp> From: takasi-y@ops.dti.ne.jp Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] sh4 linux-user: Fix syscall pipe2() retval List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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: Takashi YOSHII --- linux-user/syscall.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9fb493f..034a2b0 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -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; -- 1.6.5