summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2015-01-24 16:06:47 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2015-01-24 16:06:47 +0000
commitcbe97d8e938a8701cd22127a75c971316b3e2def (patch)
tree4aee79bc24b2376185f9c75f99befe704446674d
parent27acbc508263bbead0b2df08d677c984fc5796b2 (diff)
Document bus_dmamem_alloc_range(9).
-rw-r--r--share/man/man9/bus_dma.931
1 files changed, 28 insertions, 3 deletions
diff --git a/share/man/man9/bus_dma.9 b/share/man/man9/bus_dma.9
index a77349989e8..759de6d8d86 100644
--- a/share/man/man9/bus_dma.9
+++ b/share/man/man9/bus_dma.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: bus_dma.9,v 1.32 2014/09/08 01:27:55 schwarze Exp $
+.\" $OpenBSD: bus_dma.9,v 1.33 2015/01/24 16:06:46 kettenis Exp $
.\" $NetBSD: bus_dma.9,v 1.14 2000/06/14 06:49:19 cgd Exp $
.\"
.\" Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: September 8 2014 $
+.Dd $Mdocdate: January 24 2015 $
.Dt BUS_DMA 9
.Os
.Sh NAME
@@ -552,6 +552,11 @@ appropriate synchronization operations, behavior is undefined.
"bus_size_t alignment" "bus_size_t boundary" \
"bus_dma_segment_t *segs" "int nsegs" "int *rsegs" \
"int flags"
+.Ft int
+.Fn bus_dmamem_alloc_range "bus_dma_tag_t tag" "bus_size_t size" \
+ "bus_size_t alignment" "bus_size_t boundary" \
+ "bus_dma_segment_t *segs" "int nsegs" "int *rsegs" \
+ "int flags" "bus_addr_t low" "bus_addr_t high"
.Ft void
.Fn bus_dmamem_free "bus_dma_tag_t tag" "bus_dma_segment_t *segs" "int nsegs"
.nr nS 0
@@ -645,15 +650,33 @@ bus-dependent functionality.
.El
.El
.Pp
+The
+.Fn bus_dmamem_alloc_range
+function is a variaton of
+.Fn bus_dmamem_alloc
+that allows specification of the "DMA safe" bus address range
+supported by the device. The additional
+.Fa low
+and
+.Fa high
+arguments specify the lowest and highest bus address that the device
+can use for DMA transfers.
+This function should only be used if that address range differs from
+the the default address range for the bus.
+.Pp
All pages allocated by
.Fn bus_dmamem_alloc
+and
+.Fn bus_dmameme_alloc_range
will be wired down until they are freed by
.Fn bus_dmamem_free .
.Pp
The
.Fn bus_dmamem_free
function frees memory previously allocated by
-.Fn bus_dmamem_alloc ,
+.Fn bus_dmamem_alloc
+or
+.Fn bus_dmamem_alloc_range ,
invalidating any mapping.
This function always succeeds if given valid arguments.
.Pp
@@ -691,6 +714,8 @@ The
.Fn bus_dmamem_map
function maps memory allocated with
.Fn bus_dmamem_alloc
+or
+.Fn bus_dmamem_alloc_range
into kernel virtual address space.
This function returns 0 on success, an error code otherwise, and must not be
called from an interrupt context.