Module: xenomai-gch
Branch: for-forge
Commit: d63ca76f68c93c8e33d93e75c6ca9724853096a6
URL:    
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=d63ca76f68c93c8e33d93e75c6ca9724853096a6

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Thu May 10 01:17:32 2012 +0200

hal/arm: support backport of linux 3.2 VFP fixes

---

 include/asm-arm/hal.h           |    8 +++++++-
 include/asm-arm/wrappers.h      |    2 +-
 kernel/cobalt/arch/arm/switch.S |    3 ++-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h
index 1553435..a556bdb 100644
--- a/include/asm-arm/hal.h
+++ b/include/asm-arm/hal.h
@@ -227,6 +227,10 @@ static inline void rthal_init_fpu(rthal_fpenv_t *fpuenv)
        /* vfpstate has already been zeroed by xnarch_init_fpu */
        fpuenv->vfpstate.hard.fpexc = FPEXC_EN;
        fpuenv->vfpstate.hard.fpscr = FPSCR_ROUND_NEAREST;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) \
+     || defined(CONFIG_VFP_3_2_BACKPORT)) && defined(CONFIG_SMP)
+       fpuenv->vfpstate.hard.cpu = NR_CPUS;
+#endif /* linux >= 3.2.0 */
 #endif
 }
 
@@ -280,7 +284,8 @@ static inline rthal_fpenv_t *rthal_get_fpu_owner(void)
        if (!vfp_owner)
                return NULL;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) && defined(CONFIG_SMP)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) \
+     || defined(CONFIG_VFP_3_2_BACKPORT)) && defined(CONFIG_SMP)
        if (vfp_owner->hard.cpu != cpu)
                return NULL;
 #endif /* linux >= 3.2.0 */
@@ -301,6 +306,7 @@ static inline rthal_fpenv_t *rthal_get_fpu_owner(void)
                _fpexc;                                                 \
        })
 
+
 #else /* !CONFIG_VFP */
 static inline void rthal_save_fpu(rthal_fpenv_t *fpuenv)
 {
diff --git a/include/asm-arm/wrappers.h b/include/asm-arm/wrappers.h
index 0a89a03..debf745 100644
--- a/include/asm-arm/wrappers.h
+++ b/include/asm-arm/wrappers.h
@@ -33,7 +33,7 @@
 #define __put_user_inatomic __put_user
 #define __get_user_inatomic __get_user
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0) && 
!defined(CONFIG_VFP_3_2_BACKPORT)
 #define vfp_current_hw_state last_VFP_context
 #endif /* Linux < 3.1 */
 
diff --git a/kernel/cobalt/arch/arm/switch.S b/kernel/cobalt/arch/arm/switch.S
index 243ee7f..83f4746 100644
--- a/kernel/cobalt/arch/arm/switch.S
+++ b/kernel/cobalt/arch/arm/switch.S
@@ -100,7 +100,8 @@ ENTRY(rthal_vfp_save)
  * r1 = current cpu
  */
 ENTRY(rthal_vfp_load)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) && defined(CONFIG_SMP)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) \
+       || defined(CONFIG_VFP_3_2_BACKPORT)) && defined(CONFIG_SMP)
     str        r1, [r0, #VFP_CPU]
 #endif
     VFPFLDMIA  r0, r2                  @ reload the working registers while


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to