16732dbb3SVikram Hegde /* 26732dbb3SVikram Hegde * CDDL HEADER START 36732dbb3SVikram Hegde * 46732dbb3SVikram Hegde * The contents of this file are subject to the terms of the 56732dbb3SVikram Hegde * Common Development and Distribution License (the "License"). 66732dbb3SVikram Hegde * You may not use this file except in compliance with the License. 76732dbb3SVikram Hegde * 86732dbb3SVikram Hegde * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 96732dbb3SVikram Hegde * or http://www.opensolaris.org/os/licensing. 106732dbb3SVikram Hegde * See the License for the specific language governing permissions 116732dbb3SVikram Hegde * and limitations under the License. 126732dbb3SVikram Hegde * 136732dbb3SVikram Hegde * When distributing Covered Code, include this CDDL HEADER in each 146732dbb3SVikram Hegde * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 156732dbb3SVikram Hegde * If applicable, add the following below this CDDL HEADER, with the 166732dbb3SVikram Hegde * fields enclosed by brackets "[]" replaced with your own identifying 176732dbb3SVikram Hegde * information: Portions Copyright [yyyy] [name of copyright owner] 186732dbb3SVikram Hegde * 196732dbb3SVikram Hegde * CDDL HEADER END 206732dbb3SVikram Hegde */ 216732dbb3SVikram Hegde /* 226732dbb3SVikram Hegde * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 236732dbb3SVikram Hegde * Use is subject to license terms. 246732dbb3SVikram Hegde */ 256732dbb3SVikram Hegde 266732dbb3SVikram Hegde #ifndef _SYS_AMD_IOMMU_H 276732dbb3SVikram Hegde #define _SYS_AMD_IOMMU_H 286732dbb3SVikram Hegde 296732dbb3SVikram Hegde #ifdef __cplusplus 306732dbb3SVikram Hegde extern "C" { 316732dbb3SVikram Hegde #endif 326732dbb3SVikram Hegde 336732dbb3SVikram Hegde #include <sys/sunddi.h> 346732dbb3SVikram Hegde #include <sys/iommulib.h> 356732dbb3SVikram Hegde 366732dbb3SVikram Hegde #ifdef _KERNEL 376732dbb3SVikram Hegde 386732dbb3SVikram Hegde typedef struct amd_iommu_state { 396732dbb3SVikram Hegde int aioms_instance; /* instance */ 406732dbb3SVikram Hegde dev_info_t *aioms_devi; /* dip */ 416732dbb3SVikram Hegde struct amd_iommu *aioms_iommu_start; /* start of list of IOMMUs */ 426732dbb3SVikram Hegde struct amd_iommu *aioms_iommu_end; /* end of list of IOMMUs */ 436732dbb3SVikram Hegde int aioms_nunits; /* # of IOMMUs in function */ 446732dbb3SVikram Hegde } amd_iommu_state_t; 456732dbb3SVikram Hegde 46*ac48dfe8SVikram Hegde #define AMD_IOMMU_QUIESCE (0) 47*ac48dfe8SVikram Hegde #define AMD_IOMMU_TEARDOWN (1) 48*ac48dfe8SVikram Hegde 496732dbb3SVikram Hegde int amd_iommu_setup(dev_info_t *dip, amd_iommu_state_t *statep); 50*ac48dfe8SVikram Hegde int amd_iommu_teardown(dev_info_t *dip, amd_iommu_state_t *statep, int type); 516732dbb3SVikram Hegde int amd_iommu_lookup_src_bdf(uint16_t bdf, uint16_t *src_bdfp); 526732dbb3SVikram Hegde 536732dbb3SVikram Hegde #endif /* _KERNEL */ 546732dbb3SVikram Hegde 556732dbb3SVikram Hegde #ifdef __cplusplus 566732dbb3SVikram Hegde } 576732dbb3SVikram Hegde #endif 586732dbb3SVikram Hegde 596732dbb3SVikram Hegde #endif /* _SYS_AMD_IOMMU_H */ 60