Browse Source

system: Allow restricting the legacy DEVICE_NATIVE_ENDIAN definition

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>
pull/316/head
Philippe Mathieu-Daudé 4 months ago
parent
commit
8b2f859063
  1. 8
      include/system/memory.h
  2. 2
      system/memory-internal.h

8
include/system/memory.h

@ -27,9 +27,11 @@
#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)

2
system/memory-internal.h

@ -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;
}

Loading…
Cancel
Save