Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/arch/i386/i386 pullup 1.26->1.27 (thorpej): fix the...



details:   https://anonhg.NetBSD.org/src/rev/79a04fc19b93
branches:  netbsd-1-4
changeset: 468713:79a04fc19b93
user:      perry <perry%NetBSD.org@localhost>
date:      Fri Jun 18 16:57:15 1999 +0000

description:
pullup 1.26->1.27 (thorpej): fix the 1G RAM bug

diffstat:

 sys/arch/i386/i386/pmap.new.c |  24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diffs (59 lines):

diff -r e529e0f1208e -r 79a04fc19b93 sys/arch/i386/i386/pmap.new.c
--- a/sys/arch/i386/i386/pmap.new.c     Fri Jun 18 16:51:43 1999 +0000
+++ b/sys/arch/i386/i386/pmap.new.c     Fri Jun 18 16:57:15 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.new.c,v 1.23.2.2 1999/05/05 17:05:44 perry Exp $  */
+/*     $NetBSD: pmap.new.c,v 1.23.2.3 1999/06/18 16:57:15 perry Exp $  */
 
 /*
  *
@@ -3535,7 +3535,7 @@
  *     the pmaps on the system.
  */
 
-void pmap_growkernel(maxkvaddr)
+vaddr_t pmap_growkernel(maxkvaddr)
 
 vaddr_t maxkvaddr;
 
@@ -3546,7 +3546,7 @@
 
   needed_kpde = (int)(maxkvaddr - VM_MIN_KERNEL_ADDRESS + (NBPD-1)) / NBPD;
   if (needed_kpde <= nkpde)
-    return;            /* we are OK */
+    goto out;          /* we are OK */
 
   /*
    * whoops!   we need to add kernel PTPs
@@ -3557,6 +3557,21 @@
 
   for (/*null*/ ; nkpde < needed_kpde ; nkpde++) {
 
+    if (pmap_initialized == FALSE) {
+      /*
+       * we're growing the kernel pmap early (from uvm_pageboot_alloc()).
+       * this case must be handled a little differently.
+       */
+      paddr_t ptaddr;
+
+      if (uvm_page_physget(&ptaddr) == FALSE)
+       panic("pmap_growkernel: out of memory");
+
+      kpm->pm_pdir[PDSLOT_KERN + nkpde] = ptaddr | PG_RW | PG_V;
+      kpm->pm_stats.resident_count++;  /* count PTP as resident */
+      continue;
+    }
+
     pmap_alloc_ptp(kpm, PDSLOT_KERN + nkpde, FALSE);
     kpm->pm_pdir[PDSLOT_KERN + nkpde] &= ~PG_u; /* PG_u not for kernel */
 
@@ -3570,6 +3585,9 @@
 
   simple_unlock(&kpm->pm_obj.vmobjlock);
   splx(s);
+
+ out:
+  return (VM_MIN_KERNEL_ADDRESS + (nkpde * NBPD));
 }
 
 #ifdef DEBUG



Home | Main Index | Thread Index | Old Index