target/ppc: Extract monitor-related code to monitor.c
Keep ppc-qmp-cmds.c for QMP, use monitor.c for HMP. Since ppc-qmp-cmds.c was introduced using the MIT license (see commit bf957284006 "monitor: remove target-specific code from monitor.c") retain the same license for the new monitor.c file. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20260219191955.83815-22-philmd@linaro.org>
Philippe Mathieu-Daudé committed
Feb 17, 2026 at 12:34 UTC
c91f3330cc1f8763f3f6f21bd400075e92a134b6
3 files changed
+27
-15
target/ppc/meson.build
+1
@@ -43,6 +43,7 @@ ppc_system_ss.add(files(
43
'mmu-hash32.c',
44
'mmu-booke.c',
45
'mmu_common.c',
46
+ 'monitor.c',
47
'ppc-qmp-cmds.c',
48
))
49
ppc_system_ss.add(when: 'CONFIG_TCG', if_true: files(
target/ppc/monitor.c
new
+25
@@ -0,0 +1,25 @@
1
+/*
2
+ * QEMU PPC (monitor definitions)
3
+ *
4
+ * Copyright (c) 2003-2004 Fabrice Bellard
5
+ *
6
+ * SPDX-License-Identifier: MIT
7
+ */
8
+
9
+#include "qemu/osdep.h"
10
+#include "qemu/ctype.h"
11
+#include "monitor/monitor.h"
12
+#include "monitor/hmp-target.h"
13
+#include "monitor/hmp.h"
14
+#include "cpu.h"
15
+
16
+void hmp_info_tlb(Monitor *mon, const QDict *qdict)
17
+{
18
+ CPUArchState *env1 = mon_get_cpu_env(mon);
19
+
20
+ if (!env1) {
21
+ monitor_printf(mon, "No CPU available\n");
22
+ return;
23
+ }
24
+ dump_mmu(env1);
25
+}
target/ppc/ppc-qmp-cmds.c
+1
-15
@@ -1,5 +1,5 @@
1
/*
2
- * QEMU PPC (monitor definitions)
2
+ * QEMU PPC (QMP definitions)
3
*
4
* Copyright (c) 2003-2004 Fabrice Bellard
5
*
@@ -24,26 +24,12 @@
24
25
#include "qemu/osdep.h"
26
#include "cpu.h"
27
-#include "monitor/monitor.h"
27
#include "qemu/ctype.h"
29
-#include "monitor/hmp-target.h"
30
-#include "monitor/hmp.h"
28
#include "qapi/error.h"
29
#include "qapi/qapi-commands-machine.h"
30
#include "cpu-models.h"
31
#include "cpu-qom.h"
32
36
-void hmp_info_tlb(Monitor *mon, const QDict *qdict)
37
-{
38
- CPUArchState *env1 = mon_get_cpu_env(mon);
39
-
40
- if (!env1) {
41
- monitor_printf(mon, "No CPU available\n");
42
- return;
43
- }
44
- dump_mmu(env1);
45
-}
46
-
33
CpuModelExpansionInfo *
34
qmp_query_cpu_model_expansion(CpuModelExpansionType type,
35
CpuModelInfo *model,