From c24d5e0b91d138f8cc95f5694d4964de36a739d3 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Wed, 5 Feb 2014 16:36:49 +0100 Subject: acpi/piix4pm: convert ACPI PCI hotplug to use hotplug-handler API Split piix4_device_hotplug() into hotplug/unplug callbacks and register them as "hotplug-handler" interface implementation of PIIX4_PM device. Replace pci_bus_hotplug() wiring with setting link on PCI BUS "hotplug-handler" property to PIIX4_PM device. Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/acpi.h | 1 + include/hw/acpi/pcihp.h | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h index 3e53297..a9fae9d 100644 --- a/include/hw/acpi/acpi.h +++ b/include/hw/acpi/acpi.h @@ -24,6 +24,7 @@ #include "qemu/notify.h" #include "qemu/option.h" #include "exec/memory.h" +#include "hw/irq.h" /* from linux include/acpi/actype.h */ /* Default ACPI register widths */ diff --git a/include/hw/acpi/pcihp.h b/include/hw/acpi/pcihp.h index 0a90e4a..9323838 100644 --- a/include/hw/acpi/pcihp.h +++ b/include/hw/acpi/pcihp.h @@ -29,7 +29,8 @@ #include #include -#include "hw/pci/pci.h" /* for PCIHotplugState */ +#include "hw/acpi/acpi.h" +#include "migration/vmstate.h" typedef struct AcpiPciHpPciStatus { uint32_t up; @@ -52,9 +53,10 @@ typedef struct AcpiPciHpState { void acpi_pcihp_init(AcpiPciHpState *, PCIBus *root, MemoryRegion *address_space_io, bool bridges_enabled); -/* Invoke on device hotplug */ -int acpi_pcihp_device_hotplug(AcpiPciHpState *, PCIDevice *, - PCIHotplugState state); +void acpi_pcihp_device_plug_cb(ACPIREGS *ar, qemu_irq irq, AcpiPciHpState *s, + DeviceState *dev, Error **errp); +void acpi_pcihp_device_unplug_cb(ACPIREGS *ar, qemu_irq irq, AcpiPciHpState *s, + DeviceState *dev, Error **errp); /* Called on reset */ void acpi_pcihp_reset(AcpiPciHpState *s); -- cgit v1.1