[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/16] ARM: Expose vfp_get_fpscr() and vfp_set_fpscr
From: |
Riku |
Subject: |
[Qemu-devel] [PATCH 09/16] ARM: Expose vfp_get_fpscr() and vfp_set_fpscr() to C code |
Date: |
Fri, 3 Dec 2010 15:36:36 +0200 |
From: Peter Maydell <address@hidden>
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 <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
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) \
--
1.6.5
- [Qemu-devel] [PATCH 04/16] linux-user: remove unnecessary local from __get_user(), __put_user(), (continued)
- [Qemu-devel] [PATCH 04/16] linux-user: remove unnecessary local from __get_user(), __put_user(), Riku, 2010/12/03
- [Qemu-devel] [PATCH 14/16] linux-user: fix compiler error on nptl, Riku, 2010/12/03
- [Qemu-devel] [PATCH 03/16] linux-user: fix memory leaks with NPTL emulation, Riku, 2010/12/03
- [Qemu-devel] [PATCH 10/16] ARM: linux-user: Expose VFP registers to signal handlers, Riku, 2010/12/03
- [Qemu-devel] [PATCH 11/16] ARM: linux-user: Restore VFP state from ucontext on sigreturn, Riku, 2010/12/03
- [Qemu-devel] [PATCH 12/16] ARM: linux-user: Expose iWMMXT registers to signal handlers, Riku, 2010/12/03
- [Qemu-devel] [PATCH 06/16] ARM: enable XScale/iWMMXT in linux-user mode, Riku, 2010/12/03
- [Qemu-devel] [PATCH 15/16] update binfmt conf, Riku, 2010/12/03
- [Qemu-devel] [PATCH 01/16] [PATCH] target-arm: remove unused functions cpu_lock(), cpu_unlock(), Riku, 2010/12/03
- [Qemu-devel] [PATCH 16/16] linux-user: fix mips and ppc to use UID16, Riku, 2010/12/03
- [Qemu-devel] [PATCH 09/16] ARM: Expose vfp_get_fpscr() and vfp_set_fpscr() to C code,
Riku <=
- Re: [Qemu-devel] [PATCH 00/16] linux-user updates, Peter Maydell, 2010/12/03
- Re: [Qemu-devel] [PATCH 00/16] linux-user updates, Edgar E. Iglesias, 2010/12/03