amd64: Fix booting on machines with large ammounts of RAM.
authorJordan Gordeev <jgordeev@dir.bg>
Fri, 5 Jun 2009 18:43:14 +0000 (21:43 +0300)
committerJordan Gordeev <jgordeev@dir.bg>
Fri, 5 Jun 2009 18:58:19 +0000 (21:58 +0300)
sys/platform/pc64/amd64/pmap.c
sys/vm/vm_page.c

index d139d1f..6b3cdcc 100644 (file)
@@ -1132,18 +1132,9 @@ READY1
  */
 vm_offset_t
 pmap_map(vm_offset_t virt, vm_paddr_t start, vm_paddr_t end, int prot)
-READY1
+READY3
 {
-       /*
-        * JG Are callers prepared to get an address in the DMAP,
-        * instead of the passed-in virt?
-        */
-       while (start < end) {
-               pmap_kenter(virt, start);
-               virt += PAGE_SIZE;
-               start += PAGE_SIZE;
-       }
-       return (virt);
+       return PHYS_TO_DMAP(start);
 }
 
 
index 3450362..7f5d217 100644 (file)
@@ -262,6 +262,11 @@ vm_page_startup(vm_offset_t vaddr)
        new_end = trunc_page(end - page_range * sizeof(struct vm_page));
        mapped = pmap_map(mapped, new_end, end,
            VM_PROT_READ | VM_PROT_WRITE);
+#ifdef __amd64__
+       /* pmap_map() returns an address in the DMAP region */
+       vm_page_array = (vm_page_t) mapped;
+       mapped = vaddr;
+#endif
 
        /*
         * Clear all of the page structures