summary refs log tree commit diff stats
path: root/hw/misc/grlib_ahb_apb_pnp.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-03-31 12:02:47 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-06-09 09:21:10 +0200
commitd15188ddcffe0239295f48756bab31e76d88007a (patch)
treed697e0e750391af451ad7bb431d1f0377709d3ad /hw/misc/grlib_ahb_apb_pnp.c
parent1a5a5570889df9cdd42dd85223e03a5f35025a86 (diff)
downloadfocaccia-qemu-d15188ddcffe0239295f48756bab31e76d88007a.tar.gz
focaccia-qemu-d15188ddcffe0239295f48756bab31e76d88007a.zip
hw/misc/grlib_ahb_apb_pnp: Add trace events on read accesses
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: KONRAD Frederic <frederic.konrad@adacore.com>
Message-Id: <20200331105048.27989-5-f4bug@amsat.org>
Diffstat (limited to 'hw/misc/grlib_ahb_apb_pnp.c')
-rw-r--r--hw/misc/grlib_ahb_apb_pnp.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/hw/misc/grlib_ahb_apb_pnp.c b/hw/misc/grlib_ahb_apb_pnp.c
index d22ed00206..43e001c3c7 100644
--- a/hw/misc/grlib_ahb_apb_pnp.c
+++ b/hw/misc/grlib_ahb_apb_pnp.c
@@ -25,6 +25,7 @@
 #include "qemu/log.h"
 #include "hw/sysbus.h"
 #include "hw/misc/grlib_ahb_apb_pnp.h"
+#include "trace.h"
 
 #define GRLIB_PNP_VENDOR_SHIFT (24)
 #define GRLIB_PNP_VENDOR_SIZE   (8)
@@ -132,8 +133,12 @@ void grlib_ahb_pnp_add_entry(AHBPnp *dev, uint32_t address, uint32_t mask,
 static uint64_t grlib_ahb_pnp_read(void *opaque, hwaddr offset, unsigned size)
 {
     AHBPnp *ahb_pnp = GRLIB_AHB_PNP(opaque);
+    uint32_t val;
 
-    return ahb_pnp->regs[offset >> 2];
+    val = ahb_pnp->regs[offset >> 2];
+    trace_grlib_ahb_pnp_read(offset, val);
+
+    return val;
 }
 
 static void grlib_ahb_pnp_write(void *opaque, hwaddr addr,
@@ -239,8 +244,12 @@ void grlib_apb_pnp_add_entry(APBPnp *dev, uint32_t address, uint32_t mask,
 static uint64_t grlib_apb_pnp_read(void *opaque, hwaddr offset, unsigned size)
 {
     APBPnp *apb_pnp = GRLIB_APB_PNP(opaque);
+    uint32_t val;
+
+    val = apb_pnp->regs[offset >> 2];
+    trace_grlib_apb_pnp_read(offset, val);
 
-    return apb_pnp->regs[offset >> 2];
+    return val;
 }
 
 static void grlib_apb_pnp_write(void *opaque, hwaddr addr,