Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 Actually, don't do anything if we switch to...



details:   https://anonhg.NetBSD.org/src/rev/4dcb75e0f1cd
branches:  trunk
changeset: 833237:4dcb75e0f1cd
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat Jun 16 05:52:17 2018 +0000

description:
Actually, don't do anything if we switch to a kernel thread. When the cpu
switches back to a user thread the fpu is restored, so no point calling
fninit (which doesn't clear all the states anyway).

diffstat:

 sys/arch/x86/x86/fpu.c |  16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)

diffs (44 lines):

diff -r 78ecaf75cff4 -r 4dcb75e0f1cd sys/arch/x86/x86/fpu.c
--- a/sys/arch/x86/x86/fpu.c    Sat Jun 16 01:25:23 2018 +0000
+++ b/sys/arch/x86/x86/fpu.c    Sat Jun 16 05:52:17 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu.c,v 1.34 2018/06/14 18:00:15 maxv Exp $    */
+/*     $NetBSD: fpu.c,v 1.35 2018/06/16 05:52:17 maxv Exp $    */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.  All
@@ -96,7 +96,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.34 2018/06/14 18:00:15 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.35 2018/06/16 05:52:17 maxv Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -333,14 +333,6 @@
 }
 
 static void
-fpu_reset(void)
-{
-       clts();
-       fninit();
-       stts();
-}
-
-static void
 fpu_eagerrestore(struct lwp *l)
 {
        struct pcb *pcb = lwp_getpcb(l);
@@ -359,9 +351,7 @@
 
        s = splhigh();
        fpusave_cpu(true);
-       if (newlwp->l_flag & LW_SYSTEM)
-               fpu_reset();
-       else
+       if (!(newlwp->l_flag & LW_SYSTEM))
                fpu_eagerrestore(newlwp);
        splx(s);
 }



Home | Main Index | Thread Index | Old Index