Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 allow building without direct-map support i...



details:   https://anonhg.NetBSD.org/src/rev/160c4a21c926
branches:  trunk
changeset: 771916:160c4a21c926
user:      chs <chs%NetBSD.org@localhost>
date:      Thu Dec 08 15:35:34 2011 +0000

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

diffstat:

 sys/arch/x86/x86/pmap.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r 6200916d007d -r 160c4a21c926 sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c   Thu Dec 08 11:01:59 2011 +0000
+++ b/sys/arch/x86/x86/pmap.c   Thu Dec 08 15:35:34 2011 +0000
@@ -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 @@
        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)



Home | Main Index | Thread Index | Old Index