[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v2 5/6] ide: Add silent DRQ cancellation
From: |
John Snow |
Subject: |
[Qemu-block] [PATCH v2 5/6] ide: Add silent DRQ cancellation |
Date: |
Tue, 19 Jan 2016 12:39:50 -0500 |
Split apart the ide_transfer_stop function into two versions: one that
interrupts and one that doesn't. The one that doesn't can be used to
halt any PIO transfers that are in the DRQ phase. It will not halt
any PIO transfers that are currently in the process of buffering data
for the guest to read.
Signed-off-by: John Snow <address@hidden>
---
hw/ide/core.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/hw/ide/core.c b/hw/ide/core.c
index cf0b5ec..9bc8e58 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -486,13 +486,26 @@ static void ide_cmd_done(IDEState *s)
}
}
-void ide_transfer_stop(IDEState *s)
+static void ide_transfer_halt(IDEState *s, void(*etf)(IDEState *), bool notify)
{
- s->end_transfer_func = ide_transfer_stop;
+ s->end_transfer_func = etf;
s->data_ptr = s->io_buffer;
s->data_end = s->io_buffer;
s->status &= ~DRQ_STAT;
- ide_cmd_done(s);
+ if (notify) {
+ ide_cmd_done(s);
+ }
+}
+
+void ide_transfer_stop(IDEState *s)
+{
+ ide_transfer_halt(s, ide_transfer_stop, true);
+}
+
+__attribute__((__unused__))
+static void ide_transfer_cancel(IDEState *s)
+{
+ ide_transfer_halt(s, ide_transfer_cancel, false);
}
int64_t ide_get_sector(IDEState *s)
--
2.4.3
- [Qemu-block] [PATCH v2 0/6] ide: fix atapi software reset, John Snow, 2016/01/19
- [Qemu-block] [PATCH v2 1/6] ide: Prohibit RESET on IDE drives, John Snow, 2016/01/19
- [Qemu-block] [PATCH v2 2/6] ide: code motion, John Snow, 2016/01/19
- [Qemu-block] [PATCH v2 4/6] ide: replace blk_drain_all by blk_drain, John Snow, 2016/01/19
- [Qemu-block] [PATCH v2 5/6] ide: Add silent DRQ cancellation,
John Snow <=
- [Qemu-block] [PATCH v2 3/6] ide: move buffered DMA cancel to core, John Snow, 2016/01/19
- [Qemu-block] [PATCH v2 6/6] ide: fix device_reset to not ignore pending AIO, John Snow, 2016/01/19
- Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/6] ide: fix atapi software reset, John Snow, 2016/01/26