Author: nwhitehorn
Date: Sat Mar  3 02:04:40 2018
New Revision: 330305
URL: https://svnweb.freebsd.org/changeset/base/330305

Log:
  Remove assumption that all physical memory is available to the kernel and
  that the physical and available memory arrays are interchangeable.

Modified:
  head/sys/powerpc/powerpc/platform.c
  head/sys/powerpc/ps3/ps3bus.c

Modified: head/sys/powerpc/powerpc/platform.c
==============================================================================
--- head/sys/powerpc/powerpc/platform.c Sat Mar  3 01:53:51 2018        
(r330304)
+++ head/sys/powerpc/powerpc/platform.c Sat Mar  3 02:04:40 2018        
(r330305)
@@ -156,10 +156,14 @@ mem_regions(struct mem_region **phys, int *physsz, str
                }
        }
 
-       *phys = pregions;
-       *avail = aregions;
-       *physsz = npregions;
-       *availsz = naregions;
+       if (phys != NULL)
+               *phys = pregions;
+       if (avail != NULL)
+               *avail = aregions;
+       if (physsz != NULL)
+               *physsz = npregions;
+       if (availsz != NULL)
+               *availsz = naregions;
 }
 
 int

Modified: head/sys/powerpc/ps3/ps3bus.c
==============================================================================
--- head/sys/powerpc/ps3/ps3bus.c       Sat Mar  3 01:53:51 2018        
(r330304)
+++ head/sys/powerpc/ps3/ps3bus.c       Sat Mar  3 02:04:40 2018        
(r330305)
@@ -337,7 +337,7 @@ ps3bus_attach(device_t self) 
        rman_manage_region(&sc->sc_intr_rman, 0, ~0);
 
        /* Get memory regions for DMA */
-       mem_regions(&sc->regions, &sc->rcount, &sc->regions, &sc->rcount);
+       mem_regions(&sc->regions, &sc->rcount, NULL, NULL);
 
        /*
         * Probe all the PS3's buses.
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to