qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Song Gao" <gaosong@loongson.cn>,
	"Bibo Mao" <maobibo@loongson.cn>,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
	"Anton Johansson" <anjo@rev.ng>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 3/4] target/loongarch: Remove target_ulong use in gdb_write_register handler
Date: Thu,  9 Oct 2025 22:19:45 +0200	[thread overview]
Message-ID: <20251009201947.34643-4-philmd@linaro.org> (raw)
In-Reply-To: <20251009201947.34643-1-philmd@linaro.org>

ldq_le_p() returns a uint64_t type, big enough to also hold
ldl_le_p() return value. If we were building for a 32-bit
LoongArch target, ldq_le_p() would not fit in target_ulong.
Better stick to plain uint64_t.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/loongarch/gdbstub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/loongarch/gdbstub.c b/target/loongarch/gdbstub.c
index 471eda28c73..23a5eecc20b 100644
--- a/target/loongarch/gdbstub.c
+++ b/target/loongarch/gdbstub.c
@@ -62,7 +62,7 @@ int loongarch_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
 int loongarch_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
 {
     CPULoongArchState *env = cpu_env(cs);
-    target_ulong tmp;
+    uint64_t tmp;
     int length = 0;
 
     if (n < 0 || n > 34) {
-- 
2.51.0



  parent reply	other threads:[~2025-10-09 20:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-09 20:19 [PATCH 0/4] target/loongarch: Remove some unnecessary target_ulong uses Philippe Mathieu-Daudé
2025-10-09 20:19 ` [PATCH 1/4] hw/loongarch/boot: Remove unnecessary cast to target_ulong Philippe Mathieu-Daudé
2025-10-09 21:46   ` Richard Henderson
2025-10-14  9:12   ` gaosong
2025-10-09 20:19 ` [PATCH 2/4] target/loongarch: Remove target_ulong use in gen_goto_tb() Philippe Mathieu-Daudé
2025-10-09 21:46   ` Richard Henderson
2025-10-14  9:13   ` gaosong
2025-10-09 20:19 ` Philippe Mathieu-Daudé [this message]
2025-10-09 21:47   ` [PATCH 3/4] target/loongarch: Remove target_ulong use in gdb_write_register handler Richard Henderson
2025-10-14  9:17   ` gaosong
2025-10-09 20:19 ` [PATCH 4/4] target/loongarch: Do not use target_ulong type for LDDIR level Philippe Mathieu-Daudé
2025-10-09 21:50   ` Richard Henderson
2025-10-14  9:18   ` gaosong
2025-10-14 10:00 ` [PATCH 0/4] target/loongarch: Remove some unnecessary target_ulong uses gaosong

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=20251009201947.34643-4-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=anjo@rev.ng \
    --cc=gaosong@loongson.cn \
    --cc=jiaxun.yang@flygoat.com \
    --cc=maobibo@loongson.cn \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).