summaryrefslogtreecommitdiffstats
path: root/hw/ide/mmio.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/mmio.c
parentb55a37c981914aa8ecd21b9a2a2fb37f39b917c5 (diff)
downloadhqemu-4a6435639781214a14f3c6054955e5ef16298d72.zip
hqemu-4a6435639781214a14f3c6054955e5ef16298d72.tar.gz
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/mmio.c')
-rw-r--r--hw/ide/mmio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/ide/mmio.c b/hw/ide/mmio.c
index 84a20e5..cca883f 100644
--- a/hw/ide/mmio.c
+++ b/hw/ide/mmio.c
@@ -41,6 +41,13 @@ typedef struct {
int shift;
} MMIOState;
+static void mmio_ide_reset(void *opaque)
+{
+ MMIOState *s = opaque;
+
+ ide_bus_reset(&s->bus);
+}
+
static uint32_t mmio_ide_read (void *opaque, target_phys_addr_t addr)
{
MMIOState *s = opaque;
@@ -127,5 +134,6 @@ void mmio_ide_init (target_phys_addr_t membase, target_phys_addr_t membase2,
cpu_register_physical_memory(membase, 16 << shift, mem1);
cpu_register_physical_memory(membase2, 2 << shift, mem2);
vmstate_register(0, &vmstate_ide_mmio, s);
+ qemu_register_reset(mmio_ide_reset, s);
}
OpenPOWER on IntegriCloud