PERFORCE change 135959 for review

Randall R. Stewart rrs at FreeBSD.org
Fri Feb 22 14:01:33 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=135959

Change 135959 by rrs at rrs-mips2-jnpr on 2008/02/22 14:01:03

	Force a proper phys location for the memory being grabbed

Affected files ...

.. //depot/projects/mips2-jnpr/src/sys/mips/mips/busdma_machdep.c#3 edit

Differences ...

==== //depot/projects/mips2-jnpr/src/sys/mips/mips/busdma_machdep.c#3 (text+ko) ====

@@ -434,8 +434,22 @@
                  *     and handles multi-seg allocations.  Nobody is doing
                  *     multi-seg allocations yet though.
                  */
+	         vm_paddr_t maxphys;
+	         if((uint32_t)dmat->lowaddr >= MIPS_KSEG0_LARGEST_PHYS) {
+		   /* Note in the else case I just put in what was already
+		    * being passed in dmat->lowaddr. I am not sure
+		    * how this would have worked. Since lowaddr is in the
+		    * max address postion. I would have thought that the
+		    * caller would have wanted dmat->highaddr. That is
+		    * presuming they are asking for physical addresses
+		    * which is what contigmalloc takes. - RRS
+		    */
+		   maxphys = MIPS_KSEG0_LARGEST_PHYS - 1;
+		 } else {
+		   maxphys = dmat->lowaddr;
+		 }
                 *vaddr = contigmalloc(dmat->maxsize, M_DEVBUF, mflags,
-                    0ul, dmat->lowaddr, dmat->alignment? dmat->alignment : 1ul,
+                    0ul, maxphys, dmat->alignment? dmat->alignment : 1ul,
                     dmat->boundary);
         }
         if (*vaddr == NULL) {


More information about the p4-projects mailing list