aboutsummaryrefslogtreecommitdiff
path: root/include/hw
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2014-02-05 16:36:49 +0100
committerMichael S. Tsirkin <mst@redhat.com>2014-02-10 10:27:00 +0200
commitc24d5e0b91d138f8cc95f5694d4964de36a739d3 (patch)
tree200c67b94eddeb1dd136ce02004b80d6e1a0589f /include/hw
parent2897ae026758eac78284ba6c3bd7732f3a1d9987 (diff)
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 <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/acpi/acpi.h1
-rw-r--r--include/hw/acpi/pcihp.h10
2 files changed, 7 insertions, 4 deletions
diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index 3e53297a99..a9fae9d5c5 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 0a90e4a968..9323838319 100644
--- a/include/hw/acpi/pcihp.h
+++ b/include/hw/acpi/pcihp.h
@@ -29,7 +29,8 @@
#include <inttypes.h>
#include <qemu/typedefs.h>
-#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);