From patchwork Fri Dec 3 13:36:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku@afflict.kos.to, Voipio@afflict.kos.to X-Patchwork-Id: 74153 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 DEE2F1007D1 for ; Sat, 4 Dec 2010 01:07:48 +1100 (EST) Received: from localhost ([127.0.0.1]:38871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POVqe-0003tR-77 for incoming@patchwork.ozlabs.org; Fri, 03 Dec 2010 08:38:52 -0500 Received: from [140.186.70.92] (port=60350 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POVof-0003ow-AO for qemu-devel@nongnu.org; Fri, 03 Dec 2010 08:36:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1POVoc-0008ON-Fb for qemu-devel@nongnu.org; Fri, 03 Dec 2010 08:36:49 -0500 Received: from afflict.kos.to ([92.243.29.197]:44055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1POVoc-0008Np-AW for qemu-devel@nongnu.org; Fri, 03 Dec 2010 08:36:46 -0500 Received: by afflict.kos.to (Postfix, from userid 1000) id D48722667C; Fri, 3 Dec 2010 13:36:43 +0000 (UTC) From: Riku@afflict.kos.to, Voipio@afflict.kos.to To: qemu-devel@nongnu.org Date: Fri, 3 Dec 2010 15:36:36 +0200 Message-Id: <0165329578eb8f40901825177c0874efb815e342.1291382447.git.riku.voipio@nokia.com> X-Mailer: git-send-email 1.6.5 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Peter Maydell Subject: [Qemu-devel] [PATCH 09/16] ARM: Expose vfp_get_fpscr() and vfp_set_fpscr() to C code 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 From: Peter Maydell Expose the vfp_get_fpscr() and vfp_set_fpscr() functions to C code as well as generated code, so we can use them to read and write the FPSCR when saving and restoring VFP registers across signal handlers in linux-user mode. Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- target-arm/cpu.h | 4 ++++ target-arm/helper.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 0284bad..340933e 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -300,6 +300,10 @@ static inline void xpsr_write(CPUARMState *env, uint32_t val, uint32_t mask) } } +/* Return the current FPSCR value. */ +uint32_t vfp_get_fpscr(CPUARMState *env); +void vfp_set_fpscr(CPUARMState *env, uint32_t val); + enum arm_cpu_mode { ARM_CPU_MODE_USR = 0x10, ARM_CPU_MODE_FIQ = 0x11, diff --git a/target-arm/helper.c b/target-arm/helper.c index 94aef39..2a1f448 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -2251,6 +2251,11 @@ uint32_t HELPER(vfp_get_fpscr)(CPUState *env) return fpscr; } +uint32_t vfp_get_fpscr(CPUState *env) +{ + return HELPER(vfp_get_fpscr)(env); +} + /* Convert vfp exception flags to target form. */ static inline int vfp_exceptbits_to_host(int target_bits) { @@ -2307,6 +2312,11 @@ void HELPER(vfp_set_fpscr)(CPUState *env, uint32_t val) set_float_exception_flags(i, &env->vfp.fp_status); } +void vfp_set_fpscr(CPUState *env, uint32_t val) +{ + HELPER(vfp_set_fpscr)(env, val); +} + #define VFP_HELPER(name, p) HELPER(glue(glue(vfp_,name),p)) #define VFP_BINOP(name) \