Skip to contentSkip to conversation

target/hexagon: Add HMP info tlb command

PATCH Superseded Brian Cain 2 participants 2 messages Aug 18 Arm/Amlogic Meson SoC support

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Brian Cain

author
#0 lore raw

PATCH 1/1 target/hexagon: Add HMP info tlb command

---
 target/hexagon/monitor.c   | 23 +++++++++++++++++++++++
 hmp-commands-info.hx       |  3 ++-
 target/hexagon/meson.build |  1 +
 3 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 target/hexagon/monitor.c
target/hexagon/monitor.c new file +23 -0
new file mode 100644
index 00000000000..150045769cc
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "cpu.h"
+#include "hex_mmu.h"
+#include "monitor/hmp.h"
+#include "monitor/monitor.h"
+
+void hmp_info_tlb(Monitor *mon, const QDict *qdict)
+{
+    CPUArchState *env = mon_get_cpu_env(mon);
+
+    if (!env) {
+        monitor_printf(mon, "No CPU available\n");
+        return;
+    }
+
+    dump_mmu(mon, env);
+}
hmp-commands-info.hx +2 -1
index 82134eb6c21..0d31fb8a84c 100644
@@ -193,7 +193,8 @@ ERST
         .help       = "show virtual to physical memory mappings",
         .cmd        = hmp_info_tlb,
         .arch_bitmask = QEMU_ARCH_I386 | QEMU_ARCH_SH4 | QEMU_ARCH_SPARC \
-                        | QEMU_ARCH_PPC | QEMU_ARCH_XTENSA | QEMU_ARCH_M68K,
+                        | QEMU_ARCH_PPC | QEMU_ARCH_XTENSA | QEMU_ARCH_M68K \
+                        | QEMU_ARCH_HEXAGON,
     },
 
 SRST
target/hexagon/meson.build +1 -0
index 4c921eee73b..a84a35106f5 100644
@@ -261,6 +261,7 @@ hexagon_softmmu_ss.add(files(
     'hex_interrupts.c',
     'hexswi.c',
     'machine.c',
+    'monitor.c',
 ))
 
 #
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

Hi

Quoted 4 lines · Brian Cain
---
 target/hexagon/monitor.c   | 23 +++++++++++++++++++++++

please name it something like hmp-cmds.c, so we can easily compile it out later

otherwise, lgtm

Quoted 64 lines
 hmp-commands-info.hx       |  3 ++-
 target/hexagon/meson.build |  1 +
 3 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 target/hexagon/monitor.c
target/hexagon/monitor.c new file +23 -0
new file mode 100644
index 00000000000..150045769cc
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "cpu.h"
+#include "hex_mmu.h"
+#include "monitor/hmp.h"
+#include "monitor/monitor.h"
+
+void hmp_info_tlb(Monitor *mon, const QDict *qdict)
+{
+    CPUArchState *env = mon_get_cpu_env(mon);
+
+    if (!env) {
+        monitor_printf(mon, "No CPU available\n");
+        return;
+    }
+
+    dump_mmu(mon, env);
+}
hmp-commands-info.hx +2 -1
index 82134eb6c21..0d31fb8a84c 100644
@@ -193,7 +193,8 @@ ERST
         .help       = "show virtual to physical memory mappings",
         .cmd        = hmp_info_tlb,
         .arch_bitmask = QEMU_ARCH_I386 | QEMU_ARCH_SH4 | QEMU_ARCH_SPARC \
-                        | QEMU_ARCH_PPC | QEMU_ARCH_XTENSA | QEMU_ARCH_M68K,
+                        | QEMU_ARCH_PPC | QEMU_ARCH_XTENSA | QEMU_ARCH_M68K \
+                        | QEMU_ARCH_HEXAGON,
     },
 
 SRST
target/hexagon/meson.build +1 -1
index 4c921eee73b..a84a35106f5 100644
@@ -261,6 +261,7 @@ hexagon_softmmu_ss.add(files(
     'hex_interrupts.c',
     'hexswi.c',
     'machine.c',
+    'monitor.c',
 ))
 
 #
--

2.34.1