Module Name:    src
Committed By:   chs
Date:           Thu Dec  8 15:35:35 UTC 2011

Modified Files:
        src/sys/arch/x86/x86: pmap.c

Log Message:
allow building without direct-map support in non-XEN kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/sys/arch/x86/x86/pmap.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/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.144 src/sys/arch/x86/x86/pmap.c:1.145
--- src/sys/arch/x86/x86/pmap.c:1.144	Wed Dec  7 15:47:42 2011
+++ src/sys/arch/x86/x86/pmap.c	Thu Dec  8 15:35:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.144 2011/12/07 15:47:42 cegger Exp $	*/
+/*	$NetBSD: pmap.c,v 1.145 2011/12/08 15:35:34 chs Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.144 2011/12/07 15:47:42 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.145 2011/12/08 15:35:34 chs Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -1598,7 +1598,14 @@ pmap_prealloc_lowmem_ptps(void)
 	for (;;) {
 		newp = avail_start;
 		avail_start += PAGE_SIZE;
+#ifdef __HAVE_DIRECT_MAP
 		memset((void *)PMAP_DIRECT_MAP(newp), 0, PAGE_SIZE);
+#else
+		pmap_pte_set(early_zero_pte, (newp & PG_FRAME) | PG_V | PG_RW);
+		pmap_pte_flush();
+		pmap_update_pg((vaddr_t)early_zerop);
+		memset(early_zerop, 0, PAGE_SIZE);
+#endif
 		pdes[pl_i(0, level)] = (newp & PG_FRAME) | PG_V | PG_RW;
 		level--;
 		if (level <= 1)

Reply via email to