]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
exec/tswap: target code can use TARGET_BIG_ENDIAN instead of target_words_bigendian()
authorPierrick Bouvier <pierrick.bouvier@linaro.org>
Mon, 17 Mar 2025 18:34:00 +0000 (11:34 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 23 Apr 2025 20:52:06 +0000 (13:52 -0700)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250317183417.285700-2-pierrick.bouvier@linaro.org>

cpu-target.c
include/exec/tswap.h

index cae77374b3849f7ba7f55a24943c4e5dfbbc453e..519b0f89005bbbfce442a2ed6b78979c7c6e379d 100644 (file)
@@ -155,6 +155,7 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...)
     abort();
 }
 
+#undef target_words_bigendian
 bool target_words_bigendian(void)
 {
     return TARGET_BIG_ENDIAN;
index ecd4faef015ea3375c8313485746ef53bddc2db9..2683da0adb773510de823f739d42ec05e1f42f7b 100644 (file)
 /**
  * target_words_bigendian:
  * Returns true if the (default) endianness of the target is big endian,
- * false otherwise. Note that in target-specific code, you can use
- * TARGET_BIG_ENDIAN directly instead. On the other hand, common
- * code should normally never need to know about the endianness of the
- * target, so please do *not* use this function unless you know very well
- * what you are doing!
+ * false otherwise. Common code should normally never need to know about the
+ * endianness of the target, so please do *not* use this function unless you
+ * know very well what you are doing!
  */
 bool target_words_bigendian(void);
+#ifdef COMPILING_PER_TARGET
+#define target_words_bigendian()  TARGET_BIG_ENDIAN
+#endif
 
 /*
  * If we're in target-specific code, we can hard-code the swapping