qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/3] fdc: Fix false FD_SR0_SEEK


From: Kevin Wolf
Subject: [Qemu-devel] [PATCH 2/3] fdc: Fix false FD_SR0_SEEK
Date: Tue, 4 Sep 2012 11:46:55 +0200

fdctrl_start/stop_transfer() used to set FD_SR0_SEEK no matter if
there actually was a seek or not. This is obviously wrong.

fdctrl_start_transfer() has this information because it performs the
seek itself. fdctrl_stop_transfer() gets status0 passed and callers
already take care of setting FD_SR0_SEEK where appropriate.

Signed-off-by: Kevin Wolf <address@hidden>
---
 hw/fdc.c         |    5 ++---
 tests/fdc-test.c |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/hw/fdc.c b/hw/fdc.c
index 78ae064..8ea3341 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -1149,8 +1149,7 @@ static void fdctrl_stop_transfer(FDCtrl *fdctrl, uint8_t 
status0,
     FDrive *cur_drv;
 
     cur_drv = get_cur_drv(fdctrl);
-    fdctrl->status0 = status0 | FD_SR0_SEEK | (cur_drv->head << 2) |
-                      GET_CUR_DRV(fdctrl);
+    fdctrl->status0 = status0 | (cur_drv->head << 2) | GET_CUR_DRV(fdctrl);
 
     FLOPPY_DPRINTF("transfer status: %02x %02x %02x (%02x)\n",
                    status0, status1, status2, fdctrl->status0);
@@ -1284,7 +1283,7 @@ static void fdctrl_start_transfer(FDCtrl *fdctrl, int 
direction)
     if (direction != FD_DIR_WRITE)
         fdctrl->msr |= FD_MSR_DIO;
     /* IO based transfer: calculate len */
-    fdctrl_raise_irq(fdctrl, FD_SR0_SEEK);
+    fdctrl_raise_irq(fdctrl, did_seek ? FD_SR0_SEEK : 0);
 
     return;
 }
diff --git a/tests/fdc-test.c b/tests/fdc-test.c
index fa74411..ff96560 100644
--- a/tests/fdc-test.c
+++ b/tests/fdc-test.c
@@ -152,7 +152,7 @@ static uint8_t send_read_command(void)
     }
 
     st0 = floppy_recv();
-    if (st0 != 0x60) {
+    if (st0 != 0x40) {
         ret = 1;
     }
 
-- 
1.7.6.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]