Module Name:    src
Committed By:   kamil
Date:           Thu Nov 23 16:30:50 UTC 2017

Modified Files:
        src/sys/arch/x86/include: cpu.h
        src/sys/arch/x86/x86: x86_machdep.c

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/x86/x86/x86_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/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.80 src/sys/arch/x86/include/cpu.h:1.81
--- src/sys/arch/x86/include/cpu.h:1.80	Mon Oct  9 17:49:27 2017
+++ src/sys/arch/x86/include/cpu.h	Thu Nov 23 16:30:50 2017
@@ -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 char cpu_brand_string[];
 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

Index: src/sys/arch/x86/x86/x86_machdep.c
diff -u src/sys/arch/x86/x86/x86_machdep.c:1.101 src/sys/arch/x86/x86/x86_machdep.c:1.102
--- src/sys/arch/x86/x86/x86_machdep.c:1.101	Sun Oct 29 10:01:21 2017
+++ src/sys/arch/x86/x86/x86_machdep.c	Thu Nov 23 16:30:50 2017
@@ -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 @@ SYSCTL_SETUP(sysctl_machdep_setup, "sysc
 #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,

Reply via email to