From patchwork Thu Mar 25 00:13:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 48488 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 367EDB7C59 for ; Thu, 25 Mar 2010 11:56:19 +1100 (EST) Received: from localhost ([127.0.0.1]:40006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NubMu-0000C6-Ky for incoming@patchwork.ozlabs.org; Wed, 24 Mar 2010 20:56:16 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nub7h-0003qp-C7 for qemu-devel@nongnu.org; Wed, 24 Mar 2010 20:40:33 -0400 Received: from [140.186.70.92] (port=57574 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nub7Y-0003nb-9h for qemu-devel@nongnu.org; Wed, 24 Mar 2010 20:40:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nub7S-0000ey-1D for qemu-devel@nongnu.org; Wed, 24 Mar 2010 20:40:23 -0400 Received: from are.twiddle.net ([75.149.56.221]:53040) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nub7R-0000eg-Rv for qemu-devel@nongnu.org; Wed, 24 Mar 2010 20:40:18 -0400 Received: by are.twiddle.net (Postfix, from userid 5000) id 029D2FD2; Wed, 24 Mar 2010 17:40:14 -0700 (PDT) Message-Id: <3ad080dc6fffc271c8b420f7d15acd9ce06914b8.1269476678.git.rth@twiddle.net> In-Reply-To: References: From: Richard Henderson Date: Wed, 24 Mar 2010 17:13:07 -0700 To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 10/10] target-alpha: Enable NPTL. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Richard Henderson --- configure | 1 + linux-user/syscall.c | 2 +- target-alpha/cpu.h | 28 +++++++++++++++++----------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/configure b/configure index 6bc40a3..6b50b6a 100755 --- a/configure +++ b/configure @@ -2368,6 +2368,7 @@ case "$target_arch2" in ;; alpha) target_phys_bits=64 + target_nptl="yes" ;; arm|armeb) TARGET_ARCH=arm diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 80d8633..b921076 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5755,7 +5755,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, ret = get_errno(fsync(arg1)); break; case TARGET_NR_clone: -#if defined(TARGET_SH4) +#if defined(TARGET_SH4) || defined(TARGET_ALPHA) ret = get_errno(do_fork(cpu_env, arg1, arg2, arg3, arg5, arg4)); #elif defined(TARGET_CRIS) ret = get_errno(do_fork(cpu_env, arg2, arg1, arg3, arg4, arg5)); diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h index cf2b587..bbc5ac2 100644 --- a/target-alpha/cpu.h +++ b/target-alpha/cpu.h @@ -412,15 +412,6 @@ static inline int cpu_mmu_index (CPUState *env) return (env->ps >> 3) & 3; } -#if defined(CONFIG_USER_ONLY) -static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) -{ - if (newsp) - env->ir[30] = newsp; - /* FIXME: Zero syscall return value. */ -} -#endif - #include "cpu-all.h" #include "exec-all.h" @@ -478,7 +469,7 @@ enum { IR_S4 = 13, IR_S5 = 14, IR_S6 = 15, -#define IR_FP IR_S6 + IR_FP = IR_S6, IR_A0 = 16, IR_A1 = 17, IR_A2 = 18, @@ -491,7 +482,7 @@ enum { IR_T11 = 25, IR_RA = 26, IR_T12 = 27, -#define IR_PV IR_T12 + IR_PV = IR_T12, IR_AT = 28, IR_GP = 29, IR_SP = 30, @@ -532,4 +523,19 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, *flags = env->ps; } +#if defined(CONFIG_USER_ONLY) +static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) +{ + if (newsp) + env->ir[IR_SP] = newsp; + env->ir[IR_V0] = 0; + env->ir[IR_A3] = 0; +} + +static inline void cpu_set_tls(CPUState *env, target_ulong newtls) +{ + env->unique = newtls; +} +#endif + #endif /* !defined (__CPU_ALPHA_H__) */