diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2015-04-28 06:12:37 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2015-04-28 06:12:37 +0000 |
commit | 5caa65ca2d4b148fcc70a8992711404445bb5e52 (patch) | |
tree | 90c664e4d1fb8fc6570553011e4f25c073ac89c9 /sys/x86 | |
parent | 9e2a7dccfe3f218f41981873314604d26734e00d (diff) | |
download | src-5caa65ca2d4b148fcc70a8992711404445bb5e52.tar.gz src-5caa65ca2d4b148fcc70a8992711404445bb5e52.zip |
The add_bounce_page() function can be called when loading physical
pages which pass a NULL virtual address. If the BUS_DMA_KEEP_PG_OFFSET
flag is set, use the physical address to compute the page offset
instead. The physical address should always be valid when adding
bounce pages and should contain the same page offset like the virtual
address.
Submitted by: Svatopluk Kraus <onwahe@gmail.com>
MFC after: 1 week
Reviewed by: jhb@
Notes
Notes:
svn path=/head/; revision=282120
Diffstat (limited to 'sys/x86')
-rw-r--r-- | sys/x86/x86/busdma_bounce.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/x86/x86/busdma_bounce.c b/sys/x86/x86/busdma_bounce.c index 1438053ccc58..f5c1b926a97a 100644 --- a/sys/x86/x86/busdma_bounce.c +++ b/sys/x86/x86/busdma_bounce.c @@ -994,8 +994,8 @@ add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { /* Page offset needs to be preserved. */ - bpage->vaddr |= vaddr & PAGE_MASK; - bpage->busaddr |= vaddr & PAGE_MASK; + bpage->vaddr |= addr & PAGE_MASK; + bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; bpage->dataaddr = addr; |