summaryrefslogtreecommitdiff
path: root/sys/arch/arm
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-04-20 00:42:07 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-04-20 00:42:07 +0000
commitb5396dca6504168d952b238075ba34f507a94e0b (patch)
tree39015d7d9f61a69ff36284c190932f40b1bc8834 /sys/arch/arm
parent7720807a1d9f91f5c0f47d6b1be219d913aef6ac (diff)
Add a BUS_DMA_ZERO flag for bus_dmamem_alloc() to return zeroed memory.
Saves every damned driver calling bzero(), and continues the M_ZERO, PR_ZERO symmetry.
Diffstat (limited to 'sys/arch/arm')
-rw-r--r--sys/arch/arm/arm/bus_dma.c4
-rw-r--r--sys/arch/arm/include/bus.h3
2 files changed, 5 insertions, 2 deletions
diff --git a/sys/arch/arm/arm/bus_dma.c b/sys/arch/arm/arm/bus_dma.c
index a6d20e3b353..5cde68127a3 100644
--- a/sys/arch/arm/arm/bus_dma.c
+++ b/sys/arch/arm/arm/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.14 2009/04/14 16:01:04 oga Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.15 2009/04/20 00:42:05 oga Exp $ */
/* $NetBSD: bus_dma.c,v 1.38 2003/10/30 08:44:13 scw Exp $ */
/*-
@@ -975,6 +975,8 @@ _bus_dmamem_alloc_range(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
* Allocate pages from the VM system.
*/
plaflag = flags & BUS_DMA_NOWAIT ? UVM_PLA_NOWAIT : UVM_PLA_WAITOK;
+ if (flags & BUS_DMA_ZERO)
+ plaflag |= UVM_PLA_ZERO;
TAILQ_INIT(&mlist);
error = uvm_pglistalloc(size, low, high, alignment, boundary,
diff --git a/sys/arch/arm/include/bus.h b/sys/arch/arm/include/bus.h
index 8887be2605a..04408dbc798 100644
--- a/sys/arch/arm/include/bus.h
+++ b/sys/arch/arm/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.10 2008/06/26 05:42:09 ray Exp $ */
+/* $OpenBSD: bus.h,v 1.11 2009/04/20 00:42:06 oga Exp $ */
/* $NetBSD: bus.h,v 1.12 2003/10/23 15:03:24 scw Exp $ */
/*-
@@ -628,6 +628,7 @@ bs_c_8_proto(f);
#define BUS_DMA_READ 0x100 /* mapping is device -> memory only */
#define BUS_DMA_WRITE 0x200 /* mapping is memory -> device only */
#define BUS_DMA_NOCACHE 0x400 /* hint: map non-cached memory */
+#define BUS_DMA_ZERO 0x800 /* dmamem_alloc returns zeroed mem */
/*
* Private flags stored in the DMA map.