7d87efa8fdfb9453670f2832df666fdae8291a84jmcp/*
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp * CDDL HEADER START
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp *
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp * The contents of this file are subject to the terms of the
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp * Common Development and Distribution License (the "License").
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp * You may not use this file except in compliance with the License.
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp *
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp * or http://www.opensolaris.org/os/licensing.
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp * See the License for the specific language governing permissions
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp * and limitations under the License.
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp *
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp * When distributing Covered Code, include this CDDL HEADER in each
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp * If applicable, add the following below this CDDL HEADER, with the
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp * fields enclosed by brackets "[]" replaced with your own identifying
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp * information: Portions Copyright [yyyy] [name of copyright owner]
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp *
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp * CDDL HEADER END
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp */
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp/*
6732dbb379bf754b70168b01ba56793737f9f3e7Vikram Hegde * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp * Use is subject to license terms.
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp */
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp#ifndef _SYS_AMD_IOMMU_H
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp#define _SYS_AMD_IOMMU_H
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp#ifdef __cplusplus
7d87efa8fdfb9453670f2832df666fdae8291a84jmcpextern "C" {
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp#endif
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp#include <sys/sunddi.h>
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp#include <sys/iommulib.h>
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp#ifdef _KERNEL
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp
7d87efa8fdfb9453670f2832df666fdae8291a84jmcptypedef struct amd_iommu_state {
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp int aioms_instance; /* instance */
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp dev_info_t *aioms_devi; /* dip */
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp struct amd_iommu *aioms_iommu_start; /* start of list of IOMMUs */
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp struct amd_iommu *aioms_iommu_end; /* end of list of IOMMUs */
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp int aioms_nunits; /* # of IOMMUs in function */
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp} amd_iommu_state_t;
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp
ac48dfe87039078897ed719af26744eca776508cVikram Hegde#define AMD_IOMMU_QUIESCE (0)
ac48dfe87039078897ed719af26744eca776508cVikram Hegde#define AMD_IOMMU_TEARDOWN (1)
ac48dfe87039078897ed719af26744eca776508cVikram Hegde
7d87efa8fdfb9453670f2832df666fdae8291a84jmcpint amd_iommu_setup(dev_info_t *dip, amd_iommu_state_t *statep);
ac48dfe87039078897ed719af26744eca776508cVikram Hegdeint amd_iommu_teardown(dev_info_t *dip, amd_iommu_state_t *statep, int type);
7d87efa8fdfb9453670f2832df666fdae8291a84jmcpint amd_iommu_lookup_src_bdf(uint16_t bdf, uint16_t *src_bdfp);
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp#endif /* _KERNEL */
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp#ifdef __cplusplus
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp}
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp#endif
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp
7d87efa8fdfb9453670f2832df666fdae8291a84jmcp#endif /* _SYS_AMD_IOMMU_H */