diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-03-03 10:33:51 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-03-03 10:33:51 +0000 |
commit | bfa15dd5a2b2a6746c04b9acab6c0e88a483d1d4 (patch) | |
tree | 8b7b45255d6fd9d36cc547e20aaea3e5abc5e35d /sys/arch | |
parent | abbe2db70fb0d1f3df2330739eb461e1a79bc05d (diff) |
Add support for the BUS_DMA_NOCACHE flag to bus_dmamem_mmap(9).
ok patrick@, jsg@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/arm64/arm64/bus_dma.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arch/arm64/arm64/bus_dma.c b/sys/arch/arm64/arm64/bus_dma.c index 5644a1daad4..744abfefac9 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.11 2020/03/03 10:30:58 kettenis Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.12 2020/03/03 10:33:50 kettenis Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -544,7 +544,10 @@ paddr_t _dmamem_mmap(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, off_t off, int prot, int flags) { - int i; + int i, pmapflags = 0; + + if (flags & BUS_DMA_NOCACHE) + pmapflags |= PMAP_NOCACHE; for (i = 0; i < nsegs; i++) { #ifdef DIAGNOSTIC @@ -561,7 +564,7 @@ _dmamem_mmap(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, off_t off, continue; } - return (segs[i].ds_addr + off); + return ((segs[i].ds_addr + off) | pmapflags); } /* Page not found. */ |