summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2011-04-05 21:37:08 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2011-04-05 21:37:08 +0000
commit2ba76fec80a3a3d9f58f763d13b99fffbeebdbe3 (patch)
tree62b80c90eb6c0d2d0100afeef87475179db173bc
parent9c6a1c4acfd9cca58f22273d12ecbe06f133329b (diff)
add a man page for dma_alloc(9)
-rw-r--r--share/man/man9/Makefile5
-rw-r--r--share/man/man9/dma_alloc.961
2 files changed, 64 insertions, 2 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 10a8c1ad7ca..54e35a34e43 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.164 2011/04/04 11:26:51 art Exp $
+# $OpenBSD: Makefile,v 1.165 2011/04/05 21:37:07 deraadt Exp $
# $NetBSD: Makefile,v 1.4 1996/01/09 03:23:01 thorpej Exp $
# Makefile for section 9 (kernel function and variable) manual pages.
@@ -6,7 +6,7 @@
MAN= altq.9 aml_evalnode.9 atomic.9 audio.9 autoconf.9 bio_register.9 \
boot.9 \
buffercache.9 bus_dma.9 bus_space.9 copy.9 crypto.9 delay.9 \
- disk.9 disklabel.9 dohooks.9 dopowerhooks.9 \
+ disk.9 disklabel.9 dma_alloc.9 dohooks.9 dopowerhooks.9 \
domountroothooks.9 doshutdownhooks.9 dostartuphooks.9 \
evcount.9 file.9 \
fork1.9 extent.9 getdevvp.9 getnewvnode.9 hash.9 hashinit.9 \
@@ -245,6 +245,7 @@ MLINKS+=pool.9 pool_init.9 pool.9 pool_destroy.9 \
pool.9 pool_get.9 pool.9 pool_put.9 pool.9 pool_prime.9 \
pool.9 pool_sethiwat.9 pool.9 pool_setipl.9 pool.9 pool_setlowat.9 \
pool.9 pool_sethardlimit.9
+MLINKS+=dma_alloc.9 dma_free.9
MLINKS+=powerhook_establish.9 powerhook_disestablish.9
MLINKS+=printf.9 snprintf.9 printf.9 vsnprintf.9 printf.9 vprintf.9 \
printf.9 uprintf.9 printf.9 ttyprintf.9 printf.9 db_printf.9
diff --git a/share/man/man9/dma_alloc.9 b/share/man/man9/dma_alloc.9
new file mode 100644
index 00000000000..a7e2d219ec1
--- /dev/null
+++ b/share/man/man9/dma_alloc.9
@@ -0,0 +1,61 @@
+.\" $OpenBSD: dma_alloc.9,v 1.1 2011/04/05 21:37:07 deraadt Exp $
+.\" $NetBSD: pool.9,v 1.18 2001/06/21 11:59:01 wiz Exp $
+.\"
+.\" Copyright (c) 2011 Theo de Raadt
+.\" All rights reserved.
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd $Mdocdate: April 5 2011 $
+.Dt DMA_ALLOC 9
+.Os
+.Sh NAME
+.Nm dma_alloc ,
+.Nm dma_free
+.Nd DMA save allocator
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/pool.h>
+.Ft void *
+.Fo dma_alloc
+.Fa "size_t size"
+.Fa "int flags"
+.Fc
+.Ft void
+.Fo dma_free
+.Fa "void *m"
+.Fa "size_t size"
+.Fc
+.Sh DESCRIPTION
+This allocator provides DMA-safe memory provided using
+.Xr pools 9 .
+This allocator is safe to call in most contexts and is
+typically used for temporary-use buffers up to 65536 bytes.
+When buffers are used many times it may be better to consider
+using other DMA-safe allocators.
+.Pp
+Interrupt protection has been set to
+.Va IPL_VM
+using
+.Fn pool_setipl .
+.Pp
+The
+.Ar flags
+argument is a selection of
+.Xr pool_get
+flag arguments.
+.Ar sizes
+.Sh SEE ALSO
+.Xr bus_dma 9 ,
+.Xr pool 9 ,
+.Xr mbuf 9