Module Name: src
Committed By: matt
Date: Thu May 5 16:20:56 UTC 2011
Modified Files:
src/sys/compat/linux/arch/powerpc: linux_machdep.c
Log Message:
Adapt to new PCU based FPU code.
To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/linux/arch/powerpc/linux_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/compat/linux/arch/powerpc/linux_machdep.c
diff -u src/sys/compat/linux/arch/powerpc/linux_machdep.c:1.45 src/sys/compat/linux/arch/powerpc/linux_machdep.c:1.46
--- src/sys/compat/linux/arch/powerpc/linux_machdep.c:1.45 Thu Jan 20 11:59:24 2011
+++ src/sys/compat/linux/arch/powerpc/linux_machdep.c Thu May 5 16:20:55 2011
@@ -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);
/*