aboutsummaryrefslogtreecommitdiff
path: root/hw/piix_pci.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-06-17 19:32:01 +0300
committerBlue Swirl <blauwirbel@gmail.com>2009-06-17 17:05:32 +0000
commit15a1956af94e36105494f782a752698103addf63 (patch)
tree93408f5207d30fb1b791b5d849638d5e3774db3c /hw/piix_pci.c
parentc8075ac370e08190271ed7b6b1b81e45160d4c2b (diff)
downloadqemu-15a1956af94e36105494f782a752698103addf63.zip
qemu-15a1956af94e36105494f782a752698103addf63.tar.gz
qemu-15a1956af94e36105494f782a752698103addf63.tar.bz2
Call piix3_reset() on system reset.
Also zero pci_irq_levels on reset to avoid stuck irq after reset. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Yaniv Kamay <ykamay@redhat.com>
Diffstat (limited to 'hw/piix_pci.c')
-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 914a65a..ff2cbde 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -232,8 +232,9 @@ static void piix3_set_irq(qemu_irq *pic, int irq_num, int level)
}
}
-static void piix3_reset(PCIDevice *d)
+static void piix3_reset(void *opaque)
{
+ PCIDevice *d = opaque;
uint8_t *pci_conf = d->config;
pci_conf[0x04] = 0x07; // master, memory and I/O
@@ -267,6 +268,8 @@ static void piix3_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 piix4_reset(PCIDevice *d)
@@ -339,6 +342,7 @@ int piix3_init(PCIBus *bus, int devfn)
PCI_HEADER_TYPE_NORMAL | PCI_HEADER_TYPE_MULTI_FUNCTION; // header_type = PCI_multifunction, generic
piix3_reset(d);
+ qemu_register_reset(piix3_reset, 0, d);
return d->devfn;
}