From: Philippe Mathieu-Daudé Date: Tue, 9 Dec 2025 18:24:05 +0000 (+0100) Subject: system: Allow restricting the legacy cpu_ld/st() 'native-endian' API X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c9429d213cc930d16fe3e2846e4f08d2d39bad6;p=thirdparty%2Fqemu.git system: Allow restricting the legacy cpu_ld/st() 'native-endian' API 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é Reviewed-by: Richard Henderson Message-ID: <20260109165058.59144-17-philmd@linaro.org> --- diff --git a/include/accel/tcg/cpu-ldst.h b/include/accel/tcg/cpu-ldst.h index 0de7f5eaa6..a5711bc15a 100644 --- a/include/accel/tcg/cpu-ldst.h +++ b/include/accel/tcg/cpu-ldst.h @@ -428,6 +428,7 @@ cpu_stq_le_data(CPUArchState *env, abi_ptr addr, uint64_t val) cpu_stq_le_data_ra(env, addr, val, 0); } +#ifndef TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API #if TARGET_BIG_ENDIAN # define cpu_lduw_data cpu_lduw_be_data # define cpu_ldsw_data cpu_ldsw_be_data @@ -501,5 +502,6 @@ static inline uint64_t cpu_ldq_code(CPUArchState *env, abi_ptr addr) MemOpIdx oi = make_memop_idx(MO_TEUQ, cpu_mmu_index(cs, true)); return cpu_ldq_code_mmu(env, addr, oi, 0); } +#endif /* TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API */ #endif /* ACCEL_TCG_CPU_LDST_H */