summaryrefslogtreecommitdiff
path: root/sys/arch/i386/i386/bus_dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/i386/i386/bus_dma.c')
-rw-r--r--sys/arch/i386/i386/bus_dma.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arch/i386/i386/bus_dma.c b/sys/arch/i386/i386/bus_dma.c
index 5f1084f8a3e..5544ccbfd82 100644
--- a/sys/arch/i386/i386/bus_dma.c
+++ b/sys/arch/i386/i386/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.25 2011/06/23 20:44:39 ariane Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.26 2012/12/08 12:04:21 mpi Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -493,7 +493,10 @@ paddr_t
_bus_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
@@ -510,7 +513,7 @@ _bus_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. */