Module Name: src Committed By: maxv Date: Sat May 14 08:39:42 UTC 2016
Modified Files: src/sys/arch/i386/i386: locore.S Log Message: Define fillkpt_nox on i386, same as amd64. But there is a difference in the way it is done here. If PAE is not enabled, PDE_SIZE = 4, so there is no NOX bit set. If PAE is enabled, PDE_SIZE = 8, so the NOX bit is set. This works exactly as intended, since NOX does not exist in the non-PAE case. To generate a diff of this commit: cvs rdiff -u -r1.119 -r1.120 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.119 src/sys/arch/i386/i386/locore.S:1.120 --- src/sys/arch/i386/i386/locore.S:1.119 Sat May 14 08:34:00 2016 +++ src/sys/arch/i386/i386/locore.S Sat May 14 08:39:41 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.119 2016/05/14 08:34:00 maxv Exp $ */ +/* $NetBSD: locore.S,v 1.120 2016/05/14 08:39:41 maxv Exp $ */ /* * Copyright-o-rama! @@ -128,7 +128,7 @@ */ #include <machine/asm.h> -__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.119 2016/05/14 08:34:00 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.120 2016/05/14 08:39:41 maxv Exp $"); #include "opt_compat_oldboot.h" #include "opt_copy_symtab.h" @@ -200,6 +200,19 @@ __KERNEL_RCSID(0, "$NetBSD: locore.S,v 1 loop 1b ; /* + * fillkpt_nox - Same as fillkpt, but sets the NX/XD bit. + */ +#define fillkpt_nox \ + pushl %ebp ; \ + movl RELOC(nox_flag),%ebp ; \ +1: movl %ebp,(PDE_SIZE-4)(%ebx) ; /* upper 32 bits: NX */ \ + movl %eax,(%ebx) ; /* store phys addr */ \ + addl $PDE_SIZE,%ebx ; /* next PTE/PDE */ \ + addl $PAGE_SIZE,%eax ; /* next phys page */ \ + loop 1b ; \ + popl %ebp ; + +/* * killkpt - Destroy a kernel page table * ebx = page table address * ecx = number of pages to destroy