aboutsummaryrefslogtreecommitdiff
path: root/hw/net/ne2000.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2018-06-21 14:12:53 -0300
committerStefan Hajnoczi <stefanha@redhat.com>2018-06-29 15:04:18 +0100
commitcd4479a91a0f56d59dbc4be6341812009ce141f0 (patch)
treec448329f3f40b49efa98f86e0e10f9be5ecd16c1 /hw/net/ne2000.c
parent349632a29ddb7d2ac7a7dc26499640ab2123fc7b (diff)
hw/net/ne2000: Add trace events
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/net/ne2000.c')
-rw-r--r--hw/net/ne2000.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 3a9fc89e48..26b234b7eb 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -26,6 +26,7 @@
#include "net/eth.h"
#include "ne2000.h"
#include "sysemu/sysemu.h"
+#include "trace.h"
/* debug NE2000 card */
//#define DEBUG_NE2000
@@ -662,19 +663,24 @@ static uint64_t ne2000_read(void *opaque, hwaddr addr,
unsigned size)
{
NE2000State *s = opaque;
+ uint64_t val;
if (addr < 0x10 && size == 1) {
- return ne2000_ioport_read(s, addr);
+ val = ne2000_ioport_read(s, addr);
} else if (addr == 0x10) {
if (size <= 2) {
- return ne2000_asic_ioport_read(s, addr);
+ val = ne2000_asic_ioport_read(s, addr);
} else {
- return ne2000_asic_ioport_readl(s, addr);
+ val = ne2000_asic_ioport_readl(s, addr);
}
} else if (addr == 0x1f && size == 1) {
- return ne2000_reset_ioport_read(s, addr);
+ val = ne2000_reset_ioport_read(s, addr);
+ } else {
+ val = ((uint64_t)1 << (size * 8)) - 1;
}
- return ((uint64_t)1 << (size * 8)) - 1;
+ trace_ne2000_read(addr, val);
+
+ return val;
}
static void ne2000_write(void *opaque, hwaddr addr,
@@ -682,6 +688,7 @@ static void ne2000_write(void *opaque, hwaddr addr,
{
NE2000State *s = opaque;
+ trace_ne2000_write(addr, data);
if (addr < 0x10 && size == 1) {
ne2000_ioport_write(s, addr, data);
} else if (addr == 0x10) {