[PATCH 12/16] target/sparc: Use explicit big-endian LD/ST API

Philippe Mathieu-Daudé posted 16 patches 1 month, 2 weeks ago
Only 12 patches received!
There is a newer version of this series
[PATCH 12/16] target/sparc: Use explicit big-endian LD/ST API
Posted by Philippe Mathieu-Daudé 1 month, 2 weeks ago
The SPARC architecture uses big endianness. Directly use
the big-endian LD/ST API.

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

diff --git a/target/sparc/gdbstub.c b/target/sparc/gdbstub.c
index ec0036e9ef6..da72a7d3f69 100644
--- a/target/sparc/gdbstub.c
+++ b/target/sparc/gdbstub.c
@@ -110,7 +110,7 @@ int sparc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
 #if defined(TARGET_ABI32)
     uint32_t tmp;
 
-    tmp = ldl_p(mem_buf);
+    tmp = ldl_be_p(mem_buf);
 #else
     target_ulong tmp;
 
@@ -165,7 +165,7 @@ int sparc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
 #else
     else if (n < 64) {
         /* f0-f31 */
-        tmp = ldl_p(mem_buf);
+        tmp = ldl_be_p(mem_buf);
         if (n & 1) {
             env->fpr[(n - 32) / 2].l.lower = tmp;
         } else {
-- 
2.45.2


Re: [PATCH 12/16] target/sparc: Use explicit big-endian LD/ST API
Posted by Mark Cave-Ayland 1 month, 2 weeks ago
On 04/10/2024 00:42, Philippe Mathieu-Daudé wrote:

> The SPARC architecture uses big endianness. Directly use
> the big-endian LD/ST API.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/sparc/gdbstub.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/sparc/gdbstub.c b/target/sparc/gdbstub.c
> index ec0036e9ef6..da72a7d3f69 100644
> --- a/target/sparc/gdbstub.c
> +++ b/target/sparc/gdbstub.c
> @@ -110,7 +110,7 @@ int sparc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
>   #if defined(TARGET_ABI32)
>       uint32_t tmp;
>   
> -    tmp = ldl_p(mem_buf);
> +    tmp = ldl_be_p(mem_buf);
>   #else
>       target_ulong tmp;
>   
> @@ -165,7 +165,7 @@ int sparc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
>   #else
>       else if (n < 64) {
>           /* f0-f31 */
> -        tmp = ldl_p(mem_buf);
> +        tmp = ldl_be_p(mem_buf);
>           if (n & 1) {
>               env->fpr[(n - 32) / 2].l.lower = tmp;
>           } else {

Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


ATB,

Mark.