2 * Copyright (c) 1997, 1998 Justin T. Gibbs.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions, and the following disclaimer,
9 * without modification, immediately at the beginning of the file.
10 * 2. The name of the author may not be used to endorse or promote products
11 * derived from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
17 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 #include <sys/cdefs.h>
27 __FBSDID("$FreeBSD$");
29 #include <sys/param.h>
30 #include <sys/systm.h>
31 #include <sys/malloc.h>
33 #include <sys/kernel.h>
36 #include <sys/memdesc.h>
37 #include <sys/mutex.h>
40 #include <vm/vm_extern.h>
43 #include <machine/bus.h>
46 _bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf,
47 bus_size_t buflen, int flags, bus_dma_segment_t *segs, int *segp)
54 _bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, struct vm_page **ma,
55 bus_size_t tlen, int ma_offs, int flags, bus_dma_segment_t *segs,
63 _bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
64 bus_size_t buflen, pmap_t pmap, int flags, bus_dma_segment_t *segs,
72 _bus_dmamap_waitok(bus_dma_tag_t dmat, bus_dmamap_t map,
73 struct memdesc *mem, bus_dmamap_callback_t *callback, void *callback_arg)
80 _bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t map,
81 bus_dma_segment_t *segs, int nsegs, int error)
88 * Release the mapping held by map.
91 bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map)
98 bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)