Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux/arch/powerpc Adapt to new PCU based FPU code.



details:   https://anonhg.NetBSD.org/src/rev/f8f9295d8a14
branches:  trunk
changeset: 764810:f8f9295d8a14
user:      matt <matt%NetBSD.org@localhost>
date:      Thu May 05 16:20:55 2011 +0000

description:
Adapt to new PCU based FPU code.

diffstat:

 sys/compat/linux/arch/powerpc/linux_machdep.c |  20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diffs (63 lines):

diff -r e52af5b482bf -r f8f9295d8a14 sys/compat/linux/arch/powerpc/linux_machdep.c
--- a/sys/compat/linux/arch/powerpc/linux_machdep.c     Thu May 05 13:44:35 2011 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_machdep.c     Thu May 05 16:20:55 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_machdep.c,v 1.45 2011/01/20 11:59:24 he Exp $ */
+/*     $NetBSD: linux_machdep.c,v 1.46 2011/05/05 16:20:55 matt Exp $ */
 
 /*-
  * Copyright (c) 1995, 2000, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.45 2011/01/20 11:59:24 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.46 2011/05/05 16:20:55 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -181,7 +181,9 @@
        memset(&frame, 0, sizeof(frame));
        memcpy(&frame.lgp_regs, &linux_regs, sizeof(linux_regs));
 
-       fpu_save_lwp(curlwp, FPU_SAVE);
+#ifdef PPC_HAVE_FPU
+       fpu_save();
+#endif
        memcpy(&frame.lfp_regs, curpcb->pcb_fpu.fpreg, sizeof(frame.lfp_regs));
 
        /*
@@ -319,11 +321,15 @@
        /*
         * Make sure the fpu state is discarded
         */
-       fpu_save_lwp(curlwp, FPU_DISCARD);
+#ifdef PPC_HAVE_FPU
+       fpu_discard();
+#endif
 
        memcpy(curpcb->pcb_fpu.fpreg, (void *)&sregs.lfp_regs,
               sizeof(curpcb->pcb_fpu.fpreg));
 
+       fpu_mark_used(curlwp);
+
        mutex_enter(p->p_lock);
 
        /*
@@ -409,11 +415,15 @@
        /*
         * Make sure the fpu state is discarded
         */
-       fpu_save_lwp(curlwp, FPU_DISCARD);
+#ifdef PPC_HAVE_FPU
+       fpu_discard();
+#endif
 
        memcpy(curpcb->pcb_fpu.fpreg, (void *)&sregs.lfp_regs,
               sizeof(curpcb->pcb_fpu.fpreg));
 
+       fpu_mark_used(curlwp);
+
        mutex_enter(p->p_lock);
 
        /*



Home | Main Index | Thread Index | Old Index