mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
pcihp: make bridge describe itself using AcpiDevAmlIfClass:build_dev_aml
simplify build_append_pci_bus_devices() a bit by handling bridge specific logic in bridge dedicated AcpiDevAmlIfClass::build_dev_aml callback. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-30-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
d78644c781
commit
6c36ec46b0
8 changed files with 70 additions and 16 deletions
|
@ -37,6 +37,7 @@
|
|||
#include "qemu/range.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/acpi/acpi_aml_interface.h"
|
||||
#include "hw/acpi/pci.h"
|
||||
|
||||
/* PCI bridge subsystem vendor ID helper functions */
|
||||
#define PCI_SSVID_SIZEOF 8
|
||||
|
@ -468,10 +469,18 @@ int pci_bridge_qemu_reserve_cap_init(PCIDevice *dev, int cap_offset,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void pci_bridge_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(klass);
|
||||
|
||||
adevc->build_dev_aml = build_pci_bridge_aml;
|
||||
}
|
||||
|
||||
static const TypeInfo pci_bridge_type_info = {
|
||||
.name = TYPE_PCI_BRIDGE,
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIBridge),
|
||||
.class_init = pci_bridge_class_init,
|
||||
.abstract = true,
|
||||
.interfaces = (InterfaceInfo[]) {
|
||||
{ TYPE_ACPI_DEV_AML_IF },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue