@@ -63,8 +63,6 @@ static int pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num)
return (irq_num + slot_addend) & 3;
}
-static int pci_irq_levels[4];
-
static void update_pam(PCII440FXState *d, uint32_t start, uint32_t end, int r)
{
uint32_t addr;
@@ -177,6 +175,13 @@ static int i440fx_load(QEMUFile* f, void *opaque, int version_id)
return 0;
}
+static void i440fx_reset(void *opaque)
+{
+ PCII440FXState *d = opaque;
+
+ memset(d->pci_irq_levels, 0, sizeof(d->pci_irq_levels));
+}
+
static void i440fx_pcihost_initfn(SysBusDevice *dev)
{
I440FXState *s = FROM_SYSBUS(I440FXState, dev);
@@ -205,6 +210,9 @@ static void i440fx_initfn(PCIDevice *dev)
d->dev.config[0x72] = 0x02; /* SMRAM */
register_savevm("I440FX", 0, 2, i440fx_save, i440fx_load, d);
+
+ i440fx_reset(d);
+ qemu_register_reset(i440fx_reset, d);
}
PCIBus *i440fx_init(PCII440FXState **pi440fx_state, qemu_irq *pic)
@@ -288,8 +296,6 @@ static void piix3_reset(void *opaque)
pci_conf[0xab] = 0x00;
pci_conf[0xac] = 0x00;
pci_conf[0xae] = 0x00;
-
- memset(pci_irq_levels, 0, sizeof(pci_irq_levels));
}
static void piix_save(QEMUFile* f, void *opaque)
Do there in a new reset function. Signed-off-by: Juan Quintela <quintela@redhat.com> --- hw/piix_pci.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-)