Author: alc
Date: Sat Nov 22 17:46:30 2014
New Revision: 274867
URL: https://svnweb.freebsd.org/changeset/base/274867

Log:
  By the time that vm_reserv_init() runs, vm_phys_segs[] is initialized.  Use
  it instead of phys_avail[].
  
  Discussed with:       Svatopluk Kraus

Modified:
  head/sys/vm/vm_reserv.c

Modified: head/sys/vm/vm_reserv.c
==============================================================================
--- head/sys/vm/vm_reserv.c     Sat Nov 22 17:39:39 2014        (r274866)
+++ head/sys/vm/vm_reserv.c     Sat Nov 22 17:46:30 2014        (r274867)
@@ -818,15 +818,17 @@ void
 vm_reserv_init(void)
 {
        vm_paddr_t paddr;
-       int i;
+       struct vm_phys_seg *seg;
+       int segind;
 
        /*
         * Initialize the reservation array.  Specifically, initialize the
         * "pages" field for every element that has an underlying superpage.
         */
-       for (i = 0; phys_avail[i + 1] != 0; i += 2) {
-               paddr = roundup2(phys_avail[i], VM_LEVEL_0_SIZE);
-               while (paddr + VM_LEVEL_0_SIZE <= phys_avail[i + 1]) {
+       for (segind = 0; segind < vm_phys_nsegs; segind++) {
+               seg = &vm_phys_segs[segind];
+               paddr = roundup2(seg->start, VM_LEVEL_0_SIZE);
+               while (paddr + VM_LEVEL_0_SIZE <= seg->end) {
                        vm_reserv_array[paddr >> VM_LEVEL_0_SHIFT].pages =
                            PHYS_TO_VM_PAGE(paddr);
                        paddr += VM_LEVEL_0_SIZE;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to