Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc/powerpc Don't reload the FPU register if th...
details: https://anonhg.NetBSD.org/src/rev/fe26378ade80
branches: trunk
changeset: 809361:fe26378ade80
user: matt <matt%NetBSD.org@localhost>
date: Mon Jul 06 01:55:50 2015 +0000
description:
Don't reload the FPU register if this is just a re-enable.
diffstat:
sys/arch/powerpc/powerpc/fpu.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diffs (43 lines):
diff -r 999fbad5721e -r fe26378ade80 sys/arch/powerpc/powerpc/fpu.c
--- a/sys/arch/powerpc/powerpc/fpu.c Mon Jul 06 00:21:51 2015 +0000
+++ b/sys/arch/powerpc/powerpc/fpu.c Mon Jul 06 01:55:50 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fpu.c,v 1.35 2014/05/16 00:48:41 rmind Exp $ */
+/* $NetBSD: fpu.c,v 1.36 2015/07/06 01:55:50 matt Exp $ */
/*
* Copyright (C) 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.35 2014/05/16 00:48:41 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.36 2015/07/06 01:55:50 matt Exp $");
#include "opt_multiprocessor.h"
@@ -84,15 +84,17 @@
memset(&pcb->pcb_fpu, 0, sizeof(pcb->pcb_fpu));
}
- const register_t msr = mfmsr();
- mtmsr((msr & ~PSL_EE) | PSL_FP);
- __asm volatile ("isync");
+ if ((flags & PCU_REENABLE) == 0) {
+ const register_t msr = mfmsr();
+ mtmsr((msr & ~PSL_EE) | PSL_FP);
+ __asm volatile ("isync");
- fpu_load_from_fpreg(&pcb->pcb_fpu);
- __asm volatile ("sync");
+ fpu_load_from_fpreg(&pcb->pcb_fpu);
+ __asm volatile ("sync");
- mtmsr(msr);
- __asm volatile ("isync");
+ mtmsr(msr);
+ __asm volatile ("isync");
+ }
curcpu()->ci_ev_fpusw.ev_count++;
l->l_md.md_utf->tf_srr1 |= PSL_FP|(pcb->pcb_flags & (PCB_FE0|PCB_FE1));
Home |
Main Index |
Thread Index |
Old Index