From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UvVWi-0008JO-0T for qemu-devel@nongnu.org; Sat, 06 Jul 2013 12:40:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UvVWe-0002fz-Oa for qemu-devel@nongnu.org; Sat, 06 Jul 2013 12:39:59 -0400 Received: from 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:1d0::1]:58428 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UvVWe-0002ee-IV for qemu-devel@nongnu.org; Sat, 06 Jul 2013 12:39:56 -0400 From: Peter Maydell Date: Sat, 6 Jul 2013 17:39:48 +0100 Message-Id: <1373128788-16756-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH] linux-user: Fix pipe syscall return for SPARC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Riku Voipio , patches@linaro.org SPARC is one of the CPUs which has a funny syscall ABI for the pipe syscall; add it to the set of special cases in do_pipe(). Signed-off-by: Peter Maydell --- bash is much more useful with this patch -- without it, it will close() stdin instead of one end of its pipe to a child process, so after the first time you run a program bash will exit... It's this kind of "basic stuff doesn't work" that makes me happier about being a bit cavalier with code cleanups, enabling NPTL, etc for some of the minor target archs in linux-user -- it's clear that some of them have simply never been tested for anything more serious than "run some trivial binary"... linux-user/syscall.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index cdd0c28..aea9be4 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1030,6 +1030,9 @@ static abi_long do_pipe(void *cpu_env, abi_ulong pipedes, #elif defined(TARGET_SH4) ((CPUSH4State*)cpu_env)->gregs[1] = host_pipe[1]; return host_pipe[0]; +#elif defined(TARGET_SPARC) + ((CPUSPARCState*)cpu_env)->regwptr[1] = host_pipe[1]; + return host_pipe[0]; #endif } -- 1.7.9.5