Il mer 24 dic 2025, 16:24 Philippe Mathieu-Daudé <[email protected]> ha scritto:
> 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. > Host endianness APIs are fine and are used when talking to the kernel. These functions that take a void* should not be included in TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API. (And also they are the same for all targets so they don't get in the way of the single binary effort). If the only change needed in the series is to drop this patch, don't bother with reposting. Paolo > Signed-off-by: Philippe Mathieu-Daudé <[email protected]> > --- > include/qemu/bswap.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h > index 65a1b3634f4..d1c889e7bc9 100644 > --- a/include/qemu/bswap.h > +++ b/include/qemu/bswap.h > @@ -412,7 +412,9 @@ static inline void stq_be_p(void *ptr, uint64_t v) > } \ > } > > +#ifndef TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API > DO_STN_LDN_P(he) > +#endif > DO_STN_LDN_P(le) > DO_STN_LDN_P(be) > > @@ -423,6 +425,7 @@ DO_STN_LDN_P(be) > #undef le_bswaps > #undef be_bswaps > > +#ifndef TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API > > /* Return ld{word}_{le,be}_p following target endianness. */ > #define LOAD_IMPL(word, args...) \ > @@ -494,4 +497,6 @@ static inline void stn_p(void *ptr, int sz, uint64_t v) > > #undef STORE_IMPL > > +#endif /* TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API */ > + > #endif /* BSWAP_H */ > -- > 2.52.0 > >
