summaryrefslogtreecommitdiffstats
path: root/hw/ide/isa.c
diff options
context:
space:
mode:
authorBlue Swirl2009-11-07 15:13:05 +0100
committerBlue Swirl2009-11-07 15:13:05 +0100
commit4a6435639781214a14f3c6054955e5ef16298d72 (patch)
treefb4d38641d83dc4bf98b56aa91a0d070db0ae425 /hw/ide/isa.c
parentuser: move CPU reset call to main.c for x86/PPC/Sparc (diff)
downloadqemu-4a6435639781214a14f3c6054955e5ef16298d72.tar.gz
qemu-4a6435639781214a14f3c6054955e5ef16298d72.tar.xz
qemu-4a6435639781214a14f3c6054955e5ef16298d72.zip
IDE: Fix reset handling
Problem: x86 systems could not survive a few system_resets. Clear most of IDE state when reset. Implement the missing reset handlers. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/ide/isa.c')
-rw-r--r--hw/ide/isa.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/ide/isa.c b/hw/ide/isa.c
index fe67bcdf7c..dff7c796f7 100644
--- a/hw/ide/isa.c
+++ b/hw/ide/isa.c
@@ -44,6 +44,13 @@ typedef struct ISAIDEState {
qemu_irq irq;
} ISAIDEState;
+static void isa_ide_reset(DeviceState *d)
+{
+ ISAIDEState *s = container_of(d, ISAIDEState, dev.qdev);
+
+ ide_bus_reset(&s->bus);
+}
+
static const VMStateDescription vmstate_ide_isa = {
.name = "isa-ide",
.version_id = 3,
@@ -93,6 +100,7 @@ static ISADeviceInfo isa_ide_info = {
.qdev.name = "isa-ide",
.qdev.size = sizeof(ISAIDEState),
.init = isa_ide_initfn,
+ .qdev.reset = isa_ide_reset,
.qdev.props = (Property[]) {
DEFINE_PROP_HEX32("iobase", ISAIDEState, iobase, 0x1f0),
DEFINE_PROP_HEX32("iobase2", ISAIDEState, iobase2, 0x3f6),