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 Add comments over fpu_kern_enter/leave.



details:   https://anonhg.NetBSD.org/src/rev/74f77c303841
branches:  trunk
changeset: 972920:74f77c303841
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Jun 13 19:01:11 2020 +0000

description:
Add comments over fpu_kern_enter/leave.

diffstat:

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

diffs (46 lines):

diff -r 22ba0d088b01 -r 74f77c303841 sys/arch/x86/x86/fpu.c
--- a/sys/arch/x86/x86/fpu.c    Sat Jun 13 19:00:18 2020 +0000
+++ b/sys/arch/x86/x86/fpu.c    Sat Jun 13 19:01:11 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu.c,v 1.63 2020/06/13 19:00:18 riastradh Exp $       */
+/*     $NetBSD: fpu.c,v 1.64 2020/06/13 19:01:11 riastradh Exp $       */
 
 /*
  * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc.  All
@@ -96,7 +96,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.63 2020/06/13 19:00:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.64 2020/06/13 19:01:11 riastradh Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -343,6 +343,15 @@
 
 /* -------------------------------------------------------------------------- */
 
+/*
+ * fpu_kern_enter()
+ *
+ *     Begin using the FPU.  Raises to splhigh, disabling all
+ *     interrupts and rendering the thread non-preemptible; caller
+ *     should not use this for long periods of time, and must call
+ *     fpu_kern_leave() afterward.  Non-recursive -- you cannot call
+ *     fpu_kern_enter() again without calling fpu_kern_leave() first.
+ */
 void
 fpu_kern_enter(void)
 {
@@ -375,6 +384,11 @@
        clts();
 }
 
+/*
+ * fpu_kern_leave()
+ *
+ *     End using the FPU after fpu_kern_enter().
+ */
 void
 fpu_kern_leave(void)
 {



Home | Main Index | Thread Index | Old Index