Skip to contentSkip to conversation

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

PATCH [email protected] 1 participant 1 message Oct 2, 2012

lore
Share & tools
lore
#0 lore raw

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

hw/esp.c  2012-10-02 22:22:53.000000000 +0200 renamed from hw/esp.c  2012-10-01 22:06:39.000000000 +0200 +1 -1
diff --rup a/hw/esp.c b/hw/esp.c
@@ -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: