Revision 9d5e77a2 hw/acpi.c

b/hw/acpi.c
714 714
#endif
715 715
}
716 716

  
717
void qemu_system_hot_add_init(void)
717
static void piix4_device_hot_add(int bus, int slot, int state);
718

  
719
void piix4_acpi_system_hot_add_init(void)
718 720
{
719 721
    register_ioport_write(GPE_BASE, 4, 1, gpe_writeb, &gpe);
720 722
    register_ioport_read(GPE_BASE, 4, 1,  gpe_readb, &gpe);
......
724 726

  
725 727
    register_ioport_write(PCI_EJ_BASE, 4, 4, pciej_write, NULL);
726 728
    register_ioport_read(PCI_EJ_BASE, 4, 4,  pciej_read, NULL);
729

  
730
    qemu_system_device_hot_add_register(piix4_device_hot_add);
727 731
}
728 732

  
729 733
static void enable_device(struct pci_status *p, struct gpe_regs *g, int slot)
......
738 742
    p->down |= (1 << slot);
739 743
}
740 744

  
741
void qemu_system_device_hot_add(int bus, int slot, int state)
745
static void piix4_device_hot_add(int bus, int slot, int state)
742 746
{
743 747
    pci0_status.up = 0;
744 748
    pci0_status.down = 0;
......
752 756
    }
753 757
}
754 758

  
759
static qemu_system_device_hot_add_t device_hot_add_callback;
760
void qemu_system_device_hot_add_register(qemu_system_device_hot_add_t callback)
761
{
762
    device_hot_add_callback = callback;
763
}
764

  
765
void qemu_system_device_hot_add(int pcibus, int slot, int state)
766
{
767
    if (device_hot_add_callback)
768
        device_hot_add_callback(pcibus, slot, state);
769
}
770

  
755 771
struct acpi_table_header
756 772
{
757 773
    char signature [4];    /* ACPI signature (4 ASCII characters) */

Also available in: Unified diff