]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
system: Allow restricting the legacy DEVICE_NATIVE_ENDIAN definition
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 9 Dec 2025 18:24:05 +0000 (19:24 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 22 Jan 2026 09:48:45 +0000 (10:48 +0100)
Guard the native endian definition we want to remove by surrounding
it with TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API #ifdef'ry.
Assign values to the enumerators so they stay unchanged.

Once a target gets cleaned we'll set the definition in the target
config, then the target won't be able to use the legacy API anymore.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260109165058.59144-21-philmd@linaro.org>

include/system/memory.h
system/memory-internal.h

index 92028dc7a4ee47588ca356f55286554e67b606ad..8f8725ea2d53ec332cd9e6dd3d72c12994817af8 100644 (file)
 #include "qemu/rcu.h"
 
 enum device_endian {
-    DEVICE_NATIVE_ENDIAN,
-    DEVICE_BIG_ENDIAN,
-    DEVICE_LITTLE_ENDIAN,
+#ifndef TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API
+    DEVICE_NATIVE_ENDIAN = 0,
+#endif
+    DEVICE_BIG_ENDIAN = 1,
+    DEVICE_LITTLE_ENDIAN = 2,
 };
 
 #define RAM_ADDR_INVALID (~(ram_addr_t)0)
index 46f758fa7e47175c334baf513f1a704d3f151a75..5f0524756eb27326881c3db897ef43089bad2f2f 100644 (file)
@@ -41,9 +41,11 @@ void mtree_print_dispatch(struct AddressSpaceDispatch *d,
 /* returns true if end is big endian. */
 static inline bool devend_big_endian(enum device_endian end)
 {
+#ifndef TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API
     if (end == DEVICE_NATIVE_ENDIAN) {
         return target_big_endian();
     }
+#endif
     return end == DEVICE_BIG_ENDIAN;
 }