diff options
author | John Snow <jsnow@redhat.com> | 2016-02-10 13:29:39 -0500 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:41:57 -0600 |
commit | b66255f2cec75f153bc2f3e428e1134820fc8fc0 (patch) | |
tree | 8c36ecdc0ec1f12f69e8c267c761a866d584b599 /hw/ide/core.c | |
parent | a9ad46cd7c23a779ca2af8a9c9ebc6e1c1a1a690 (diff) | |
download | hqemu-b66255f2cec75f153bc2f3e428e1134820fc8fc0.zip hqemu-b66255f2cec75f153bc2f3e428e1134820fc8fc0.tar.gz |
ide: Add silent DRQ cancellation
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 <jsnow@redhat.com>
Reported-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[Renamed 'etf' to 'end_transfer_func' --js]
Message-id: 1453225191-11871-6-git-send-email-jsnow@redhat.com
Diffstat (limited to 'hw/ide/core.c')
-rw-r--r-- | hw/ide/core.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c index 40b6cc8..3c32b39 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -487,13 +487,28 @@ static void ide_cmd_done(IDEState *s) } } -void ide_transfer_stop(IDEState *s) +static void ide_transfer_halt(IDEState *s, + void(*end_transfer_func)(IDEState *), + bool notify) { - s->end_transfer_func = ide_transfer_stop; + s->end_transfer_func = end_transfer_func; 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) |