From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uz9RS-0000Ze-08 for qemu-devel@nongnu.org; Tue, 16 Jul 2013 13:53:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uz9RN-0000MK-Lq for qemu-devel@nongnu.org; Tue, 16 Jul 2013 13:53:37 -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]:58750 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uz9JM-0003GL-P0 for qemu-devel@nongnu.org; Tue, 16 Jul 2013 13:45:16 -0400 From: Peter Maydell Date: Tue, 16 Jul 2013 18:44:54 +0100 Message-Id: <1373996700-29286-8-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1373996700-29286-1-git-send-email-peter.maydell@linaro.org> References: <1373996700-29286-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH v3 07/13] linux-user: Enable NPTL for SPARC targets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jia Liu , patches@linaro.org, Riku Voipio , Alexander Graf , Laurent Vivier , Blue Swirl , "Edgar E. Iglesias" , Guan Xuetao , Aurelien Jarno , Richard Henderson 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 -- 1.7.9.5