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 <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Message-ID: <[email protected]> --- target/ppc/monitor.c | 25 +++++++++++++++++++++++++ target/ppc/ppc-qmp-cmds.c | 16 +--------------- target/ppc/meson.build | 1 + 3 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 target/ppc/monitor.c diff --git a/target/ppc/monitor.c b/target/ppc/monitor.c new file mode 100644 index 00000000000..776a76602ea --- /dev/null +++ b/target/ppc/monitor.c @@ -0,0 +1,25 @@ +/* + * QEMU PPC (monitor definitions) + * + * Copyright (c) 2003-2004 Fabrice Bellard + * + * SPDX-License-Identifier: MIT + */ + +#include "qemu/osdep.h" +#include "qemu/ctype.h" +#include "monitor/monitor.h" +#include "monitor/hmp-target.h" +#include "monitor/hmp.h" +#include "cpu.h" + +void hmp_info_tlb(Monitor *mon, const QDict *qdict) +{ + CPUArchState *env1 = mon_get_cpu_env(mon); + + if (!env1) { + monitor_printf(mon, "No CPU available\n"); + return; + } + dump_mmu(env1); +} diff --git a/target/ppc/ppc-qmp-cmds.c b/target/ppc/ppc-qmp-cmds.c index 66c3bcb2c38..96228919966 100644 --- a/target/ppc/ppc-qmp-cmds.c +++ b/target/ppc/ppc-qmp-cmds.c @@ -1,5 +1,5 @@ /* - * QEMU PPC (monitor definitions) + * QEMU PPC (QMP definitions) * * Copyright (c) 2003-2004 Fabrice Bellard * @@ -24,26 +24,12 @@ #include "qemu/osdep.h" #include "cpu.h" -#include "monitor/monitor.h" #include "qemu/ctype.h" -#include "monitor/hmp-target.h" -#include "monitor/hmp.h" #include "qapi/error.h" #include "qapi/qapi-commands-machine.h" #include "cpu-models.h" #include "cpu-qom.h" -void hmp_info_tlb(Monitor *mon, const QDict *qdict) -{ - CPUArchState *env1 = mon_get_cpu_env(mon); - - if (!env1) { - monitor_printf(mon, "No CPU available\n"); - return; - } - dump_mmu(env1); -} - CpuModelExpansionInfo * qmp_query_cpu_model_expansion(CpuModelExpansionType type, CpuModelInfo *model, diff --git a/target/ppc/meson.build b/target/ppc/meson.build index b0d708bb519..d4ebbaf0a19 100644 --- a/target/ppc/meson.build +++ b/target/ppc/meson.build @@ -43,6 +43,7 @@ ppc_system_ss.add(files( 'mmu-hash32.c', 'mmu-booke.c', 'mmu_common.c', + 'monitor.c', 'ppc-qmp-cmds.c', )) ppc_system_ss.add(when: 'CONFIG_TCG', if_true: files( -- 2.52.0
