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