qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/3] hw/ppc/virtex_ml507: Replace tswap32() by stl_endian_p()


From: BALATON Zoltan
Subject: Re: [PATCH 3/3] hw/ppc/virtex_ml507: Replace tswap32() by stl_endian_p()
Date: Mon, 30 Sep 2024 15:50:00 +0200 (CEST)


On Mon, 30 Sep 2024, Philippe Mathieu-Daudé wrote:
Replace the target-specific tswap32() call by stl_endian_p()
which does the same but takes the endianness as argument, thus
is target-agnostic.
Get the vCPU endianness calling ppc_cpu_is_big_endian().

I don't know about virtex but maybe the same comment applies as for sam460ex.

Regards,
BALATON Zoltan

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

diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
index c49da1f46f..135dcbde06 100644
--- a/hw/ppc/virtex_ml507.c
+++ b/hw/ppc/virtex_ml507.c
@@ -141,7 +141,7 @@ static void main_cpu_reset(void *opaque)

    /* Create a mapping for the kernel.  */
    mmubooke_create_initial_mapping(env, 0, 0);
-    env->gpr[6] = tswap32(EPAPR_MAGIC);
+    stl_endian_p(ppc_cpu_is_big_endian(CPU(cpu)), &env->gpr[6], EPAPR_MAGIC);
    env->gpr[7] = bi->ima_size;
}


reply via email to

[Prev in Thread] Current Thread [Next in Thread]