x86-iommu.c (206d0c24361a083fbdcb2cc86fb75dc8b7f251a2) | x86-iommu.c (fb9f592623b0f9bb82a88d68d7921fb581918ef5) |
---|---|
1/* 2 * QEMU emulation of common X86 IOMMU 3 * 4 * Copyright (C) 2016 Peter Xu, Red Hat <peterx@redhat.com> 5 * 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 --- 57 unchanged lines hidden (view full) --- 66 x86_iommu_default = x86_iommu; 67} 68 69X86IOMMUState *x86_iommu_get_default(void) 70{ 71 return x86_iommu_default; 72} 73 | 1/* 2 * QEMU emulation of common X86 IOMMU 3 * 4 * Copyright (C) 2016 Peter Xu, Red Hat <peterx@redhat.com> 5 * 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 --- 57 unchanged lines hidden (view full) --- 66 x86_iommu_default = x86_iommu; 67} 68 69X86IOMMUState *x86_iommu_get_default(void) 70{ 71 return x86_iommu_default; 72} 73 |
74IommuType x86_iommu_get_type(void) 75{ 76 return x86_iommu_default->type; 77} 78 |
|
74static void x86_iommu_realize(DeviceState *dev, Error **errp) 75{ 76 X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(dev); 77 X86IOMMUClass *x86_class = X86_IOMMU_GET_CLASS(dev); 78 QLIST_INIT(&x86_iommu->iec_notifiers); 79 if (x86_class->realize) { 80 x86_class->realize(dev, errp); 81 } | 79static void x86_iommu_realize(DeviceState *dev, Error **errp) 80{ 81 X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(dev); 82 X86IOMMUClass *x86_class = X86_IOMMU_GET_CLASS(dev); 83 QLIST_INIT(&x86_iommu->iec_notifiers); 84 if (x86_class->realize) { 85 x86_class->realize(dev, errp); 86 } |
87 |
|
82 x86_iommu_set_default(X86_IOMMU_DEVICE(dev)); 83} 84 85static void x86_iommu_class_init(ObjectClass *klass, void *data) 86{ 87 DeviceClass *dc = DEVICE_CLASS(klass); 88 dc->realize = x86_iommu_realize; 89} --- 39 unchanged lines hidden --- | 88 x86_iommu_set_default(X86_IOMMU_DEVICE(dev)); 89} 90 91static void x86_iommu_class_init(ObjectClass *klass, void *data) 92{ 93 DeviceClass *dc = DEVICE_CLASS(klass); 94 dc->realize = x86_iommu_realize; 95} --- 39 unchanged lines hidden --- |