diff options
author | imp <imp@FreeBSD.org> | 2009-02-08 22:54:58 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2009-02-08 22:54:58 +0000 |
commit | 719ba982f29fc81ee8072f46770b8f92f9cde327 (patch) | |
tree | cc62825b111ed71a6a25b4cf9e56057dd93d0ae4 /sys/arm | |
parent | 9513bac196b9078727e9e71fe300ad749da75966 (diff) | |
download | FreeBSD-src-719ba982f29fc81ee8072f46770b8f92f9cde327.zip FreeBSD-src-719ba982f29fc81ee8072f46770b8f92f9cde327.tar.gz |
When bouncing pages, allow a new option to preserve the intra-page
offset. This is needed for the ehci hardware buffer rings that assume
this behavior.
This is an interim solution, and a more general one is being worked
on. This solution doesn't break anything that doesn't ask for it
directly. The mbuf and uio variants with this flag likely don't work
and haven't been tested.
Universe builds with these changes. I don't have a huge-memory
machine to test these changes with, but will be happy to work with
folks that do and hps if this changes turns out not to be sufficient.
Submitted by: alfred@ from Hans Peter Selasky's original
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/arm/busdma_machdep.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/arm/arm/busdma_machdep.c b/sys/arm/arm/busdma_machdep.c index f53a47b..fb14ab0 100644 --- a/sys/arm/arm/busdma_machdep.c +++ b/sys/arm/arm/busdma_machdep.c @@ -1417,6 +1417,13 @@ add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, bz->active_bpages++; mtx_unlock(&bounce_lock); + if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { + /* page offset needs to be preserved */ + bpage->vaddr &= ~PAGE_MASK; + bpage->busaddr &= ~PAGE_MASK; + bpage->vaddr |= vaddr & PAGE_MASK; + bpage->busaddr |= vaddr & PAGE_MASK; + } bpage->datavaddr = vaddr; bpage->datacount = size; STAILQ_INSERT_TAIL(&(map->bpages), bpage, links); |