]> git.proxmox.com Git - qemu.git/commitdiff
ARM: Expose vfp_get_fpscr() and vfp_set_fpscr() to C code
authorPeter Maydell <peter.maydell@linaro.org>
Wed, 24 Nov 2010 15:20:04 +0000 (15:20 +0000)
committerRiku Voipio <riku.voipio@nokia.com>
Fri, 3 Dec 2010 13:09:39 +0000 (15:09 +0200)
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 <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
target-arm/cpu.h
target-arm/helper.c

index 0284bad0f932c4bc51840aed25e5b21fc31501c2..340933ef505ffcc95b5172380c0e5c6089621d0c 100644 (file)
@@ -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,
index 94aef393e2c881455d8eab2fe9e260370799daa9..2a1f44860bfcc78fbf71c61e6facdec6b12802cf 100644 (file)
@@ -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) \