Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86 Restore removed sysctl(2) x86 entry: fpu_present



details:   https://anonhg.NetBSD.org/src/rev/0f6e910160d6
branches:  trunk
changeset: 828030:0f6e910160d6
user:      kamil <kamil%NetBSD.org@localhost>
date:      Thu Nov 23 16:30:50 2017 +0000

description:
Restore removed sysctl(2) x86 entry: fpu_present

Hardcode it to 1 for now on i386 and amd64.

This unbreaks software that used it (e.g. LLDB).

Removal noted by <christos>

PR lib/52756 by myself

diffstat:

 sys/arch/x86/include/cpu.h     |  4 +++-
 sys/arch/x86/x86/x86_machdep.c |  6 ++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diffs (51 lines):

diff -r 9ff4025c9e72 -r 0f6e910160d6 sys/arch/x86/include/cpu.h
--- a/sys/arch/x86/include/cpu.h        Thu Nov 23 15:48:24 2017 +0000
+++ b/sys/arch/x86/include/cpu.h        Thu Nov 23 16:30:50 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.80 2017/10/09 17:49:27 maya Exp $    */
+/*     $NetBSD: cpu.h,v 1.81 2017/11/23 16:30:50 kamil Exp $   */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -381,12 +381,14 @@
 extern int use_pae;
 
 #ifdef __i386__
+#define        i386_fpu_present        1
 int npx586bug1(int, int);
 extern int i386_fpu_fdivbug;
 extern int i386_use_fxsave;
 extern int i386_has_sse;
 extern int i386_has_sse2;
 #else
+#define        i386_fpu_present        1
 #define        i386_fpu_fdivbug        0
 #define        i386_use_fxsave         1
 #define        i386_has_sse            1
diff -r 9ff4025c9e72 -r 0f6e910160d6 sys/arch/x86/x86/x86_machdep.c
--- a/sys/arch/x86/x86/x86_machdep.c    Thu Nov 23 15:48:24 2017 +0000
+++ b/sys/arch/x86/x86/x86_machdep.c    Thu Nov 23 16:30:50 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: x86_machdep.c,v 1.101 2017/10/29 10:01:21 maxv Exp $   */
+/*     $NetBSD: x86_machdep.c,v 1.102 2017/11/23 16:30:50 kamil Exp $  */
 
 /*-
  * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.101 2017/10/29 10:01:21 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.102 2017/11/23 16:30:50 kamil Exp $");
 
 #include "opt_modular.h"
 #include "opt_physmem.h"
@@ -1256,6 +1256,8 @@
 #endif
 
        /* None of these can ever change once the system has booted */
+       const_sysctl(clog, "fpu_present", CTLTYPE_INT, i386_fpu_present,
+           CPU_FPU_PRESENT);
        const_sysctl(clog, "osfxsr", CTLTYPE_INT, i386_use_fxsave,
            CPU_OSFXSR);
        const_sysctl(clog, "sse", CTLTYPE_INT, i386_has_sse,



Home | Main Index | Thread Index | Old Index