From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MY078-00068b-Mb for qemu-devel@nongnu.org; Mon, 03 Aug 2009 12:10:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MY073-00066c-Oq for qemu-devel@nongnu.org; Mon, 03 Aug 2009 12:10:17 -0400 Received: from [199.232.76.173] (port=59354 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MY073-00066V-Hn for qemu-devel@nongnu.org; Mon, 03 Aug 2009 12:10:13 -0400 Received: from mx20.gnu.org ([199.232.41.8]:51912) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MY073-0001nu-21 for qemu-devel@nongnu.org; Mon, 03 Aug 2009 12:10:13 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MY072-0005yj-1G for qemu-devel@nongnu.org; Mon, 03 Aug 2009 12:10:12 -0400 From: Nathan Froyd Date: Mon, 3 Aug 2009 08:43:24 -0700 Message-Id: <1249314209-10230-3-git-send-email-froydnj@codesourcery.com> In-Reply-To: <1249314209-10230-1-git-send-email-froydnj@codesourcery.com> References: <1249314209-10230-1-git-send-email-froydnj@codesourcery.com> Subject: [Qemu-devel] [PATCH 2/7] target-ppc: add cpu_set_tls List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Nathan Froyd --- target-ppc/cpu.h | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index 148e8c3..fe2257d 100644 --- a/target-ppc/cpu.h +++ b/target-ppc/cpu.h @@ -1589,4 +1589,15 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, *flags = env->hflags; } +static inline void cpu_set_tls(CPUState *env, target_ulong newtls) +{ +#if defined(TARGET_PPC64) + /* The kernel checks TIF_32BIT here; we don't support loading 32-bit + binaries on PPC64 yet. */ + env->gpr[13] = newtls; +#else + env->gpr[2] = newtls; +#endif +} + #endif /* !defined (__CPU_PPC_H__) */ -- 1.6.3.2