qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH v3 2/5] ppc64: Fix semihosting on ppc64le


From: Richard Henderson
Subject: Re: [RFC PATCH v3 2/5] ppc64: Fix semihosting on ppc64le
Date: Mon, 18 Apr 2022 16:36:56 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0

On 4/18/22 12:10, Leandro Lupori wrote:
+static inline uint64_t sh_swap64(CPUArchState *env, uint64_t val)
+{
+    return msr_le ? val : tswap64(val);
+}
+
+static inline uint32_t sh_swap32(CPUArchState *env, uint32_t val)
+{
+    return msr_le ? val : tswap32(val);
+}

That doesn't work -- tswap itself is conditional.

You want

  return msr_le ? le32_to_cpu(x) : be32_to_cpu(x);

etc.  One of them will be a nop, and the other will bswap.


r~



reply via email to

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