From 8a0d3db2d2a432f3970edbcb0cc1915feb24c52a Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Fri, 11 Aug 2017 22:01:10 +0000 Subject: Have bus_dmamem_map() store the virtual address of the mapping such that we can use it to flush the cache in bus_dmamap_sync() if necessary. ok patrick@ --- sys/arch/arm64/arm64/bus_dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/arch/arm64') diff --git a/sys/arch/arm64/arm64/bus_dma.c b/sys/arch/arm64/arm64/bus_dma.c index fdb065a9fa9..74876fe04e6 100644 --- a/sys/arch/arm64/arm64/bus_dma.c +++ b/sys/arch/arm64/arm64/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.8 2017/05/10 21:58:55 kettenis Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.9 2017/08/11 22:01:09 kettenis Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -506,6 +506,7 @@ _dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, size_t size, (flags & BUS_DMA_COHERENT)) || (flags & BUS_DMA_NOCACHE)) cache = PMAP_CACHE_CI; for (curseg = 0; curseg < nsegs; curseg++) { + segs[curseg]._ds_vaddr = va; for (addr = segs[curseg].ds_addr; addr < (segs[curseg].ds_addr + segs[curseg].ds_len); addr += NBPG, va += NBPG, size -= NBPG) { -- cgit v1.2.3