summaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authortakasi-y@ops.dti.ne.jp <takasi-y@ops.dti.ne.jp>2010-02-18 00:35:03 +0900
committerAurelien Jarno <aurelien@aurel32.net>2010-03-06 19:35:18 +0100
commit8b94631d63bc08b31d7793fc75c550cfb1d8dbbe (patch)
tree2c9669e7a726af9f0fd62761115270cdf7b275b3 /linux-user
parent1bb22c00cd7db3780ff1ad9a5e66f4f362937ac2 (diff)
downloadqemu-8b94631d63bc08b31d7793fc75c550cfb1d8dbbe.tar.gz
qemu-8b94631d63bc08b31d7793fc75c550cfb1d8dbbe.tar.bz2
qemu-8b94631d63bc08b31d7793fc75c550cfb1d8dbbe.zip
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: Takashi YOSHII <takasi-y@ops.dti.ne.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 38eb35f542..80d8633473 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;