]> Git Repo - qemu.git/commitdiff
fdc: Fix floppy port I/O
authorKevin Wolf <[email protected]>
Tue, 18 Oct 2011 14:41:45 +0000 (16:41 +0200)
committerKevin Wolf <[email protected]>
Fri, 21 Oct 2011 15:34:13 +0000 (17:34 +0200)
The floppy device was broken by commit 212ec7ba (fdc: Convert to
isa_register_portio_list). While the old interface provided the port number
relative to the floppy drive's io_base, the new one provides the real port
number, so we need to apply a bitmask now to get the register number.

Signed-off-by: Kevin Wolf <[email protected]>
hw/fdc.c

index 4b06e049e824d971d494a02c1a8d5430d4209757..f8af2de2cee965b72fbae84c5ac4802fd3d2f375 100644 (file)
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -434,6 +434,7 @@ static uint32_t fdctrl_read (void *opaque, uint32_t reg)
     FDCtrl *fdctrl = opaque;
     uint32_t retval;
 
+    reg &= 7;
     switch (reg) {
     case FD_REG_SRA:
         retval = fdctrl_read_statusA(fdctrl);
@@ -471,6 +472,7 @@ static void fdctrl_write (void *opaque, uint32_t reg, uint32_t value)
 
     FLOPPY_DPRINTF("write reg%d: 0x%02x\n", reg & 7, value);
 
+    reg &= 7;
     switch (reg) {
     case FD_REG_DOR:
         fdctrl_write_dor(fdctrl, value);
This page took 0.026997 seconds and 4 git commands to generate.