diff options
author | John Snow | 2017-09-18 21:01:26 +0200 |
---|---|---|
committer | John Snow | 2017-09-18 21:01:26 +0200 |
commit | 1787efc3d217ae513b45f7f965cdf3f751bc8c3c (patch) | |
tree | 612920baa75810cb2cbdd6f1b84583b133eab799 /hw/ide/core.c | |
parent | IDE: Add register hints to tracing (diff) | |
download | qemu-1787efc3d217ae513b45f7f965cdf3f751bc8c3c.tar.gz qemu-1787efc3d217ae513b45f7f965cdf3f751bc8c3c.tar.xz qemu-1787efc3d217ae513b45f7f965cdf3f751bc8c3c.zip |
IDE: add tracing for data ports
To be used sparingly, but still interesting in the case of small
firmwares designed to reproduce bugs in QEMU IDE.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20170901001502.29915-4-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'hw/ide/core.c')
-rw-r--r-- | hw/ide/core.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c index cb250e62be..82a19b1453 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2259,6 +2259,8 @@ void ide_data_writew(void *opaque, uint32_t addr, uint32_t val) IDEState *s = idebus_active_if(bus); uint8_t *p; + trace_ide_data_writew(addr, val, bus, s); + /* PIO data access allowed only when DRQ bit is set. The result of a write * during PIO out is indeterminate, just ignore it. */ if (!(s->status & DRQ_STAT) || ide_is_pio_out(s)) { @@ -2304,6 +2306,8 @@ uint32_t ide_data_readw(void *opaque, uint32_t addr) s->status &= ~DRQ_STAT; s->end_transfer_func(s); } + + trace_ide_data_readw(addr, ret, bus, s); return ret; } @@ -2313,6 +2317,8 @@ void ide_data_writel(void *opaque, uint32_t addr, uint32_t val) IDEState *s = idebus_active_if(bus); uint8_t *p; + trace_ide_data_writel(addr, val, bus, s); + /* PIO data access allowed only when DRQ bit is set. The result of a write * during PIO out is indeterminate, just ignore it. */ if (!(s->status & DRQ_STAT) || ide_is_pio_out(s)) { @@ -2343,7 +2349,8 @@ uint32_t ide_data_readl(void *opaque, uint32_t addr) /* PIO data access allowed only when DRQ bit is set. The result of a read * during PIO in is indeterminate, return 0 and don't move forward. */ if (!(s->status & DRQ_STAT) || !ide_is_pio_out(s)) { - return 0; + ret = 0; + goto out; } p = s->data_ptr; @@ -2358,6 +2365,9 @@ uint32_t ide_data_readl(void *opaque, uint32_t addr) s->status &= ~DRQ_STAT; s->end_transfer_func(s); } + +out: + trace_ide_data_readl(addr, ret, bus, s); return ret; } |