From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RHIhp-0006PQ-CS for qemu-devel@nongnu.org; Fri, 21 Oct 2011 13:16:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RHIhn-0002fI-4l for qemu-devel@nongnu.org; Fri, 21 Oct 2011 13:16:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RHIhm-0002f3-O0 for qemu-devel@nongnu.org; Fri, 21 Oct 2011 13:16:27 -0400 From: Kevin Wolf Date: Fri, 21 Oct 2011 19:19:06 +0200 Message-Id: <1319217556-28273-10-git-send-email-kwolf@redhat.com> In-Reply-To: <1319217556-28273-1-git-send-email-kwolf@redhat.com> References: <1319217556-28273-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 09/19] fdc: Fix floppy port I/O List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org 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 --- hw/fdc.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/fdc.c b/hw/fdc.c index 4b06e04..f8af2de 100644 --- 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); -- 1.7.6.4