* [Qemu-devel] [PATCH] FDC: Fix data transfer len
@ 2008-04-29 17:15 Hervé Poussineau
0 siblings, 0 replies; only message in thread
From: Hervé Poussineau @ 2008-04-29 17:15 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 232 bytes --]
Hi,
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.
Attached patch fixes this issue.
Hervé
[-- Attachment #2: fdc_data_len.diff --]
[-- Type: text/plain, Size: 562 bytes --]
Index: hw/fdc.c
===================================================================
--- hw/fdc.c (revision 4290)
+++ hw/fdc.c (working copy)
@@ -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];
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-04-29 17:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-29 17:15 [Qemu-devel] [PATCH] FDC: Fix data transfer len Hervé Poussineau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).