From patchwork Sat Jul 6 16:39:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 18274 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0DCA220E0B for ; Sat, 6 Jul 2013 16:39:57 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id fo12sf3517458lab.1 for ; Sat, 06 Jul 2013 09:39:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=+rlim2217v3ibOVK5xMlhhieygAV5OddTjVRwVkkMaw=; b=K2hrM/77FZstoF3UX7zazRdenr8JLtFcGXKkjb44stdN2pI77fHnjcnM9xsFGc9pcG N3UPZp+c7Ns9+r2d7FGSe5ml2je+N0+VJ3yJHHDsuEhhxQAUJw8+64jZJyxHmZ0S6mky LNsG75QMseOmqpuCO47UXcSYiji2XaYsZvJoPyXqSuT16EqNx/C+fJWVXAEtDl8n7omG fBzQC1qIkYf85wLEtq1cl5mIiNmyN67OKU6y+93m01sGRNt4Tm58eCeVysOtTs5Xk3lr +Z6KAIGs5c7+xgrs/Ineb1BaRxXPWwtinTJN0XLBAG57cuNcI6U3no4qW5eiDIAXWz04 RFsw== X-Received: by 10.180.37.143 with SMTP id y15mr4415441wij.2.1373128796021; Sat, 06 Jul 2013 09:39:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.93.230 with SMTP id cx6ls1910022wib.11.canary; Sat, 06 Jul 2013 09:39:55 -0700 (PDT) X-Received: by 10.194.93.74 with SMTP id cs10mr8544191wjb.9.1373128795629; Sat, 06 Jul 2013 09:39:55 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id o4si12338571wij.51.2013.07.06.09.39.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 06 Jul 2013 09:39:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id oz10so2487832veb.5 for ; Sat, 06 Jul 2013 09:39:54 -0700 (PDT) X-Received: by 10.52.164.16 with SMTP id ym16mr8559081vdb.32.1373128794222; Sat, 06 Jul 2013 09:39:54 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.149.77 with SMTP id s13csp102053vcv; Sat, 6 Jul 2013 09:39:51 -0700 (PDT) X-Received: by 10.194.123.199 with SMTP id mc7mr8500735wjb.35.1373128791335; Sat, 06 Jul 2013 09:39:51 -0700 (PDT) Received: from mnementh.archaic.org.uk (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]) by mx.google.com with ESMTPS id l7si10405447eey.210.2013.07.06.09.39.50 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 06 Jul 2013 09:39:50 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1UvVWW-0004Mj-5Y; Sat, 06 Jul 2013 17:39:48 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Riku Voipio , Blue Swirl Subject: [PATCH] linux-user: Fix pipe syscall return for SPARC Date: Sat, 6 Jul 2013 17:39:48 +0100 Message-Id: <1373128788-16756-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQmSDkKmtdeGzKpt71iy9PgCnummarIC/rHQim/CQXeeQEfvYvStC8zkfHQeEDfRgAyJi00l X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 }