diff options
author | 2012-12-04 10:14:25 +0000 | |
---|---|---|
committer | 2012-12-04 10:14:25 +0000 | |
commit | cff953945d57b5da07fadd5d69332665d64c9ca1 (patch) | |
tree | 0116e30ad7d6d0e72616055959aa221ea99fb4ae | |
parent | Only pull in sys/cdefs.h if needed (diff) | |
download | wireguard-openbsd-cff953945d57b5da07fadd5d69332665d64c9ca1.tar.xz wireguard-openbsd-cff953945d57b5da07fadd5d69332665d64c9ca1.zip |
Make bus_dmamem_mmap(9) understand the BUS_DMA_NOCACHE flag, required for
upcoming agp changes.
ok kettenis@
-rw-r--r-- | sys/arch/macppc/macppc/dma.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arch/macppc/macppc/dma.c b/sys/arch/macppc/macppc/dma.c index 254613c6df7..da2fecdff6b 100644 --- a/sys/arch/macppc/macppc/dma.c +++ b/sys/arch/macppc/macppc/dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dma.c,v 1.36 2012/08/30 18:14:26 mpi Exp $ */ +/* $OpenBSD: dma.c,v 1.37 2012/12/04 10:14:25 mpi Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -522,7 +522,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 @@ -539,7 +542,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. */ |