aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2024-01-12 12:52:58 +0000
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2024-02-13 19:37:09 +0000
commitc5d7df28ea9f83b73608afb0ed6fb75773ebe7ca (patch)
treeae90c75f6f91090d07541958dedfd37a2e08a425
parent1bcaf71b41120acce0803c06dd48750e54583ce2 (diff)
downloadqemu-c5d7df28ea9f83b73608afb0ed6fb75773ebe7ca.zip
qemu-c5d7df28ea9f83b73608afb0ed6fb75773ebe7ca.tar.gz
qemu-c5d7df28ea9f83b73608afb0ed6fb75773ebe7ca.tar.bz2
esp.c: update esp_set_tc() to set STAT_TC flag
This flag is set once the transfer counter counts down to zero. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Tested-by: Helge Deller <deller@gmx.de> Tested-by: Thomas Huth <thuth@redhat.com> Message-Id: <20240112125420.514425-7-mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
-rw-r--r--hw/scsi/esp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 8c1c6bf..c7b79a2 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -161,9 +161,15 @@ static uint32_t esp_get_tc(ESPState *s)
static void esp_set_tc(ESPState *s, uint32_t dmalen)
{
+ uint32_t old_tc = esp_get_tc(s);
+
s->rregs[ESP_TCLO] = dmalen;
s->rregs[ESP_TCMID] = dmalen >> 8;
s->rregs[ESP_TCHI] = dmalen >> 16;
+
+ if (old_tc && dmalen == 0) {
+ s->rregs[ESP_RSTAT] |= STAT_TC;
+ }
}
static uint32_t esp_get_stc(ESPState *s)