Module Name:    src
Committed By:   maxv
Date:           Sat May 14 09:51:56 UTC 2016

Modified Files:
        src/sys/arch/i386/i386: locore.S

Log Message:
Actually, put the NOX identification above. Old CPUs do not support the
cpuid instruction.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/i386/i386/locore.S

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/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.121 src/sys/arch/i386/i386/locore.S:1.122
--- src/sys/arch/i386/i386/locore.S:1.121	Sat May 14 08:49:16 2016
+++ src/sys/arch/i386/i386/locore.S	Sat May 14 09:51:56 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.121 2016/05/14 08:49:16 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.122 2016/05/14 09:51:56 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -128,7 +128,7 @@
  */
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.121 2016/05/14 08:49:16 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.122 2016/05/14 09:51:56 maxv Exp $");
 
 #include "opt_compat_oldboot.h"
 #include "opt_copy_symtab.h"
@@ -555,6 +555,16 @@ try586:	/* Use the `cpuid' instruction. 
 	cpuid
 	movl	%eax,RELOC(cpuid_level)
 
+	/*
+	 * Retrieve the NX/XD flag. We use the 32bit version of PG_NX.
+	 */
+	movl	$0x80000001,%eax
+	cpuid
+	andl	$CPUID_NOX,%edx
+	jz	no_NOX
+	movl	$PG_NX32,RELOC(nox_flag)
+no_NOX:
+
 2:
 	/*
 	 * Finished with old stack; load new %esp now instead of later so we
@@ -571,16 +581,6 @@ try586:	/* Use the `cpuid' instruction. 
 	 */
 	movl	$_RELOC(tmpstk),%esp
 
-	/*
-	 * Retrieve the NX/XD flag. We use the 32bit version of PG_NX.
-	 */
-	movl	$0x80000001,%eax
-	cpuid
-	andl	$CPUID_NOX,%edx
-	jz	no_NOX
-	movl	$PG_NX32,RELOC(nox_flag)
-no_NOX:
-
 /*
  * There are two different layouts possible, depending on whether PAE is
  * enabled or not.

Reply via email to