From patchwork Fri Jul 12 20:12:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 18336 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4359425E34 for ; Fri, 12 Jul 2013 20:13:03 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id 2sf11987049qea.9 for ; Fri, 12 Jul 2013 13:13:03 -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 :in-reply-to:references: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=X7nMgIeKZJkiVxLiwoPiuTBJEtZFThShyt5iMyLdL0Q=; b=nedBgIfbQiRxDX7uxFw1ZKi+Dr79gcGLg2ziG0esUlpVnKurt4dWG0WdOUr+8InXef WO3Vcr2z67MnYdsmZMAmKEG2SHdcJU75/8y0BLSqfPOUfxryygYq4FfXydEBNahBP3Gb rxxD0ODSd+Ho+UQ4TOVmbYA9WldC4//GO0UNcWp5mYCGz49RN148I6eDLaqFOvZ5XaOt qFwEIXuHyDSpImSD4nC1+weHaIusEb86EqSAQ5ffkSXbIx7XufTCCMWApy+UW9vdFYyR GAm46Jk8EAjpNK0c9gqGy66sRYL/eO3lqNdHBXydNVrlSegEcckfCS4/eoSlpiCQF5Pm N+wQ== X-Received: by 10.236.88.231 with SMTP id a67mr21682066yhf.39.1373659982807; Fri, 12 Jul 2013 13:13:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.59.111 with SMTP id y15ls3501420qeq.96.gmail; Fri, 12 Jul 2013 13:13:02 -0700 (PDT) X-Received: by 10.221.63.2 with SMTP id xc2mr22596949vcb.74.1373659982654; Fri, 12 Jul 2013 13:13:02 -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 ya5si12648244vec.133.2013.07.12.13.13.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Jul 2013 13:13:02 -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 oz10so8474083veb.5 for ; Fri, 12 Jul 2013 13:13:02 -0700 (PDT) X-Received: by 10.52.164.16 with SMTP id ym16mr20936577vdb.32.1373659982390; Fri, 12 Jul 2013 13:13:02 -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 s13csp147060vcv; Fri, 12 Jul 2013 13:13:01 -0700 (PDT) X-Received: by 10.204.62.201 with SMTP id y9mr6583361bkh.23.1373659979234; Fri, 12 Jul 2013 13:12:59 -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 kx10si5037425bkb.178.2013.07.12.13.12.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 12 Jul 2013 13:12:59 -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 1Uxji2-00064Y-47; Fri, 12 Jul 2013 21:12:54 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Paul Brook , Aurelien Jarno , Jia Liu , Alexander Graf , Blue Swirl , Guan Xuetao , Riku Voipio Subject: [PATCH 7/8] linux-user: Enable NPTL for SPARC targets Date: Fri, 12 Jul 2013 21:12:52 +0100 Message-Id: <1373659973-23289-8-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1373659973-23289-1-git-send-email-peter.maydell@linaro.org> References: <1373659973-23289-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQmy+XZnpPBB9iisdEWvuTHlD/oJb0ofnGTF+bKxeMfCI7V/mQhJgYMRFs/IpwjcgKIDnvT0 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: , Provide the missing cpu_set_tls(), and resolve the FIXME in cpu_clone_regs() by clearing the carry flag for the child. This allows us to turn on building with NPTL for SPARC. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- configure | 3 --- linux-user/sparc/target_cpu.h | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 3848c1c..117191e 100755 --- a/configure +++ b/configure @@ -4255,18 +4255,15 @@ case "$target_name" in bflt="yes" ;; sparc) - target_nptl="no" ;; sparc64) TARGET_BASE_ARCH=sparc - target_nptl="no" ;; sparc32plus) TARGET_ARCH=sparc64 TARGET_BASE_ARCH=sparc TARGET_ABI_DIR=sparc echo "TARGET_ABI32=y" >> $config_target_mak - target_nptl="no" ;; s390x) ;; diff --git a/linux-user/sparc/target_cpu.h b/linux-user/sparc/target_cpu.h index 5a620a2..4944d46 100644 --- a/linux-user/sparc/target_cpu.h +++ b/linux-user/sparc/target_cpu.h @@ -25,12 +25,20 @@ static inline void cpu_clone_regs(CPUSPARCState *env, target_ulong newsp) if (newsp) { env->regwptr[22] = newsp; } + /* syscall return for clone child: 0, and clear CF since + * this counts as a success return value. + */ env->regwptr[0] = 0; - /* FIXME: Do we also need to clear CF? */ - /* XXXXX */ - printf("HELPME: %s:%d\n", __FILE__, __LINE__); +#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) + env->xcc &= ~PSR_CARRY; +#else + env->psr &= ~PSR_CARRY; +#endif } -/* TODO: need to implement cpu_set_tls() */ +static inline void cpu_set_tls(CPUSPARCState *env, target_ulong newtls) +{ + env->gregs[7] = newtls; +} #endif