On 3/23/25 15:50, Philippe Mathieu-Daudé wrote:
We only use qemu_get_betl() and qemu_put_betl() once in
the whole code base. Inline them (checking TARGET_SPARC64
instead of TARGET_LONG_BITS == 64) so we can remove them
later as unused.

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

diff --git a/target/sparc/machine.c b/target/sparc/machine.c
index 222e5709c55..cc58812781b 100644
--- a/target/sparc/machine.c
+++ b/target/sparc/machine.c
@@ -87,7 +87,13 @@ static int get_fsr(QEMUFile *f, void *opaque, size_t size,
                     const VMStateField *field)
  {
      SPARCCPU *cpu = opaque;
-    target_ulong val = qemu_get_betl(f);
+    target_ulong val;
+
+#ifdef TARGET_SPARC64
+    val = qemu_get_be64(f);
+#else
+    val = qemu_get_be32(f);
+#endif
cpu_put_fsr(&cpu->env, val);
      return 0;
@@ -99,7 +105,11 @@ static int put_fsr(QEMUFile *f, void *opaque, size_t size,
      SPARCCPU *cpu = opaque;
      target_ulong val = cpu_get_fsr(&cpu->env);
- qemu_put_betl(f, val);
+#ifdef TARGET_SPARC64
+    qemu_put_be64(f, val);
+#else
+    qemu_put_be32(f, val);
+#endif
      return 0;
  }

Reviewed-by: Pierrick Bouvier <pierrick.bouv...@linaro.org>

Reply via email to