Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm Deal in 4KB ...
details: https://anonhg.NetBSD.org/src/rev/00dd0ea2f424
branches: trunk
changeset: 328820:00dd0ea2f424
user: skrll <skrll%NetBSD.org@localhost>
date: Sat Apr 19 07:28:18 2014 +0000
description:
Deal in 4KB pages for vchiq regardless of ARM page size.
diffstat:
sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c | 11 +++++++--
1 files changed, 8 insertions(+), 3 deletions(-)
diffs (26 lines):
diff -r 5c170cd8f147 -r 00dd0ea2f424 sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c
--- a/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c Sat Apr 19 07:17:21 2014 +0000
+++ b/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c Sat Apr 19 07:28:18 2014 +0000
@@ -338,14 +338,19 @@
pagelist->type = (dir == VCHIQ_BULK_RECEIVE) ?
PAGELIST_READ : PAGELIST_WRITE;
pagelist->length = size;
- pagelist->offset = va & PAGE_MASK;
+ pagelist->offset = va & L2_S_OFFSET;
/*
* busdma already coalesces contiguous pages for us
*/
for (int i = 0; i < bi->dmamap->dm_nsegs; i++) {
- pagelist->addrs[i] = bi->dmamap->dm_segs[i].ds_addr & ~PAGE_MASK;
- pagelist->addrs[i] |= atop(round_page(bi->dmamap->dm_segs[i].ds_len)) - 1;
+ bus_addr_t addr = bi->dmamap->dm_segs[i].ds_addr;
+ bus_size_t len = bi->dmamap->dm_segs[i].ds_len;
+ bus_size_t off = addr & L2_S_OFFSET;
+ int npgs = ((off + len + L2_S_OFFSET) >> L2_S_SHIFT);
+
+ pagelist->addrs[i] = addr & ~L2_S_OFFSET;
+ pagelist->addrs[i] |= npgs - 1;
}
/* Partial cache lines (fragments) require special measures */
Home |
Main Index |
Thread Index |
Old Index