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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Aug  5 14:05:22 2009 +0200

powerpc: reinstate FE0/FE1 depending on the per-task fpexc_mode

---

 include/asm-powerpc/bits/pod.h |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/include/asm-powerpc/bits/pod.h b/include/asm-powerpc/bits/pod.h
index 3265453..d0c2bb4 100644
--- a/include/asm-powerpc/bits/pod.h
+++ b/include/asm-powerpc/bits/pod.h
@@ -225,15 +225,23 @@ static void xnarch_save_fpu(xnarchtcb_t * tcb)
 static void xnarch_restore_fpu(xnarchtcb_t * tcb)
 {
 #ifdef CONFIG_XENO_HW_FPU
+       struct thread_struct *ts;
+       struct pt_regs *regs;
+
        if (tcb->fpup) {
                rthal_restore_fpu(tcb->fpup);
                /*
                 * Note: Only enable FP in MSR, if it was enabled when
                 * we saved the fpu state.
                 */
-               if (tcb->user_fpu_owner &&
-                   tcb->user_fpu_owner->thread.regs)
-                       tcb->user_fpu_owner->thread.regs->msr |= 
(MSR_FP|MSR_FE0|MSR_FE1);
+               if (tcb->user_fpu_owner) {
+                       ts = &tcb->user_fpu_owner->thread;
+                       regs = ts->regs;
+                       if (regs) {
+                               regs->msr &= ~(MSR_FE0|MSR_FE1);
+                               regs->msr |= (MSR_FP|ts->fpexc_mode);
+                       }
+               }
        }
        /*
         * FIXME: We restore FPU "as it was" when Xenomai preempted Linux,


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

Reply via email to