public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
	"Dr . David Alan Gilbert" <dave@treblig.org>,
	"Daniel Henrique Barboza" <daniel.barboza@oss.qualcomm.com>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	qemu-riscv@nongnu.org, "Anton Johansson" <anjo@rev.ng>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Weiwei Li" <liwei1518@gmail.com>,
	"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
	"Chao Liu" <chao.liu.zevorn@gmail.com>
Subject: [PATCH-for-11.1 09/10] target/riscv: Register target_get_monitor_def in CPUClass
Date: Fri, 20 Mar 2026 17:08:09 +0100	[thread overview]
Message-ID: <20260320160811.28611-10-philmd@linaro.org> (raw)
In-Reply-To: <20260320160811.28611-1-philmd@linaro.org>

Rename target_get_monitor_def() as riscv_monitor_get_register_legacy()
and register it as CPUClass::legacy_monitor_get_register() handler.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/riscv/internals.h | 3 +++
 target/riscv/cpu.c       | 1 +
 target/riscv/monitor.c   | 4 +++-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/target/riscv/internals.h b/target/riscv/internals.h
index 460346dd6de..90225d322ff 100644
--- a/target/riscv/internals.h
+++ b/target/riscv/internals.h
@@ -245,4 +245,7 @@ static inline int insn_len(uint16_t first_word)
     return (first_word & 3) == 3 ? 4 : 2;
 }
 
+int riscv_monitor_get_register_legacy(CPUState *cs, const char *name,
+                                      uint64_t *pval);
+
 #endif
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 8ac935ac06e..e73d15476a7 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -2750,6 +2750,7 @@ static void riscv_cpu_common_class_init(ObjectClass *c, const void *data)
     cc->get_arch_id = riscv_get_arch_id;
 #endif
     cc->gdb_arch_name = riscv_gdb_arch_name;
+    cc->legacy_monitor_get_register = riscv_monitor_get_register_legacy;
 #ifdef CONFIG_TCG
     cc->tcg_ops = &riscv_tcg_ops;
 #endif /* CONFIG_TCG */
diff --git a/target/riscv/monitor.c b/target/riscv/monitor.c
index 3f206b9fca5..1c90c779534 100644
--- a/target/riscv/monitor.c
+++ b/target/riscv/monitor.c
@@ -26,6 +26,7 @@
 #include "monitor/monitor.h"
 #include "monitor/hmp.h"
 #include "system/memory.h"
+#include "internals.h"
 
 #ifdef TARGET_RISCV64
 #define PTE_HEADER_FIELDS       "vaddr            paddr            "\
@@ -310,7 +311,8 @@ static bool reg_is_vreg(const char *name)
     return false;
 }
 
-int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval)
+int riscv_monitor_get_register_legacy(CPUState *cs, const char *name,
+                                      uint64_t *pval)
 {
     CPURISCVState *env = &RISCV_CPU(cs)->env;
     target_ulong val = 0;
-- 
2.53.0



  parent reply	other threads:[~2026-03-20 16:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 16:08 [PATCH-for-11.1 00/10] monitor: Remove need of per-target handlers Philippe Mathieu-Daudé
2026-03-20 16:08 ` [PATCH-for-11.1 01/10] monitor: Extract completion declarations to 'monitor/hmp-completion.h' Philippe Mathieu-Daudé
2026-03-20 21:52   ` Pierrick Bouvier
2026-03-20 16:08 ` [PATCH-for-11.1 02/10] monitor: Forward-declare the MonitorDef type Philippe Mathieu-Daudé
2026-03-20 21:52   ` Pierrick Bouvier
2026-03-20 16:08 ` [PATCH-for-11.1 03/10] cpus: Introduce CPUClass::legacy_monitor_defs hook Philippe Mathieu-Daudé
2026-03-20 22:01   ` Pierrick Bouvier
2026-03-21 15:19     ` Philippe Mathieu-Daudé
2026-03-21 19:51       ` Pierrick Bouvier
2026-03-23  9:19         ` Philippe Mathieu-Daudé
2026-03-23 20:00           ` Pierrick Bouvier
2026-03-20 16:08 ` [PATCH-for-11.1 04/10] target/i386: Replace legacy target_monitor_defs -> legacy_monitor_defs Philippe Mathieu-Daudé
2026-03-20 16:08 ` [PATCH-for-11.1 05/10] target/m68k: " Philippe Mathieu-Daudé
2026-03-20 16:08 ` [PATCH-for-11.1 06/10] target/sparc: " Philippe Mathieu-Daudé
2026-03-20 16:08 ` [PATCH-for-11.1 07/10] monitor: Remove target_monitor_defs() Philippe Mathieu-Daudé
2026-03-20 16:08 ` [PATCH-for-11.1 08/10] cpus: Introduce CPUClass::legacy_monitor_get_register() hook Philippe Mathieu-Daudé
2026-03-20 16:08 ` Philippe Mathieu-Daudé [this message]
2026-03-20 16:08 ` [PATCH-for-11.1 10/10] monitor: Remove target_get_monitor_def() Philippe Mathieu-Daudé
2026-03-23 12:03 ` [PATCH-for-11.1 00/10] monitor: Remove need of per-target handlers Daniel Henrique Barboza

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260320160811.28611-10-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=anjo@rev.ng \
    --cc=atar4qemu@gmail.com \
    --cc=chao.liu.zevorn@gmail.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=dave@treblig.org \
    --cc=liwei1518@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=palmer@dabbelt.com \
    --cc=pbonzini@redhat.com \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=zhao1.liu@intel.com \
    --cc=zhiwei_liu@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox