[Xenomai-git] Philippe Gerum : powerpc: reinstate FE0/ FE1 depending on the per-task fpexc_mode

2009-08-06 Thread GIT version control
Module: xenomai-2.4
Branch: master
Commit: 02aef56415fef4ccc4b40ba15759efbe95e1271b
URL:
http://git.xenomai.org/?p=xenomai-2.4.git;a=commit;h=02aef56415fef4ccc4b40ba15759efbe95e1271b

Author: Philippe Gerum 
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 495ff0b..359d980 100644
--- a/include/asm-powerpc/bits/pod.h
+++ b/include/asm-powerpc/bits/pod.h
@@ -236,15 +236,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


[Xenomai-git] Philippe Gerum : powerpc: reinstate FE0/ FE1 depending on the per-task fpexc_mode

2009-08-06 Thread GIT version control
Module: xenomai-head
Branch: master
Commit: e4d94fed59df7f1bd6b2e7017c4e3380aafd7e63
URL:
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=e4d94fed59df7f1bd6b2e7017c4e3380aafd7e63

Author: Philippe Gerum 
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