[PATCH 04/18] target/s390x: Replace target_ulong -> uint64_t in gdb_write_register()

Philippe Mathieu-Daudé posted 18 patches 1 month ago
Maintainers: Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Farhan Ali <alifm@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Richard Henderson <richard.henderson@linaro.org>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>
There is a newer version of this series
[PATCH 04/18] target/s390x: Replace target_ulong -> uint64_t in gdb_write_register()
Posted by Philippe Mathieu-Daudé 1 month ago
On s390x target_ulong expands to uint64_t. Besides,
ldq_be_p() returns a uint64_t type. Use that instead.

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

diff --git a/target/s390x/gdbstub.c b/target/s390x/gdbstub.c
index d1f02ea5ce4..9ae715add4d 100644
--- a/target/s390x/gdbstub.c
+++ b/target/s390x/gdbstub.c
@@ -46,7 +46,7 @@ int s390_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
 int s390_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
 {
     CPUS390XState *env = cpu_env(cs);
-    target_ulong tmpl = ldq_be_p(mem_buf);
+    uint64_t tmpl = ldq_be_p(mem_buf);
 
     switch (n) {
     case S390_PSWM_REGNUM:
-- 
2.52.0


Re: [PATCH 04/18] target/s390x: Replace target_ulong -> uint64_t in gdb_write_register()
Posted by Thomas Huth 1 month ago
On 07/01/2026 14.07, Philippe Mathieu-Daudé wrote:
> On s390x target_ulong expands to uint64_t. Besides,
> ldq_be_p() returns a uint64_t type. Use that instead.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/s390x/gdbstub.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/s390x/gdbstub.c b/target/s390x/gdbstub.c
> index d1f02ea5ce4..9ae715add4d 100644
> --- a/target/s390x/gdbstub.c
> +++ b/target/s390x/gdbstub.c
> @@ -46,7 +46,7 @@ int s390_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
>   int s390_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
>   {
>       CPUS390XState *env = cpu_env(cs);
> -    target_ulong tmpl = ldq_be_p(mem_buf);
> +    uint64_t tmpl = ldq_be_p(mem_buf);
>   
>       switch (n) {
>       case S390_PSWM_REGNUM:

Reviewed-by: Thomas Huth <thuth@redhat.com>