aboutsummaryrefslogtreecommitdiff
path: root/hw/acpi/pcihp.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2016-05-31 12:01:17 +0200
committerMichael S. Tsirkin <mst@redhat.com>2016-06-07 15:36:54 +0300
commit0058c0823815d33c96f4f26106dbd713c76280e1 (patch)
tree8d9cf683255fa4ebd50eb23e94ef0883a6c96e5d /hw/acpi/pcihp.c
parenteaf23bf794c749c621a5605c1076a16e3d81e12b (diff)
downloadqemu-0058c0823815d33c96f4f26106dbd713c76280e1.zip
qemu-0058c0823815d33c96f4f26106dbd713c76280e1.tar.gz
qemu-0058c0823815d33c96f4f26106dbd713c76280e1.tar.bz2
pc: use AcpiDeviceIfClass.send_event to issue GPE events
it reduces number of args passed in handlers by 1 and a number of used proxy wrappers saving ~20LOC. Also it allows to make cpu/mem hotplug code more universal as it would allow ARM to reuse it without rewrite by providing its own send_event callback to trigger events usiong GPIO instead of GPE as fixed hadrware ACPI model doen't have GPE at all. 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 'hw/acpi/pcihp.c')
-rw-r--r--hw/acpi/pcihp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index 71f4c4e..d957d1e 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -182,7 +182,7 @@ void acpi_pcihp_reset(AcpiPciHpState *s)
acpi_pcihp_update(s);
}
-void acpi_pcihp_device_plug_cb(ACPIREGS *ar, qemu_irq irq, AcpiPciHpState *s,
+void acpi_pcihp_device_plug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState *s,
DeviceState *dev, Error **errp)
{
PCIDevice *pdev = PCI_DEVICE(dev);
@@ -202,11 +202,10 @@ void acpi_pcihp_device_plug_cb(ACPIREGS *ar, qemu_irq irq, AcpiPciHpState *s,
}
s->acpi_pcihp_pci_status[bsel].up |= (1U << slot);
-
- acpi_send_gpe_event(ar, irq, ACPI_PCI_HOTPLUG_STATUS);
+ acpi_send_event(DEVICE(hotplug_dev), ACPI_PCI_HOTPLUG_STATUS);
}
-void acpi_pcihp_device_unplug_cb(ACPIREGS *ar, qemu_irq irq, AcpiPciHpState *s,
+void acpi_pcihp_device_unplug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState *s,
DeviceState *dev, Error **errp)
{
PCIDevice *pdev = PCI_DEVICE(dev);
@@ -219,8 +218,7 @@ void acpi_pcihp_device_unplug_cb(ACPIREGS *ar, qemu_irq irq, AcpiPciHpState *s,
}
s->acpi_pcihp_pci_status[bsel].down |= (1U << slot);
-
- acpi_send_gpe_event(ar, irq, ACPI_PCI_HOTPLUG_STATUS);
+ acpi_send_event(DEVICE(hotplug_dev), ACPI_PCI_HOTPLUG_STATUS);
}
static uint64_t pci_read(void *opaque, hwaddr addr, unsigned int size)