From: Gleb Natapov <gleb@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/3] Call piix3_reset() on system reset.
Date: Wed, 17 Jun 2009 19:32:01 +0300 [thread overview]
Message-ID: <1245256322-30990-2-git-send-email-gleb@redhat.com> (raw)
In-Reply-To: <1245256322-30990-1-git-send-email-gleb@redhat.com>
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>
---
hw/piix_pci.c | 6 +++++-
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;
}
--
1.6.2.1
next prev parent reply other threads:[~2009-06-17 16:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-17 16:32 [Qemu-devel] [PATCH 1/3] Add pci_bus_reset() function Gleb Natapov
2009-06-17 16:32 ` Gleb Natapov [this message]
2009-06-17 17:10 ` [Qemu-devel] [PATCH 2/3] Call piix3_reset() on system reset Blue Swirl
2009-06-18 6:02 ` Gleb Natapov
2009-06-17 16:32 ` [Qemu-devel] [PATCH 3/3] Register usb-uhci reset function Gleb Natapov
2009-06-17 17:11 ` Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1245256322-30990-2-git-send-email-gleb@redhat.com \
--to=gleb@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).