diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-04-20 00:42:07 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-04-20 00:42:07 +0000 |
commit | b5396dca6504168d952b238075ba34f507a94e0b (patch) | |
tree | 39015d7d9f61a69ff36284c190932f40b1bc8834 /sys/arch/mvmeppc | |
parent | 7720807a1d9f91f5c0f47d6b1be219d913aef6ac (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/mvmeppc')
-rw-r--r-- | sys/arch/mvmeppc/include/bus_mi.h | 3 | ||||
-rw-r--r-- | sys/arch/mvmeppc/mvmeppc/bus_dma.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/sys/arch/mvmeppc/include/bus_mi.h b/sys/arch/mvmeppc/include/bus_mi.h index cd3a1cfb963..8bc1bf8b01f 100644 --- a/sys/arch/mvmeppc/include/bus_mi.h +++ b/sys/arch/mvmeppc/include/bus_mi.h @@ -1,5 +1,5 @@ /* $NetBSD: bus.h,v 1.1 2001/06/06 17:37:37 matt Exp $ */ -/* $OpenBSD: bus_mi.h,v 1.9 2008/06/26 05:42:12 ray Exp $ */ +/* $OpenBSD: bus_mi.h,v 1.10 2009/04/20 00:42:06 oga Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -970,6 +970,7 @@ bus_space_copy_region_4(t, h1, o1, h2, o2, c) #define BUS_DMA_READ 0x100 /* mapping is device -> memory only */ #define BUS_DMA_WRITE 0x200 /* mapping is memory -> device only */ #define BUS_DMA_STREAMING 0x400 /* hint: sequential, unidirectional */ +#define BUS_DMA_ZERO 0x800 /* zero memory in dmamem_alloc */ /* Forwards needed by prototypes below. */ struct mbuf; diff --git a/sys/arch/mvmeppc/mvmeppc/bus_dma.c b/sys/arch/mvmeppc/mvmeppc/bus_dma.c index 88f0d31215d..3bd46697866 100644 --- a/sys/arch/mvmeppc/mvmeppc/bus_dma.c +++ b/sys/arch/mvmeppc/mvmeppc/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.23 2009/04/14 16:01:04 oga Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.24 2009/04/20 00:42:06 oga Exp $ */ /* $NetBSD: bus_dma.c,v 1.2 2001/06/10 02:31:25 briggs Exp $ */ /*- @@ -611,6 +611,8 @@ _bus_dmamem_alloc_range(t, size, alignment, boundary, segs, nsegs, rsegs, * 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, |