]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
system: Allow restricting legacy address_space_ldst() native-endian API
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 APIs we want to remove by surrounding
them with TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API #ifdef'ry.

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-16-philmd@linaro.org>

include/system/memory_cached.h
include/system/memory_ldst.h.inc
system/memory_ldst.c.inc

index e0ed54bd1eb8d2aaf742f7a1892f0e11b4496e55..6eb6179140b8a107b23f000cb56c435db12d93d3 100644 (file)
@@ -80,8 +80,10 @@ void address_space_stb_cached(MemoryRegionCache *cache,
     }
 }
 
+#ifndef TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API
 #define ENDIANNESS
 #include "system/memory_ldst_cached.h.inc"
+#endif
 
 #define ENDIANNESS   _le
 #include "system/memory_ldst_cached.h.inc"
index dd1fb482eacc11ea0e6d4c50351ea9c879a0304d..896550bdd659457d6251c689c738bf8da8fa0906 100644 (file)
@@ -25,8 +25,10 @@ uint8_t glue(address_space_ldub, SUFFIX)(ARG1_DECL,
 void glue(address_space_stb, SUFFIX)(ARG1_DECL,
           hwaddr addr, uint8_t val, MemTxAttrs attrs, MemTxResult *result);
 
+#ifndef TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API
 #define ENDIANNESS
 #include "system/memory_ldst_endian.h.inc"
+#endif /* TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API */
 
 #define ENDIANNESS              _le
 #include "system/memory_ldst_endian.h.inc"
index ebb441f1a66c62f81422d24d58430c0a433956c4..a728b7737c2bc6016fafd3dee8082cdddf536352 100644 (file)
@@ -105,9 +105,11 @@ void glue(address_space_stb, SUFFIX)(ARG1_DECL, hwaddr addr, uint8_t val,
                                              attrs, result);
 }
 
+#ifndef TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API
 #define ENDIANNESS
 #define MO_ENDIAN               (target_big_endian() ? MO_BE : MO_LE)
 #include "memory_ldst_endian.c.inc"
+#endif /* TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API */
 
 #define ENDIANNESS              _le
 #define MO_ENDIAN               MO_LE