Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Nov 2014 21:34:25 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273989 - head/sys/i386/isa
Message-ID:  <201411022134.sA2LYPxd049587@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Sun Nov  2 21:34:24 2014
New Revision: 273989
URL: https://svnweb.freebsd.org/changeset/base/273989

Log:
  MFamd64: Explicitly initialize the mxcsr during npxinit().

Modified:
  head/sys/i386/isa/npx.c

Modified: head/sys/i386/isa/npx.c
==============================================================================
--- head/sys/i386/isa/npx.c	Sun Nov  2 20:57:19 2014	(r273988)
+++ head/sys/i386/isa/npx.c	Sun Nov  2 21:34:24 2014	(r273989)
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/syslog.h>
 #endif
 #include <sys/signalvar.h>
+#include <vm/uma.h>
 
 #include <machine/asmacros.h>
 #include <machine/cputypes.h>
@@ -99,6 +100,7 @@ __FBSDID("$FreeBSD$");
 #ifdef CPU_ENABLE_SSE
 #define	fxrstor(addr)		__asm __volatile("fxrstor %0" : : "m" (*(addr)))
 #define	fxsave(addr)		__asm __volatile("fxsave %0" : "=m" (*(addr)))
+#define	ldmxcsr(csr)		__asm __volatile("ldmxcsr %0" : : "m" (csr))
 #define	stmxcsr(addr)		__asm __volatile("stmxcsr %0" : : "m" (*(addr)))
 #endif
 #else	/* !(__GNUCLIKE_ASM && !lint) */
@@ -114,6 +116,7 @@ void	frstor(caddr_t addr);
 #ifdef CPU_ENABLE_SSE
 void	fxsave(caddr_t addr);
 void	fxrstor(caddr_t addr);
+void	ldmxcsr(u_int csr);
 void	stmxcsr(u_int *csr);
 #endif
 
@@ -364,6 +367,12 @@ npxinit(void)
 #endif
 	control = __INITIAL_NPXCW__;
 	fldcw(control);
+#ifdef CPU_ENABLE_SSE
+	if (cpu_fxsr) {
+		mxcsr = __INITIAL_MXCSR__;
+		ldmxcsr(mxcsr);
+	}
+#endif
 	start_emulating();
 	intr_restore(saveintr);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411022134.sA2LYPxd049587>