Module: xenomai-2.6
Branch: master
Commit: 1a035845a86d705b472b1bb7e72c5f5e682e69fe
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=1a035845a86d705b472b1bb7e72c5f5e682e69fe

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sat May 25 20:24:24 2013 +0200

hal/x86: fix compilation issues with old kernels

---

 include/asm-x86/bits/pod.h    |   14 +++++++-------
 include/asm-x86/wrappers_32.h |    5 +++++
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/include/asm-x86/bits/pod.h b/include/asm-x86/bits/pod.h
index 90e36f0..ca497be 100644
--- a/include/asm-x86/bits/pod.h
+++ b/include/asm-x86/bits/pod.h
@@ -73,7 +73,7 @@ static inline void xnarch_switch_to(xnarchtcb_t *out_tcb, 
xnarchtcb_t *in_tcb)
 {
        struct task_struct *prev = out_tcb->active_task;
        struct task_struct *next = in_tcb->user_task;
-#ifdef CONFIG_X86_32
+#ifndef CONFIG_X86_64
        unsigned long fs, gs;
 #endif
 
@@ -98,7 +98,7 @@ static inline void xnarch_switch_to(xnarchtcb_t *out_tcb, 
xnarchtcb_t *in_tcb)
                struct mm_struct *oldmm = prev->active_mm;
                wrap_switch_mm(oldmm, next->active_mm, next);
                if (next->mm == NULL)
-                       enter_lazy_tlb(oldmm, next);
+                       wrap_enter_lazy_tlb(oldmm, next);
        }
 
 #ifdef CONFIG_CC_STACKPROTECTOR
@@ -107,7 +107,7 @@ static inline void xnarch_switch_to(xnarchtcb_t *out_tcb, 
xnarchtcb_t *in_tcb)
 #define xnarch_switch_canary  0
 #endif
 
-#ifdef CONFIG_X86_32
+#ifndef CONFIG_X86_64
        if (out_tcb->user_task) {
                /* Make sure that __switch_to() will always reload the correct
                   %fs and %gs registers, even if we happen to migrate the task
@@ -239,7 +239,7 @@ static inline void __save_i387(x86_fpustate *fpup)
 {
 #ifdef cpu_has_xsave
        if (cpu_has_xsave) {
-#if defined(CONFIG_AS_AVX) || defined CONFIG_X86_32
+#if defined(CONFIG_AS_AVX) || !defined CONFIG_X86_64
                asm volatile("xsave" XSAVE_SUFFIX " %0"
                             : "=m" (fpup->xsave) : "a" (-1), "d" (-1)
                             : "memory");
@@ -252,7 +252,7 @@ static inline void __save_i387(x86_fpustate *fpup)
                return;
        }
 #endif /* cpu_has_xsave */
-#ifdef CONFIG_X86_32
+#ifndef CONFIG_X86_64
        if (cpu_has_fxsr)
                __asm__ __volatile__("fxsave %0; fnclex":"=m"(*fpup));
        else
@@ -299,7 +299,7 @@ static inline void __restore_i387(x86_fpustate *fpup)
 {
 #ifdef cpu_has_xsave
        if (cpu_has_xsave) {
-#if defined(CONFIG_AS_AVX) || defined CONFIG_X86_32
+#if defined(CONFIG_AS_AVX) || !defined(CONFIG_X86_64)
                asm volatile("xrstor" XSAVE_SUFFIX " %0"
                             : : "m" (fpup->xsave), "a" (-1), "d" (-1)
                             : "memory");
@@ -312,7 +312,7 @@ static inline void __restore_i387(x86_fpustate *fpup)
                return;
        }
 #endif /* cpu_has_xsave */
-#ifdef CONFIG_X86_32
+#ifndef CONFIG_X86_64
        if (cpu_has_fxsr)
                __asm__ __volatile__("fxrstor %0": /* no output */
                                     :"m"(*fpup));
diff --git a/include/asm-x86/wrappers_32.h b/include/asm-x86/wrappers_32.h
index c3d6bdb..2e6b21e 100644
--- a/include/asm-x86/wrappers_32.h
+++ b/include/asm-x86/wrappers_32.h
@@ -29,6 +29,11 @@
 #include <linux/interrupt.h>
 #include <asm/processor.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
+#define tsk_used_math(task)                    ((task)->used_math)
+#define set_stopped_child_used_math(task)      ((task)->used_math = 1)
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 
 #define CONFIG_MMU 1


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to