From patchwork Tue Jul 16 17:44:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 18382 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f69.google.com (mail-qe0-f69.google.com [209.85.128.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4C1D425E13 for ; Tue, 16 Jul 2013 17:45:08 +0000 (UTC) Received: by mail-qe0-f69.google.com with SMTP id a11sf1230085qen.4 for ; Tue, 16 Jul 2013 10:45:07 -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=nNC9VIubK7hIAhwXXd0tq3hhrcB5YVhpZd87LglfXtE=; b=WA0n9FhYw+2SMmk435jdu180ljV0wJa/9WTV05qp7CoNcvDtVKBDUoBcOEXEfxU8jW ZkOVeNraG29ezBNtStcy7JJnzT0QIk+qQQUNbJrXKG+bF0l6aSNKRkVlmDhSS5HmIM1f jioyPYAtELxPEiWbfyvuik9yskQUm7S2mcJeup2GqJfyABd8MOPSbAv/3t/O9Ts46/79 Eff4OXbshkFlZH3x0j2+i7VTK29zNULsUeLNdghG11zrCZpNhFJ0bspz24dusSJLMFiZ 9JoZx3/kDBmXtU/XcWBvDNsRD7VgXGwlBSpy+1BjuAc0YHGOuqq0/OyTe/Dj4krC56ya FCgQ== X-Received: by 10.236.199.102 with SMTP id w66mr1386014yhn.41.1373996707607; Tue, 16 Jul 2013 10:45:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.58.4 with SMTP id m4ls365898qeq.52.gmail; Tue, 16 Jul 2013 10:45:07 -0700 (PDT) X-Received: by 10.59.8.232 with SMTP id dn8mr822029ved.8.1373996707362; Tue, 16 Jul 2013 10:45:07 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id op1si454784vcb.90.2013.07.16.10.45.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Jul 2013 10:45:07 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.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.220.174; Received: by mail-vc0-f174.google.com with SMTP id kw10so659919vcb.5 for ; Tue, 16 Jul 2013 10:45:07 -0700 (PDT) X-Received: by 10.52.91.202 with SMTP id cg10mr651950vdb.85.1373996707240; Tue, 16 Jul 2013 10:45:07 -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 s13csp131940vcv; Tue, 16 Jul 2013 10:45:06 -0700 (PDT) X-Received: by 10.194.219.198 with SMTP id pq6mr2074967wjc.58.1373996705598; Tue, 16 Jul 2013 10:45:05 -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 pi6si1090166wjb.23.2013.07.16.10.45.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 16 Jul 2013 10:45:05 -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 1Uz9J7-0007dH-Ju; Tue, 16 Jul 2013 18:45:01 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Riku Voipio , Richard Henderson , Aurelien Jarno , Alexander Graf , Blue Swirl , Guan Xuetao , "Edgar E. Iglesias" , Jia Liu , Laurent Vivier Subject: [PATCH v3 07/13] linux-user: Enable NPTL for SPARC targets Date: Tue, 16 Jul 2013 18:44:54 +0100 Message-Id: <1373996700-29286-8-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1373996700-29286-1-git-send-email-peter.maydell@linaro.org> References: <1373996700-29286-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQkwCxa+60j5rzu+biIadnxmpepRbCdydpl05m9tZmsPubc2mzFvNv7MFF3rPcx0SzPVERka X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.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