bus_dma.9 (117085) | bus_dma.9 (117190) |
---|---|
1.\" Copyright (c) 2002, 2003 Hiten M. Pandya. 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions, and the following disclaimer, --- 43 unchanged lines hidden (view full) --- 52.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 53.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 54.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 55.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 56.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 57.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 58.\" POSSIBILITY OF SUCH DAMAGE. 59.\" | 1.\" Copyright (c) 2002, 2003 Hiten M. Pandya. 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions, and the following disclaimer, --- 43 unchanged lines hidden (view full) --- 52.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 53.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 54.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 55.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 56.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 57.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 58.\" POSSIBILITY OF SUCH DAMAGE. 59.\" |
60.\" $FreeBSD: head/share/man/man9/bus_dma.9 117085 2003-06-30 20:20:51Z jmg $ | 60.\" $FreeBSD: head/share/man/man9/bus_dma.9 117190 2003-07-03 08:32:42Z scottl $ |
61.\" $NetBSD: bus_dma.9,v 1.25 2002/10/14 13:43:16 wiz Exp $ 62.\" 63.Dd May 28, 2003 64.Dt BUS_DMA 9 65.Os 66.Sh NAME 67.Nm bus_dma , 68.Nm bus_dma_tag_create , --- 9 unchanged lines hidden (view full) --- 78.Nm bus_dmamem_free , 79.Nd Bus and Machine Independent DMA Mapping Interface 80.Sh SYNOPSIS 81.In machine/bus.h 82.Ft int 83.Fn bus_dma_tag_create "bus_dma_tag_t parent" "bus_size_t alignment" \ 84"bus_size_t boundary" "bus_addr_t lowaddr" "bus_addr_t highaddr" \ 85"bus_dma_filter_t *filtfunc" "void *filtfuncarg" "bus_size_t maxsize" \ | 61.\" $NetBSD: bus_dma.9,v 1.25 2002/10/14 13:43:16 wiz Exp $ 62.\" 63.Dd May 28, 2003 64.Dt BUS_DMA 9 65.Os 66.Sh NAME 67.Nm bus_dma , 68.Nm bus_dma_tag_create , --- 9 unchanged lines hidden (view full) --- 78.Nm bus_dmamem_free , 79.Nd Bus and Machine Independent DMA Mapping Interface 80.Sh SYNOPSIS 81.In machine/bus.h 82.Ft int 83.Fn bus_dma_tag_create "bus_dma_tag_t parent" "bus_size_t alignment" \ 84"bus_size_t boundary" "bus_addr_t lowaddr" "bus_addr_t highaddr" \ 85"bus_dma_filter_t *filtfunc" "void *filtfuncarg" "bus_size_t maxsize" \ |
86"int nsegments" "bus_size_t maxsegsz" "int flags" "bus_dma_tag_t *dmat" | 86"int nsegments" "bus_size_t maxsegsz" "int flags" "bus_dma_lock_t *lockfunc" \ 87"void *lockfuncarg" "bus_dma_tag_t *dmat" |
87.Ft int 88.Fn bus_dma_tag_destroy "bus_dma_tag_t dmat" 89.Ft int 90.Fn bus_dmamap_create "bus_dma_tag_t dmat" "int flags" "bus_dmamap_t *mapp" 91.Ft int 92.Fn bus_dmamap_destroy "bus_dma_tag_t dmat" "bus_dmamap_t map" 93.Ft int 94.Fn bus_dmamap_load "bus_dma_tag_t dmat" "bus_dmamap_t map" "void *buf" \ --- 160 unchanged lines hidden (view full) --- 255to CPU access of the memory. 256.It Dv BUS_DMASYNC_POSTWRITE 257Perform any synchronization required after DMA write operations, but prior 258to CPU access of the memory. 259.It Dv BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE 260Perform any synchronization required after a combination of DMA read 261and write operations. 262.El | 88.Ft int 89.Fn bus_dma_tag_destroy "bus_dma_tag_t dmat" 90.Ft int 91.Fn bus_dmamap_create "bus_dma_tag_t dmat" "int flags" "bus_dmamap_t *mapp" 92.Ft int 93.Fn bus_dmamap_destroy "bus_dma_tag_t dmat" "bus_dmamap_t map" 94.Ft int 95.Fn bus_dmamap_load "bus_dma_tag_t dmat" "bus_dmamap_t map" "void *buf" \ --- 160 unchanged lines hidden (view full) --- 256to CPU access of the memory. 257.It Dv BUS_DMASYNC_POSTWRITE 258Perform any synchronization required after DMA write operations, but prior 259to CPU access of the memory. 260.It Dv BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE 261Perform any synchronization required after a combination of DMA read 262and write operations. 263.El |
264.It Vt bus_dma_lock_t 265Client specified lock/mutex manipulation method. This will be called from 266within busdma whenever a client lock needs to be manipulated. 267This method is of the format: 268.Bl -tag -width compact 269.It Ft void 270.Fn "lockfunc" "void *lockfunc_arg" "bus_dma_lock_op_t op" |
|
263.El | 271.El |
272.sp 273Two 274.Vt lockfunc 275implementations are provided for convenience. 276.Fn busdma_lock_mutex 277performs standard mutex operations on the sleep mutex provided via the 278.Fa lockfuncarg . 279passed into 280.Fn bus_dma_tag_create . 281.Fn dflt_lock 282will generate a system panic if it is called. It is substituted into 283the tag when 284.Fa lockfunc 285is passed as NULL to 286.Fn bus_dma_tag_create . 287.It Vt bus_dma_lock_op_t 288Operations to be performed by the client-specified 289.Fn lockfunc . 290.Bl -tag -width BUS_DMA_UNLOCK 291.It Dv BUS_DMA_LOCK 292Aquires and/or locks the client locking primitive. 293.It Dv BUS_DMA_UNLOCK 294Releases and/or unlocks the client locking primitive. 295.El 296.El 297.sp |
|
264.Sh FUNCTIONS 265.Bl -tag -width compact 266.It Fn bus_dma_tag_create "parent" "alignment" "boundary" "lowaddr" \ 267"highaddr" "*filtfunc" "*filtfuncarg" "maxsize" "nsegments" "maxsegsz" \ 268"flags" "*dmat" 269Allocates a device specific DMA tag, and initializes it according to 270the arguments provided: 271.Bl -tag -width *filtfuncarg -compact --- 467 unchanged lines hidden --- | 298.Sh FUNCTIONS 299.Bl -tag -width compact 300.It Fn bus_dma_tag_create "parent" "alignment" "boundary" "lowaddr" \ 301"highaddr" "*filtfunc" "*filtfuncarg" "maxsize" "nsegments" "maxsegsz" \ 302"flags" "*dmat" 303Allocates a device specific DMA tag, and initializes it according to 304the arguments provided: 305.Bl -tag -width *filtfuncarg -compact --- 467 unchanged lines hidden --- |