Received: from eggs.gnu.org ([2001:4830:134:3::10]:51599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJT35-0004Zv-PJ for qemu-devel@nongnu.org; Tue, 10 Sep 2013 14:52:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJT33-00057f-M4 for qemu-devel@nongnu.org; Tue, 10 Sep 2013 14:52:27 -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]:43707 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJT33-00056X-Ep for qemu-devel@nongnu.org; Tue, 10 Sep 2013 14:52:25 -0400 From: Peter Maydell Date: Tue, 10 Sep 2013 19:52:18 +0100 Message-Id: <1378839142-7726-25-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1378839142-7726-1-git-send-email-peter.maydell@linaro.org> References: <1378839142-7726-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 24/28] linux-user: Implement cpu_set_tls() and cpu_clone_regs() for AArch64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org From: Alexander Graf Signed-off-by: Alexander Graf Signed-off-by: John Rigby Signed-off-by: Peter Maydell Message-id: 1378235544-22290-19-git-send-email-peter.maydell@linaro.org [PMM: pulled out from another patch; don't use is_a64() here; moved to linux-user from target-arm] Signed-off-by: Peter Maydell --- linux-user/aarch64/target_cpu.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 linux-user/aarch64/target_cpu.h diff --git a/linux-user/aarch64/target_cpu.h b/linux-user/aarch64/target_cpu.h new file mode 100644 index 0000000..6f5539b --- /dev/null +++ b/linux-user/aarch64/target_cpu.h @@ -0,0 +1,35 @@ +/* + * ARM AArch64 specific CPU ABI and functions for linux-user + * + * Copyright (c) 2013 Alexander Graf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see . + */ +#ifndef TARGET_CPU_H +#define TARGET_CPU_H + +static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp) +{ + if (newsp) { + env->xregs[31] = newsp; + } + env->xregs[0] = 0; +} + +static inline void cpu_set_tls(CPUARMState *env, target_ulong newtls) +{ + env->sr.tpidr_el0 = newtls; +} + +#endif -- 1.7.9.5