esp: On qemu-system-sparc's esp, TC is not set properly

Submitted by Olivier DANET on Oct. 2, 2012, 8:46 p.m.

Details

Message ID 20121002204651.222950@gmx.com
State New
Headers show

Commit Message

Olivier DANET Oct. 2, 2012, 8:46 p.m.
Could you please try this patch. The TC (count to zero) flag is wrongly
cleared after reading the RINTR register. (contradicting the comment
just above the patch in the source file.)

Regards
Olivier

Patch hide | download patch | download mbox

diff --rup a/hw/esp.c b/hw/esp.c
--- a/hw/esp.c  2012-10-01 22:06:39.000000000 +0200
+++ b/hw/esp.c  2012-10-02 22:22:53.000000000 +0200
@@ -417,9 +417,9 @@  uint64_t esp_reg_read(ESPState *s, uint3
            except TC */
         old_val = s->rregs[ESP_RINTR];
         s->rregs[ESP_RINTR] = 0;
-        s->rregs[ESP_RSTAT] &= ~STAT_TC;
         s->rregs[ESP_RSEQ] = SEQ_CD;
         esp_lower_irq(s);
+        s->rregs[ESP_RSTAT] &= STAT_TC | STAT_MI;
 
         return old_val;
     default: