1*1c7955c4SPeter Xu /* 2*1c7955c4SPeter Xu * Common IOMMU interface for X86 platform 3*1c7955c4SPeter Xu * 4*1c7955c4SPeter Xu * Copyright (C) 2016 Peter Xu, Red Hat <peterx@redhat.com> 5*1c7955c4SPeter Xu * 6*1c7955c4SPeter Xu * This program is free software; you can redistribute it and/or modify 7*1c7955c4SPeter Xu * it under the terms of the GNU General Public License as published by 8*1c7955c4SPeter Xu * the Free Software Foundation; either version 2 of the License, or 9*1c7955c4SPeter Xu * (at your option) any later version. 10*1c7955c4SPeter Xu 11*1c7955c4SPeter Xu * This program is distributed in the hope that it will be useful, 12*1c7955c4SPeter Xu * but WITHOUT ANY WARRANTY; without even the implied warranty of 13*1c7955c4SPeter Xu * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14*1c7955c4SPeter Xu * GNU General Public License for more details. 15*1c7955c4SPeter Xu 16*1c7955c4SPeter Xu * You should have received a copy of the GNU General Public License along 17*1c7955c4SPeter Xu * with this program; if not, see <http://www.gnu.org/licenses/>. 18*1c7955c4SPeter Xu */ 19*1c7955c4SPeter Xu 20*1c7955c4SPeter Xu #ifndef IOMMU_COMMON_H 21*1c7955c4SPeter Xu #define IOMMU_COMMON_H 22*1c7955c4SPeter Xu 23*1c7955c4SPeter Xu #include "hw/sysbus.h" 24*1c7955c4SPeter Xu 25*1c7955c4SPeter Xu #define TYPE_X86_IOMMU_DEVICE ("x86-iommu") 26*1c7955c4SPeter Xu #define X86_IOMMU_DEVICE(obj) \ 27*1c7955c4SPeter Xu OBJECT_CHECK(X86IOMMUState, (obj), TYPE_X86_IOMMU_DEVICE) 28*1c7955c4SPeter Xu #define X86_IOMMU_CLASS(klass) \ 29*1c7955c4SPeter Xu OBJECT_CLASS_CHECK(X86IOMMUClass, (klass), TYPE_X86_IOMMU_DEVICE) 30*1c7955c4SPeter Xu #define X86_IOMMU_GET_CLASS(obj) \ 31*1c7955c4SPeter Xu OBJECT_GET_CLASS(X86IOMMUClass, obj, TYPE_X86_IOMMU_DEVICE) 32*1c7955c4SPeter Xu 33*1c7955c4SPeter Xu typedef struct X86IOMMUState X86IOMMUState; 34*1c7955c4SPeter Xu typedef struct X86IOMMUClass X86IOMMUClass; 35*1c7955c4SPeter Xu 36*1c7955c4SPeter Xu struct X86IOMMUClass { 37*1c7955c4SPeter Xu SysBusDeviceClass parent; 38*1c7955c4SPeter Xu /* Intel/AMD specific realize() hook */ 39*1c7955c4SPeter Xu DeviceRealize realize; 40*1c7955c4SPeter Xu }; 41*1c7955c4SPeter Xu 42*1c7955c4SPeter Xu struct X86IOMMUState { 43*1c7955c4SPeter Xu SysBusDevice busdev; 44*1c7955c4SPeter Xu }; 45*1c7955c4SPeter Xu 46*1c7955c4SPeter Xu #endif 47