1216154Snwhitehorn#- 2216154Snwhitehorn# Copyright (c) 2010 Nathan Whitehorn 3216154Snwhitehorn# All rights reserved. 4216154Snwhitehorn# 5216154Snwhitehorn# Redistribution and use in source and binary forms, with or without 6216154Snwhitehorn# modification, are permitted provided that the following conditions 7216154Snwhitehorn# are met: 8216154Snwhitehorn# 1. Redistributions of source code must retain the above copyright 9216154Snwhitehorn# notice, this list of conditions and the following disclaimer. 10216154Snwhitehorn# 2. Redistributions in binary form must reproduce the above copyright 11216154Snwhitehorn# notice, this list of conditions and the following disclaimer in the 12216154Snwhitehorn# documentation and/or other materials provided with the distribution. 13216154Snwhitehorn# 14216154Snwhitehorn# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15216154Snwhitehorn# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16216154Snwhitehorn# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17216154Snwhitehorn# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18216154Snwhitehorn# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19216154Snwhitehorn# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20216154Snwhitehorn# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21216154Snwhitehorn# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22216154Snwhitehorn# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23216154Snwhitehorn# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24216154Snwhitehorn# SUCH DAMAGE. 25216154Snwhitehorn# 26216154Snwhitehorn# from: src/sys/kern/bus_if.m,v 1.21 2002/04/21 11:16:10 markm Exp 27216154Snwhitehorn# $FreeBSD$ 28216154Snwhitehorn# 29216154Snwhitehorn 30216154Snwhitehorn#include <machine/bus.h> 31216154Snwhitehorn 32216154Snwhitehorn#include <sys/bus.h> 33216154Snwhitehorn#include <sys/bus_dma.h> 34216154Snwhitehorn 35216154SnwhitehornINTERFACE iommu; 36216154Snwhitehorn 37216154SnwhitehornMETHOD int map { 38216154Snwhitehorn device_t iommu; 39216154Snwhitehorn bus_dma_segment_t *segs; 40216154Snwhitehorn int *nsegs; 41216154Snwhitehorn bus_addr_t lowaddr; 42216154Snwhitehorn bus_addr_t highaddr; 43216154Snwhitehorn bus_size_t alignment; 44216154Snwhitehorn bus_size_t boundary; 45216154Snwhitehorn void *cookie; 46216154Snwhitehorn}; 47216154Snwhitehorn 48216154SnwhitehornMETHOD int unmap { 49216154Snwhitehorn device_t iommu; 50216154Snwhitehorn bus_dma_segment_t *segs; 51216154Snwhitehorn int nsegs; 52216154Snwhitehorn void *cookie; 53216154Snwhitehorn}; 54216154Snwhitehorn 55