diff mbox series

[PATCH-for-9.1,06/21] target/m68k: Have dump_ttr() take a @description argument

Message ID 20240321154838.95771-7-philmd@linaro.org
State New
Headers show
Series target/monitor: Cleanup around hmp_info_tlb() | expand

Commit Message

Philippe Mathieu-Daudé March 21, 2024, 3:48 p.m. UTC
Slightly simplify dump_mmu() by passing the description as
argument to dump_ttr().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/m68k/helper.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

Comments

Richard Henderson March 21, 2024, 9:49 p.m. UTC | #1
On 3/21/24 05:48, Philippe Mathieu-Daudé wrote:
> Slightly simplify dump_mmu() by passing the description as
> argument to dump_ttr().
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   target/m68k/helper.c | 15 ++++++---------
>   1 file changed, 6 insertions(+), 9 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/target/m68k/helper.c b/target/m68k/helper.c
index 310e26dfa1..cf9d83e47e 100644
--- a/target/m68k/helper.c
+++ b/target/m68k/helper.c
@@ -578,8 +578,9 @@  static void dump_address_map(Monitor *mon, CPUM68KState *env,
         break; \
     }
 
-static void dump_ttr(Monitor *mon, uint32_t ttr)
+static void dump_ttr(Monitor *mon, const char *desc, uint32_t ttr)
 {
+    monitor_printf(mon, "%s: ", desc);
     if ((ttr & M68K_TTR_ENABLED) == 0) {
         monitor_puts(mon, "disabled\n");
         return;
@@ -663,14 +664,10 @@  void dump_mmu(Monitor *mon, CPUM68KState *env)
         monitor_puts(mon, "\n");
     }
 
-    monitor_puts(mon, "ITTR0: ");
-    dump_ttr(mon, env->mmu.ttr[M68K_ITTR0]);
-    monitor_puts(mon, "ITTR1: ");
-    dump_ttr(mon, env->mmu.ttr[M68K_ITTR1]);
-    monitor_puts(mon, "DTTR0: ");
-    dump_ttr(mon, env->mmu.ttr[M68K_DTTR0]);
-    monitor_puts(mon, "DTTR1: ");
-    dump_ttr(mon, env->mmu.ttr[M68K_DTTR1]);
+    dump_ttr(mon, "ITTR0", env->mmu.ttr[M68K_ITTR0]);
+    dump_ttr(mon, "ITTR1", env->mmu.ttr[M68K_ITTR1]);
+    dump_ttr(mon, "DTTR0", env->mmu.ttr[M68K_DTTR0]);
+    dump_ttr(mon, "DTTR1", env->mmu.ttr[M68K_DTTR1]);
 
     monitor_printf(mon, "SRP: 0x%08x\n", env->mmu.srp);
     dump_address_map(mon, env, env->mmu.srp);