summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-06-17 17:36:51 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-06-17 17:36:51 +0000
commit9c6d5431a3e7efcc41ea61ee294bbd41cbd65262 (patch)
tree30ff7599f270c87701235d5f53c97ad9f22a812c /hw
parent98defec35043f6c102b7580249922c78bfbed7f4 (diff)
downloadqemu-9c6d5431a3e7efcc41ea61ee294bbd41cbd65262.tar.gz
qemu-9c6d5431a3e7efcc41ea61ee294bbd41cbd65262.tar.bz2
qemu-9c6d5431a3e7efcc41ea61ee294bbd41cbd65262.zip
Call piix4_reset() on system reset.
Also zero pci_irq_levels on reset to avoid stuck irq after reset. Based on 15a1956af94e36105494f782a752698103addf63 by Gleb Natapov. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/piix_pci.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index ff2cbde6ba..67e63096db 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -272,8 +272,9 @@ static void piix3_reset(void *opaque)
memset(pci_irq_levels, 0, sizeof(pci_irq_levels));
}
-static void piix4_reset(PCIDevice *d)
+static void piix4_reset(void *opaque)
{
+ PCIDevice *d = opaque;
uint8_t *pci_conf = d->config;
pci_conf[0x04] = 0x07; // master, memory and I/O
@@ -307,6 +308,8 @@ static void piix4_reset(PCIDevice *d)
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)
@@ -366,5 +369,6 @@ int piix4_init(PCIBus *bus, int devfn)
piix4_reset(d);
+ qemu_register_reset(piix4_reset, 0, d);
return d->devfn;
}