xref: /illumos-gate/usr/src/uts/i86pc/sys/amd_iommu.h (revision ac48dfe8)
17d87efa8Sjmcp /*
27d87efa8Sjmcp  * CDDL HEADER START
37d87efa8Sjmcp  *
47d87efa8Sjmcp  * The contents of this file are subject to the terms of the
57d87efa8Sjmcp  * Common Development and Distribution License (the "License").
67d87efa8Sjmcp  * You may not use this file except in compliance with the License.
77d87efa8Sjmcp  *
87d87efa8Sjmcp  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97d87efa8Sjmcp  * or http://www.opensolaris.org/os/licensing.
107d87efa8Sjmcp  * See the License for the specific language governing permissions
117d87efa8Sjmcp  * and limitations under the License.
127d87efa8Sjmcp  *
137d87efa8Sjmcp  * When distributing Covered Code, include this CDDL HEADER in each
147d87efa8Sjmcp  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157d87efa8Sjmcp  * If applicable, add the following below this CDDL HEADER, with the
167d87efa8Sjmcp  * fields enclosed by brackets "[]" replaced with your own identifying
177d87efa8Sjmcp  * information: Portions Copyright [yyyy] [name of copyright owner]
187d87efa8Sjmcp  *
197d87efa8Sjmcp  * CDDL HEADER END
207d87efa8Sjmcp  */
217d87efa8Sjmcp /*
226732dbb3SVikram Hegde  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237d87efa8Sjmcp  * Use is subject to license terms.
247d87efa8Sjmcp  */
257d87efa8Sjmcp 
267d87efa8Sjmcp #ifndef	_SYS_AMD_IOMMU_H
277d87efa8Sjmcp #define	_SYS_AMD_IOMMU_H
287d87efa8Sjmcp 
297d87efa8Sjmcp #ifdef	__cplusplus
307d87efa8Sjmcp extern "C" {
317d87efa8Sjmcp #endif
327d87efa8Sjmcp 
337d87efa8Sjmcp #include <sys/sunddi.h>
347d87efa8Sjmcp #include <sys/iommulib.h>
357d87efa8Sjmcp 
367d87efa8Sjmcp #ifdef _KERNEL
377d87efa8Sjmcp 
387d87efa8Sjmcp typedef struct amd_iommu_state {
397d87efa8Sjmcp 	int	aioms_instance;			/* instance */
407d87efa8Sjmcp 	dev_info_t *aioms_devi;			/* dip */
417d87efa8Sjmcp 	struct amd_iommu *aioms_iommu_start;	/* start of list of IOMMUs */
427d87efa8Sjmcp 	struct amd_iommu *aioms_iommu_end;	/* end of list of IOMMUs */
437d87efa8Sjmcp 	int aioms_nunits;			/* # of IOMMUs in function */
447d87efa8Sjmcp } amd_iommu_state_t;
457d87efa8Sjmcp 
46*ac48dfe8SVikram Hegde #define	AMD_IOMMU_QUIESCE	(0)
47*ac48dfe8SVikram Hegde #define	AMD_IOMMU_TEARDOWN	(1)
48*ac48dfe8SVikram Hegde 
497d87efa8Sjmcp 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);
517d87efa8Sjmcp int amd_iommu_lookup_src_bdf(uint16_t bdf, uint16_t *src_bdfp);
527d87efa8Sjmcp 
537d87efa8Sjmcp #endif	/* _KERNEL */
547d87efa8Sjmcp 
557d87efa8Sjmcp #ifdef	__cplusplus
567d87efa8Sjmcp }
577d87efa8Sjmcp #endif
587d87efa8Sjmcp 
597d87efa8Sjmcp #endif	/* _SYS_AMD_IOMMU_H */
60