summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2020-11-15 23:14:04 +0000
committerkettenis <kettenis@openbsd.org>2020-11-15 23:14:04 +0000
commitdfa9b95e21b6c17e7bae976f51deb34a8cdfd056 (patch)
treedcaf29f0482f005c9890b869d576fe9be6bdf17e
parentHardwire bus_space_read_raw_N() and bus_space_write_raw_N() to (diff)
downloadwireguard-openbsd-dfa9b95e21b6c17e7bae976f51deb34a8cdfd056.tar.xz
wireguard-openbsd-dfa9b95e21b6c17e7bae976f51deb34a8cdfd056.zip
Make sure we perform address translation to all elements of a DMA mapping.
-rw-r--r--sys/arch/powerpc64/dev/phb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/powerpc64/dev/phb.c b/sys/arch/powerpc64/dev/phb.c
index 2dc19dc37d3..a28809edd4b 100644
--- a/sys/arch/powerpc64/dev/phb.c
+++ b/sys/arch/powerpc64/dev/phb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: phb.c,v 1.18 2020/10/25 14:11:16 kettenis Exp $ */
+/* $OpenBSD: phb.c,v 1.19 2020/11/15 23:14:04 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
*
@@ -808,7 +808,7 @@ phb_dmamap_load_raw(bus_dma_tag_t t, bus_dmamap_t map,
return error;
/* For each segment. */
- for (seg = 0; seg < nsegs; seg++) {
+ for (seg = 0; seg < map->dm_nsegs; seg++) {
map->dm_segs[seg].ds_addr = map->dm_segs[seg]._ds_paddr;
if (sc->sc_tce_table)
map->dm_segs[seg].ds_addr += PHB_DMA_OFFSET;