aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-01 19:05:12 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-01 19:05:12 +0000
commit771effeb8d49aaf4d1a39c0be5e4b722d22427ec (patch)
tree6f3b516be0f47cae69e45f51f7ee7008d32427cd /hw
parentb3bc154098f211db7014de151c79b4234ae5029b (diff)
FDC: Fix data transfer len (Hervé 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. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4294 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/fdc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/fdc.c b/hw/fdc.c
index e47a1da902..cd00420bd5 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -1137,9 +1137,9 @@ static void fdctrl_start_transfer (fdctrl_t *fdctrl, int direction)
} 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];