aboutsummaryrefslogtreecommitdiff
path: root/hw/sh4
diff options
context:
space:
mode:
authorBALATON Zoltan <balaton@eik.bme.hu>2021-10-29 23:02:09 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-10-30 18:39:37 +0200
commitad52cfc13750662fd003565e8035bb8ffbd4f0ef (patch)
treeee86a97c02ce074a2a2996df05501a9dc2ce8511 /hw/sh4
parent3b885dabd09f449143adbfc0595896b47648673d (diff)
downloadqemu-ad52cfc13750662fd003565e8035bb8ffbd4f0ef.zip
qemu-ad52cfc13750662fd003565e8035bb8ffbd4f0ef.tar.gz
qemu-ad52cfc13750662fd003565e8035bb8ffbd4f0ef.tar.bz2
hw/sh4: Change debug printfs to traces
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <b776043e811ab3caf200515e1350bdcccd1cc47b.1635541329.git.balaton@eik.bme.hu> [PMD: Fixed format strings for 32-bit hosts] Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'hw/sh4')
-rw-r--r--hw/sh4/sh7750.c8
-rw-r--r--hw/sh4/trace-events3
-rw-r--r--hw/sh4/trace.h1
3 files changed, 7 insertions, 5 deletions
diff --git a/hw/sh4/sh7750.c b/hw/sh4/sh7750.c
index ca7e261..6c702d6 100644
--- a/hw/sh4/sh7750.c
+++ b/hw/sh4/sh7750.c
@@ -32,6 +32,7 @@
#include "hw/sh4/sh_intc.h"
#include "hw/timer/tmu012.h"
#include "exec/exec-all.h"
+#include "trace.h"
#define NB_DEVICES 4
@@ -147,15 +148,11 @@ static void porta_changed(SH7750State *s, uint16_t prev)
uint16_t currenta, changes;
int i, r = 0;
-#if 0
- fprintf(stderr, "porta changed from 0x%04x to 0x%04x\n",
- prev, porta_lines(s));
- fprintf(stderr, "pdtra=0x%04x, pctra=0x%08x\n", s->pdtra, s->pctra);
-#endif
currenta = porta_lines(s);
if (currenta == prev) {
return;
}
+ trace_sh7750_porta(prev, currenta, s->pdtra, s->pctra);
changes = currenta ^ prev;
for (i = 0; i < NB_DEVICES; i++) {
@@ -182,6 +179,7 @@ static void portb_changed(SH7750State *s, uint16_t prev)
if (currentb == prev) {
return;
}
+ trace_sh7750_portb(prev, currentb, s->pdtrb, s->pctrb);
changes = currentb ^ prev;
for (i = 0; i < NB_DEVICES; i++) {
diff --git a/hw/sh4/trace-events b/hw/sh4/trace-events
new file mode 100644
index 0000000..4b61cd5
--- /dev/null
+++ b/hw/sh4/trace-events
@@ -0,0 +1,3 @@
+# sh7750.c
+sh7750_porta(uint16_t prev, uint16_t cur, uint16_t pdtr, uint16_t pctr) "porta changed from 0x%04x to 0x%04x\npdtra=0x%04x, pctra=0x%08x"
+sh7750_portb(uint16_t prev, uint16_t cur, uint16_t pdtr, uint16_t pctr) "portb changed from 0x%04x to 0x%04x\npdtrb=0x%04x, pctrb=0x%08x"
diff --git a/hw/sh4/trace.h b/hw/sh4/trace.h
new file mode 100644
index 0000000..e2c1332
--- /dev/null
+++ b/hw/sh4/trace.h
@@ -0,0 +1 @@
+#include "trace/trace-hw_sh4.h"