qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] target/mips: Remove tswap() calls in semihosting uhi_fstat_c


From: Richard Henderson
Subject: Re: [PATCH] target/mips: Remove tswap() calls in semihosting uhi_fstat_cb()
Date: Thu, 5 Dec 2024 19:09:34 -0600
User-agent: Mozilla Thunderbird

On 12/5/24 17:13, Philippe Mathieu-Daudé wrote:
In preparation of heterogeneous emulation where cores with
different endianness can run concurrently, we need to remove
the tswap() calls -- which use a fixed per-binary endianness.

Get the endianness of the UHI CPU accessed using
mips_env_is_bigendian() and replace the tswap() calls
by bswap() ones when necessary.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
  target/mips/tcg/sysemu/mips-semi.c | 43 +++++++++++++++++++++---------
  1 file changed, 30 insertions(+), 13 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

+            bswap16s((uint16_t *)&dst->uhi_st_dev);

Rather than cast, maybe better to

    dst->uhi_st_dev = bswap16(dst->uhi_st_dev);


r~



reply via email to

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