aboutsummaryrefslogtreecommitdiff
path: root/hw/lsi53c895a.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2010-04-30 14:06:12 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-05-03 12:09:48 -0500
commit51336214da6f2eaa7baaa8efa1823377252c1496 (patch)
tree16ebf7235746ca3243bf33281107dfcac3f496a1 /hw/lsi53c895a.c
parent37905d6ae53d8a9f0744867a8cf2dad6e7ae3674 (diff)
lsi: Purge request queue on soft reset
Avoid keeping zombie requests across controller reset by purging the queue and also dropping the currently active request. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/lsi53c895a.c')
-rw-r--r--hw/lsi53c895a.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index 98b7f541ce..ad23ece7a0 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -283,6 +283,8 @@ static inline int lsi_irq_on_rsl(LSIState *s)
static void lsi_soft_reset(LSIState *s)
{
+ lsi_request *p;
+
DPRINTF("Reset\n");
s->carry = 0;
@@ -345,6 +347,15 @@ static void lsi_soft_reset(LSIState *s)
s->sbc = 0;
s->csbc = 0;
s->sbr = 0;
+ while (!QTAILQ_EMPTY(&s->queue)) {
+ p = QTAILQ_FIRST(&s->queue);
+ QTAILQ_REMOVE(&s->queue, p, next);
+ qemu_free(p);
+ }
+ if (s->current) {
+ qemu_free(s->current);
+ s->current = NULL;
+ }
}
static int lsi_dma_40bit(LSIState *s)