int acpi_pcihp_device_hotplug(AcpiPciHpState *s, PCIDevice *dev,

                              PCIHotplugState state)

{

    int slot = PCI_SLOT(dev->devfn);

    int bsel = acpi_pcihp_get_bsel(dev->bus);

    if (bsel < 0) {

        return -1;

    }



    /* Don't send event when device is enabled during qemu machine creation:

     * it is present on boot, no hotplug event is necessary. We do send an

     * event when the device is disabled later. */

    if (state == PCI_COLDPLUG_ENABLED) {

        s->acpi_pcihp_pci_status[bsel].device_present |= (1U << slot);

        return 0;

    }



    if (state == PCI_HOTPLUG_ENABLED) {

        enable_device(s, bsel, slot);

    } else {

        disable_device(s, bsel, slot);

    }



    return 0;

}

int acpi_pcihp_device_hotplug(AcpiPciHpState *s, PCIDevice *dev,

                              PCIHotplugState state)

{

    int slot = PCI_SLOT(dev->devfn);

    int bsel = acpi_pcihp_get_bsel(dev->bus);

    if (bsel < 0) {

        return -1;

    }



    





    if (state == PCI_COLDPLUG_ENABLED) {

        s->acpi_pcihp_pci_status[bsel].device_present |= (1U << slot);

        return 0;

    }



    if (state == PCI_HOTPLUG_ENABLED) {

        enable_device(s, bsel, slot);

    } else {

        disable_device(s, bsel, slot);

    }



    return 0;

}

int FUNC_0(AcpiPciHpState *VAR_0, PCIDevice *VAR_1,

                              PCIHotplugState VAR_2)

{

    int VAR_3 = PCI_SLOT(VAR_1->devfn);

    int VAR_4 = acpi_pcihp_get_bsel(VAR_1->bus);

    if (VAR_4 < 0) {

        return -1;

    }



    





    if (VAR_2 == PCI_COLDPLUG_ENABLED) {

        VAR_0->acpi_pcihp_pci_status[VAR_4].device_present |= (1U << VAR_3);

        return 0;

    }



    if (VAR_2 == PCI_HOTPLUG_ENABLED) {

        enable_device(VAR_0, VAR_4, VAR_3);

    } else {

        disable_device(VAR_0, VAR_4, VAR_3);

    }



    return 0;

}

int FUNC_0(AcpiPciHpState *VAR_0, PCIDevice *VAR_1,
PCIHotplugState VAR_2)
{ int VAR_3 = PCI_SLOT(VAR_1->devfn); int VAR_4 = acpi_pcihp_get_bsel(VAR_1->bus); if (VAR_4 < 0) { return -1; } if (VAR_2 == PCI_COLDPLUG_ENABLED) { VAR_0->acpi_pcihp_pci_status[VAR_4].device_present |= (1U << VAR_3); return 0; } if (VAR_2 == PCI_HOTPLUG_ENABLED) { enable_device(VAR_0, VAR_4, VAR_3); } else { disable_device(VAR_0, VAR_4, VAR_3); } return 0; }