1161927Sjmg/*- 2161927Sjmg * Copyright 2006 John-Mark Gurney. 3161927Sjmg * All rights reserved. 4161927Sjmg * 5161927Sjmg * Redistribution and use in source and binary forms, with or without 6161927Sjmg * modification, are permitted provided that the following conditions 7161927Sjmg * are met: 8161927Sjmg * 1. Redistributions of source code must retain the above copyright 9161927Sjmg * notice, this list of conditions and the following disclaimer. 10161927Sjmg * 2. Redistributions in binary form must reproduce the above copyright 11161927Sjmg * notice, this list of conditions and the following disclaimer in the 12161927Sjmg * documentation and/or other materials provided with the distribution. 13161927Sjmg * 14161927Sjmg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15161927Sjmg * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16161927Sjmg * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17161927Sjmg * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18161927Sjmg * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19161927Sjmg * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20161927Sjmg * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21161927Sjmg * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22161927Sjmg * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23161927Sjmg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24161927Sjmg * SUCH DAMAGE. 25161927Sjmg * 26161927Sjmg * $FreeBSD$ 27161927Sjmg * 28161927Sjmg */ 29161927Sjmg 30161927Sjmg#ifndef _SYS__BUS_DMA_H_ 31161927Sjmg#define _SYS__BUS_DMA_H_ 32161927Sjmg 33161927Sjmgtypedef int bus_dmasync_op_t; 34161927Sjmg 35161927Sjmg/* 36161927Sjmg * bus_dma_tag_t 37161927Sjmg * 38161927Sjmg * A machine-dependent opaque type describing the characteristics 39161927Sjmg * of how to perform DMA mappings. This structure encapsultes 40161927Sjmg * information concerning address and alignment restrictions, number 41161927Sjmg * of S/G segments, amount of data per S/G segment, etc. 42161927Sjmg */ 43161927Sjmgtypedef struct bus_dma_tag *bus_dma_tag_t; 44161927Sjmg 45161927Sjmg/* 46161927Sjmg * bus_dmamap_t 47161927Sjmg * 48161927Sjmg * DMA mapping instance information. 49161927Sjmg */ 50161927Sjmgtypedef struct bus_dmamap *bus_dmamap_t; 51161927Sjmg 52161927Sjmg/* 53161927Sjmg * A function that performs driver-specific synchronization on behalf of 54161927Sjmg * busdma. 55161927Sjmg */ 56161927Sjmgtypedef enum { 57161927Sjmg BUS_DMA_LOCK = 0x01, 58161927Sjmg BUS_DMA_UNLOCK = 0x02, 59161927Sjmg} bus_dma_lock_op_t; 60161927Sjmg 61161927Sjmgtypedef void bus_dma_lock_t(void *, bus_dma_lock_op_t); 62161927Sjmg 63161927Sjmg#endif /* !_SYS__BUS_DMA_H_ */ 64