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 "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)
/* 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;
}