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

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Tue Jun  4 07:46:15 2013 +0200

hal/x86: fix kernel-space FPU with old cpus

Only use the "ldmxcsr" instruction on cpus with SSE.

---

 include/asm-x86/bits/pod.h |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/asm-x86/bits/pod.h b/include/asm-x86/bits/pod.h
index ca497be..a32575f 100644
--- a/include/asm-x86/bits/pod.h
+++ b/include/asm-x86/bits/pod.h
@@ -209,13 +209,15 @@ static inline void xnarch_init_thread(xnarchtcb_t *tcb,
 static inline void xnarch_init_fpu(xnarchtcb_t * tcb)
 {
        struct task_struct *task = tcb->user_task;
-       unsigned long __mxcsr;
        /* Initialize the FPU for a task. This must be run on behalf of the
           task. */
 
        __asm__ __volatile__("clts; fninit");
-       __mxcsr = 0x1f80UL & 0xffbfUL;
-       __asm__ __volatile__("ldmxcsr %0"::"m"(__mxcsr));
+       if (cpu_has_xmm) {
+               unsigned long __mxcsr;
+               __mxcsr = 0x1f80UL & 0xffbfUL;
+               __asm__ __volatile__("ldmxcsr %0"::"m"(__mxcsr));
+       }
 
        if (task) {
                /* Real-time shadow FPU initialization: tell Linux


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

Reply via email to