qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Blue Swirl <blauwirbel@gmail.com>,
	Riku Voipio <riku.voipio@iki.fi>,
	patches@linaro.org
Subject: [Qemu-devel] [PATCH] linux-user: Fix pipe syscall return for SPARC
Date: Sat,  6 Jul 2013 17:39:48 +0100	[thread overview]
Message-ID: <1373128788-16756-1-git-send-email-peter.maydell@linaro.org> (raw)

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 <peter.maydell@linaro.org>
---
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

             reply	other threads:[~2013-07-06 16:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-06 16:39 Peter Maydell [this message]
2013-07-18 10:17 ` [Qemu-devel] [PATCH] linux-user: Fix pipe syscall return for SPARC Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1373128788-16756-1-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=blauwirbel@gmail.com \
    --cc=patches@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).