Skip to contentSkip to conversation

[4294] FDC: Fix data transfer len (Herv?\195?\169 Poussineau)

Qemu-devel Blue Swirl 1 participant 1 message May 1, 2008

lore
Share & tools
lore

Blue Swirl

author
#0 lore raw

Revision: 4294

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4294
Author:   blueswir1
Date:     2008-05-01 19:05:12 +0000 (Thu, 01 May 2008)

Log Message:
-----------
FDC: Fix data transfer len (Herv?\195?\169 Poussineau)

In floppy controller, transfer data len is not correctly calculated. We should read up to the last sector specified by the caller, and not up to the last sector of the floppy.

Modified Paths:
--------------
trunk/hw/fdc.c

Modified: trunk/hw/fdc.c
===================================================================

hw/fdc.c +2 -2
@@ -1137,9 +1137,9 @@
     } else {
         int tmp;
         fdctrl->data_len = 128 << (fdctrl->fifo[5] > 7 ? 7 : fdctrl->fifo[5]);
-        tmp = (cur_drv->last_sect - ks + 1);
+        tmp = (fdctrl->fifo[6] - ks + 1);
         if (fdctrl->fifo[0] & 0x80)
-            tmp += cur_drv->last_sect;
+            tmp += fdctrl->fifo[6];
         fdctrl->data_len *= tmp;
     }
     fdctrl->eot = fdctrl->fifo[6];