]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
exec: Declare target_words_bigendian() in 'exec/tswap.h'
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 12 Dec 2023 10:34:25 +0000 (11:34 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 26 Apr 2024 15:03:05 +0000 (17:03 +0200)
We usually check target endianess before swapping values,
so target_words_bigendian() declaration makes sense in
"exec/tswap.h" with the target swapping helpers.

Remove "hw/core/cpu.h" when it was only included to get
the target_words_bigendian() declaration.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20231212123401.37493-16-philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
cpu-target.c
disas/disas.c
hw/audio/virtio-snd.c
hw/core/cpu-sysemu.c
hw/core/generic-loader.c
hw/display/vga.c
hw/virtio/virtio.c
include/exec/tswap.h
include/hw/core/cpu.h

index 4c0621bf33b5967b2f2d94d081f543ebef44f3b9..f88649c29954d7311a338e79c6a8a8376da4444c 100644 (file)
@@ -35,6 +35,7 @@
 #endif
 #include "sysemu/cpus.h"
 #include "sysemu/tcg.h"
+#include "exec/tswap.h"
 #include "exec/replay-core.h"
 #include "exec/cpu-common.h"
 #include "exec/exec-all.h"
index 7e3b0bb46c50cfcce592cb4e33aaa6fe4fa50a84..ec14715ecd15f29a497c5839857b46a9a33cb299 100644 (file)
@@ -6,6 +6,7 @@
 #include "disas/disas.h"
 #include "disas/capstone.h"
 #include "hw/core/cpu.h"
+#include "exec/tswap.h"
 #include "exec/memory.h"
 
 /* Filled in by elfload.c.  Simplistic, but will do for now. */
index c80b58bf5dccad97d7d7da961efff5296eb9279a..6a2ee085c072f5ce077918bf858f71c19a94d24f 100644 (file)
 #include "qemu/log.h"
 #include "qemu/error-report.h"
 #include "include/qemu/lockable.h"
+#include "exec/tswap.h"
 #include "sysemu/runstate.h"
 #include "trace.h"
 #include "qapi/error.h"
 #include "hw/audio/virtio-snd.h"
-#include "hw/core/cpu.h"
 
 #define VIRTIO_SOUND_VM_VERSION 1
 #define VIRTIO_SOUND_JACK_DEFAULT 0
index d0d6a910f97c844c31f8e66120d923f057d5bb16..2a9a2a4eb54ce529cee8e6f12c81a4d03689b85a 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "hw/core/cpu.h"
+#include "exec/tswap.h"
 #include "hw/core/sysemu-cpu-ops.h"
 
 bool cpu_paging_enabled(const CPUState *cpu)
index d4b5c501d84266b8c53cade26eb478d190d32624..ea8628b89269b4a2599c4bf7a90cbb99de6c0d9b 100644 (file)
@@ -31,7 +31,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "hw/core/cpu.h"
+#include "exec/tswap.h"
 #include "sysemu/dma.h"
 #include "sysemu/reset.h"
 #include "hw/boards.h"
index e91a76bf76bfaa2f48ab86b5482535bb2465c1ad..30facc6c8e33ce9741407315be4d1a1bfb08be5e 100644 (file)
@@ -26,7 +26,7 @@
 #include "qemu/units.h"
 #include "sysemu/reset.h"
 #include "qapi/error.h"
-#include "hw/core/cpu.h"
+#include "exec/tswap.h"
 #include "hw/display/vga.h"
 #include "hw/i386/x86.h"
 #include "hw/pci/pci.h"
index 871674f9bef1c4a238db5c8e1407db76d8860b13..893a072c9d4834f8755963633adcf359d3078348 100644 (file)
@@ -20,6 +20,7 @@
 #include "qemu/log.h"
 #include "qemu/main-loop.h"
 #include "qemu/module.h"
+#include "exec/tswap.h"
 #include "qom/object_interfaces.h"
 #include "hw/core/cpu.h"
 #include "hw/virtio/virtio.h"
index 5089cd6a4c89c1740ff8bba54fd526e111a1e0d9..b7a4191347546acfd8324cee9d3e0c15fc498d81 100644 (file)
@@ -8,9 +8,19 @@
 #ifndef TSWAP_H
 #define TSWAP_H
 
-#include "hw/core/cpu.h"
 #include "qemu/bswap.h"
 
+/**
+ * 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!
+ */
+bool target_words_bigendian(void);
+
 /*
  * If we're in target-specific code, we can hard-code the swapping
  * condition, otherwise we have to do (slower) run-time checks.
index cead8f01a66a4f735df1e679f416cbeb6611395c..d89b2cffcb299bcb254be6c2a4ad921f4ed4b366 100644 (file)
@@ -1168,17 +1168,6 @@ bool cpu_exec_realizefn(CPUState *cpu, Error **errp);
 void cpu_exec_unrealizefn(CPUState *cpu);
 void cpu_exec_reset_hold(CPUState *cpu);
 
-/**
- * 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!
- */
-bool target_words_bigendian(void);
-
 const char *target_name(void);
 
 #ifdef COMPILING_PER_TARGET