[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-9.1 14/21] target/sh4: Extract sh4_dump_mmu() from hmp_info_t
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-9.1 14/21] target/sh4: Extract sh4_dump_mmu() from hmp_info_tlb() |
Date: |
Thu, 21 Mar 2024 16:48:30 +0100 |
Extract sh4_dump_mmu() from hmp_info_tlb(), replacing
monitor_printf(FIXED_STRING_WITHOUT_FORMAT) by monitor_puts().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/sh4/cpu.h | 2 ++
target/sh4/monitor.c | 22 +++++++++++++++-------
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h
index 9211da6bde..4e2e9ffd66 100644
--- a/target/sh4/cpu.h
+++ b/target/sh4/cpu.h
@@ -385,4 +385,6 @@ static inline void cpu_get_tb_cpu_state(CPUSH4State *env,
vaddr *pc,
#endif
}
+void sh4_dump_mmu(Monitor *mon, CPUSH4State *env);
+
#endif /* SH4_CPU_H */
diff --git a/target/sh4/monitor.c b/target/sh4/monitor.c
index 2da6a5426e..1befb42b07 100644
--- a/target/sh4/monitor.c
+++ b/target/sh4/monitor.c
@@ -39,20 +39,28 @@ static void print_tlb(Monitor *mon, int idx, tlb_t *tlb)
tlb->d, tlb->wt);
}
+void sh4_dump_mmu(Monitor *mon, CPUSH4State *env)
+{
+ int i;
+
+ monitor_puts(mon, "ITLB:\n");
+ for (i = 0 ; i < ITLB_SIZE ; i++) {
+ print_tlb (mon, i, &env->itlb[i]);
+ }
+ monitor_puts(mon, "UTLB:\n");
+ for (i = 0 ; i < UTLB_SIZE ; i++) {
+ print_tlb (mon, i, &env->utlb[i]);
+ }
+}
+
void hmp_info_tlb(Monitor *mon, const QDict *qdict)
{
CPUArchState *env = mon_get_cpu_env(mon);
- int i;
if (!env) {
monitor_printf(mon, "No CPU available\n");
return;
}
- monitor_printf (mon, "ITLB:\n");
- for (i = 0 ; i < ITLB_SIZE ; i++)
- print_tlb (mon, i, &env->itlb[i]);
- monitor_printf (mon, "UTLB:\n");
- for (i = 0 ; i < UTLB_SIZE ; i++)
- print_tlb (mon, i, &env->utlb[i]);
+ sh4_dump_mmu(mon, env);
}
--
2.41.0
- [PATCH-for-9.1 04/21] target/i386: Extract x86_dump_mmu() from hmp_info_tlb(), (continued)
- [PATCH-for-9.1 04/21] target/i386: Extract x86_dump_mmu() from hmp_info_tlb(), Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 06/21] target/m68k: Have dump_ttr() take a @description argument, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 07/21] target/m68k: Move MMU monitor commands from helper.c to monitor.c, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 08/21] target/microblaze: Prefix MMU API with 'mb_', Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 09/21] target/mips: Prefix MMU API with 'mips_', Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 10/21] target/nios2: Prefix MMU API with 'nios2_', Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 11/21] target/nios2: Move monitor commands to monitor.c, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 12/21] target/nios2: Replace qemu_printf() by monitor_printf() in monitor, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 14/21] target/sh4: Extract sh4_dump_mmu() from hmp_info_tlb(),
Philippe Mathieu-Daudé <=
- [PATCH-for-9.1 13/21] target/ppc: Replace qemu_printf() by monitor_printf() in monitor, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.0? 15/21] target/sparc: Fix string format errors when DEBUG_MMU is defined, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 16/21] target/sparc: Replace qemu_printf() by monitor_printf() in monitor, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 18/21] target/xtensa: Extract MMU API to new mmu.c/mmu.h files, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 17/21] target/xtensa: Prefix MMU API with 'xtensa_', Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 20/21] target/xtensa: Move monitor commands to monitor.c, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 19/21] target/xtensa: Simplify dump_mpu() and dump_tlb(), Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 21/21] target/xtensa: Replace qemu_printf() by monitor_printf() in monitor, Philippe Mathieu-Daudé, 2024/03/21