aboutsummaryrefslogtreecommitdiff
path: root/hw/ide/isa.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-11-07 14:13:05 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-11-07 14:13:05 +0000
commit4a6435639781214a14f3c6054955e5ef16298d72 (patch)
treefb4d38641d83dc4bf98b56aa91a0d070db0ae425 /hw/ide/isa.c
parentb55a37c981914aa8ecd21b9a2a2fb37f39b917c5 (diff)
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),