summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2007-05-29 06:30:26 +0000
committeryongari <yongari@FreeBSD.org>2007-05-29 06:30:26 +0000
commitf53195d29a8fff7695e0e7ba6e882a43ec827056 (patch)
tree334f9ee040f34f0db530b0d463e04521ea658fb8 /sys/i386
parentcfa8629c4850a5bd7d8ca034dd43c16a6e542ab2 (diff)
downloadFreeBSD-src-f53195d29a8fff7695e0e7ba6e882a43ec827056.zip
FreeBSD-src-f53195d29a8fff7695e0e7ba6e882a43ec827056.tar.gz
Honor maxsegsz of less than a page size in a DMA tag. Previously it
used to return PAGE_SIZE without respect to restrictions of a DMA tag. This affected all of the busdma load functions that use _bus_dmamap_loader_buffer() as their back-end. Reviewed by: scottl
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/busdma_machdep.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/i386/i386/busdma_machdep.c b/sys/i386/i386/busdma_machdep.c
index 813e9ca..5d7c9cd 100644
--- a/sys/i386/i386/busdma_machdep.c
+++ b/sys/i386/i386/busdma_machdep.c
@@ -674,6 +674,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat,
* Compute the segment size, and adjust counts.
*/
sgsize = PAGE_SIZE - ((u_long)curaddr & PAGE_MASK);
+ if (sgsize > dmat->maxsegsz)
+ sgsize = dmat->maxsegsz;
if (buflen < sgsize)
sgsize = buflen;
OpenPOWER on IntegriCloud