]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qemu: Convert target_words_bigendian() to TargetInfo API
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 8 Jul 2025 21:53:16 +0000 (23:53 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 15 Jul 2025 06:56:39 +0000 (02:56 -0400)
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250708215320.70426-6-philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
cpu-target.c
hw/core/cpu-system.c
hw/display/vga.c
hw/virtio/virtio.c
include/exec/tswap.h
include/qemu/target-info.h
system/memory.c
system/qtest.c
target-info.c

index 1c90a30759352b529697fd5780a6470b08b17bf7..20db5ff3108fc2346eb74ee2f5ff8029af025901 100644 (file)
@@ -22,7 +22,6 @@
 #include "system/accel-ops.h"
 #include "system/cpus.h"
 #include "exec/cpu-common.h"
-#include "exec/tswap.h"
 #include "exec/replay-core.h"
 #include "exec/log.h"
 #include "hw/core/cpu.h"
@@ -85,9 +84,3 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...)
 #endif
     abort();
 }
-
-#undef target_big_endian
-bool target_big_endian(void)
-{
-    return TARGET_BIG_ENDIAN;
-}
index 3c84176a0c50853a64d66697d9af5aba3fe0f6f9..a975405d3a0a27be2003213dce50b7c721dc2fe5 100644 (file)
@@ -24,7 +24,7 @@
 #include "exec/cputlb.h"
 #include "system/memory.h"
 #include "exec/tb-flush.h"
-#include "exec/tswap.h"
+#include "qemu/target-info.h"
 #include "hw/qdev-core.h"
 #include "hw/qdev-properties.h"
 #include "hw/core/sysemu-cpu-ops.h"
index 20475ebbd3104eae9954af098a7a6f3bc68f0cb8..90b89cf40447c7c4f47b058b1f307662ad6ebaf8 100644 (file)
@@ -26,7 +26,7 @@
 #include "qemu/units.h"
 #include "system/reset.h"
 #include "qapi/error.h"
-#include "exec/tswap.h"
+#include "qemu/target-info.h"
 #include "hw/display/vga.h"
 #include "hw/i386/x86.h"
 #include "hw/pci/pci.h"
index 82a285a31d1c0427d55f7cb73398adfc94e678fe..0f4d28033d7b3bec850ee263804e78090bbb3809 100644 (file)
@@ -20,7 +20,7 @@
 #include "qemu/log.h"
 #include "qemu/main-loop.h"
 #include "qemu/module.h"
-#include "exec/tswap.h"
+#include "qemu/target-info.h"
 #include "qom/object_interfaces.h"
 #include "hw/core/cpu.h"
 #include "hw/virtio/virtio.h"
index 49511f261175b3a18da16e1f1c434ad947026f77..55ffa6335986d08f39943bbcb29776e8123ab39f 100644 (file)
@@ -9,18 +9,7 @@
 #define TSWAP_H
 
 #include "qemu/bswap.h"
-
-/**
- * target_big_endian:
- * Returns true if the (default) endianness of the target is big endian,
- * 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_big_endian(void);
-#ifdef COMPILING_PER_TARGET
-#define target_big_endian()   TARGET_BIG_ENDIAN
-#endif
+#include "qemu/target-info.h"
 
 /*
  * If we're in target-specific code, we can hard-code the swapping
index dde0e7d968ae65bf98d3877d6b7fad08a19f80e2..abcf25db6fae89ae6c4f0b5e0ac9939fd1c41cc2 100644 (file)
@@ -38,4 +38,16 @@ const char *target_machine_typename(void);
  */
 const char *target_cpu_type(void);
 
+/**
+ * target_big_endian:
+ *
+ * Returns: %true if the (default) endianness of the target is big endian,
+ *          %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_big_endian(void);
+
 #endif
index e8d9b15b28f6bb95c52afef9457e12478b3d1083..38da62f5052ede923cb8aba1beae296d84db5fd8 100644 (file)
@@ -22,6 +22,7 @@
 #include "qemu/error-report.h"
 #include "qemu/main-loop.h"
 #include "qemu/qemu-print.h"
+#include "qemu/target-info.h"
 #include "qom/object.h"
 #include "trace.h"
 #include "system/ram_addr.h"
index 301b03be2d34b15862816808c7d64857a1c0b504..fa42c9f921574a7617df5e85a8b7de8ca0eb16c5 100644 (file)
@@ -29,6 +29,7 @@
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "qemu/cutils.h"
+#include "qemu/target-info.h"
 #include "qom/object_interfaces.h"
 
 #define MAX_IRQ 256
index a756c0714c4b3f710aa1e9f9c97e2772523de67b..3110ab32f753f0a3f3653fb2bad3a10b5e5a952b 100644 (file)
@@ -47,3 +47,8 @@ EndianMode target_endian_mode(void)
 {
     return target_info()->endianness;
 }
+
+bool target_big_endian(void)
+{
+    return target_endian_mode() == ENDIAN_MODE_BIG;
+}