diff options
author | Pyun YongHyeon <yongari@FreeBSD.org> | 2007-05-29 06:30:26 +0000 |
---|---|---|
committer | Pyun YongHyeon <yongari@FreeBSD.org> | 2007-05-29 06:30:26 +0000 |
commit | 590f73f72e4faec36d0faaa132c4d627f6cd68f6 (patch) | |
tree | 334f9ee040f34f0db530b0d463e04521ea658fb8 /sys/sparc64 | |
parent | 95f0e983b6dbce0a7d7b63f0fb64ec66a5a9a293 (diff) | |
download | src-590f73f72e4faec36d0faaa132c4d627f6cd68f6.tar.gz src-590f73f72e4faec36d0faaa132c4d627f6cd68f6.zip |
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
Notes
Notes:
svn path=/head/; revision=170086
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/sparc64/bus_machdep.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/sparc64/sparc64/bus_machdep.c b/sys/sparc64/sparc64/bus_machdep.c index 165e3507000e..0d1e926374d8 100644 --- a/sys/sparc64/sparc64/bus_machdep.c +++ b/sys/sparc64/sparc64/bus_machdep.c @@ -372,6 +372,8 @@ _nexus_dmamap_load_buffer(bus_dma_tag_t dmat, void *buf, bus_size_t buflen, * Compute the segment size, and adjust counts. */ sgsize = PAGE_SIZE - ((u_long)curaddr & PAGE_MASK); + if (sgsize > dmat->dt_maxsegsz) + sgsize = dmat->dt_maxsegsz; if (buflen < sgsize) sgsize = buflen; |