summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2009-02-08 22:54:58 +0000
committerimp <imp@FreeBSD.org>2009-02-08 22:54:58 +0000
commit719ba982f29fc81ee8072f46770b8f92f9cde327 (patch)
treecc62825b111ed71a6a25b4cf9e56057dd93d0ae4 /sys/ia64
parent9513bac196b9078727e9e71fe300ad749da75966 (diff)
downloadFreeBSD-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/ia64')
-rw-r--r--sys/ia64/ia64/busdma_machdep.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/ia64/ia64/busdma_machdep.c b/sys/ia64/ia64/busdma_machdep.c
index 6cc2988..659db52 100644
--- a/sys/ia64/ia64/busdma_machdep.c
+++ b/sys/ia64/ia64/busdma_machdep.c
@@ -936,6 +936,13 @@ add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr,
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);
OpenPOWER on IntegriCloud