Received: from eggs.gnu.org ([2001:4830:134:3::10]:57446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uti0e-0003tZ-Kn for qemu-devel@nongnu.org; Mon, 01 Jul 2013 13:35:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uti0b-0002uj-GX for qemu-devel@nongnu.org; Mon, 01 Jul 2013 13:35:28 -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]:58348 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uti0b-0002uZ-9J for qemu-devel@nongnu.org; Mon, 01 Jul 2013 13:35:25 -0400 From: Peter Maydell Date: Mon, 1 Jul 2013 18:35:14 +0100 Message-Id: <1372700120-8896-16-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1372700120-8896-1-git-send-email-peter.maydell@linaro.org> References: <1372700120-8896-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH v5 15/21] target-arm: Implement cpu_set_tls() and cpu_clone_regs() for AArch64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Andreas Schwab , Alexander Graf , "Mian M. Hamayun" , patches@linaro.org From: Alexander Graf [PMM: pulled out from another patch because this is going to need to morph into a patch putting them into linux-user/aarch64/target_cpu.h as soon as my patch doing that move for existing CPUs lands; also use #ifdefs rather than is_a64().] Signed-off-by: Alexander Graf Signed-off-by: John Rigby Signed-off-by: Peter Maydell --- target-arm/cpu.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 78614a4..f9288d1 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -303,10 +303,17 @@ int cpu_arm_handle_mmu_fault (CPUARMState *env, target_ulong address, int rw, int mmu_idx); #define cpu_handle_mmu_fault cpu_arm_handle_mmu_fault +#ifndef TARGET_AARCH64 static inline void cpu_set_tls(CPUARMState *env, target_ulong newtls) { env->cp15.c13_tls2 = newtls; } +#else +static inline void cpu_set_tls(CPUARMState *env, target_ulong newtls) +{ + env->sr.tpidr_el0 = newtls; +} +#endif #define CPSR_M (0x1f) #define CPSR_T (1 << 5) @@ -795,12 +802,22 @@ static inline int cpu_mmu_index (CPUARMState *env) } #if defined(CONFIG_USER_ONLY) +#ifndef TARGET_AARCH64 static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp) { if (newsp) env->regs[13] = newsp; env->regs[0] = 0; } +#else +static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp) +{ + if (newsp) { + env->xregs[31] = newsp; + } + env->xregs[0] = 0; +} +#endif #endif #include "exec/cpu-all.h" -- 1.7.9.5