]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
system/memory: Remove DEVICE_HOST_ENDIAN definition
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 23 Apr 2025 11:11:31 +0000 (13:11 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 25 Apr 2025 15:09:58 +0000 (17:09 +0200)
Since the previous commit ("exec/memory.h: make devend_memop
"target defines" agnostic") there is a single use of the
DEVICE_HOST_ENDIAN definition in ram_device_mem_ops: inline
it and remove its definition altogether.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250423111625.10424-1-philmd@linaro.org>

include/exec/cpu-common.h
system/memory-internal.h
system/memory.c

index 9b83fd7ac8813b880d4fdd809a736cd060571e00..dab1e7e5809540d82ef29bc31816d148d8edf671 100644 (file)
@@ -44,12 +44,6 @@ enum device_endian {
     DEVICE_LITTLE_ENDIAN,
 };
 
-#if HOST_BIG_ENDIAN
-#define DEVICE_HOST_ENDIAN DEVICE_BIG_ENDIAN
-#else
-#define DEVICE_HOST_ENDIAN DEVICE_LITTLE_ENDIAN
-#endif
-
 /* address in the RAM (different from a physical address) */
 #if defined(CONFIG_XEN_BACKEND)
 typedef uint64_t ram_addr_t;
index 29717b3c58fe6e3b224fc31ccdc02444019d4f65..46f758fa7e47175c334baf513f1a704d3f151a75 100644 (file)
@@ -41,9 +41,6 @@ void mtree_print_dispatch(struct AddressSpaceDispatch *d,
 /* returns true if end is big endian. */
 static inline bool devend_big_endian(enum device_endian end)
 {
-    QEMU_BUILD_BUG_ON(DEVICE_HOST_ENDIAN != DEVICE_LITTLE_ENDIAN &&
-                      DEVICE_HOST_ENDIAN != DEVICE_BIG_ENDIAN);
-
     if (end == DEVICE_NATIVE_ENDIAN) {
         return target_big_endian();
     }
index 67e433095b42f5ef11a1abc50089c5a168d38ebd..71434e7ad02ccccab1276ddc63eed8686dd83abb 100644 (file)
@@ -1382,7 +1382,7 @@ static void memory_region_ram_device_write(void *opaque, hwaddr addr,
 static const MemoryRegionOps ram_device_mem_ops = {
     .read = memory_region_ram_device_read,
     .write = memory_region_ram_device_write,
-    .endianness = DEVICE_HOST_ENDIAN,
+    .endianness = HOST_BIG_ENDIAN ? DEVICE_BIG_ENDIAN : DEVICE_LITTLE_ENDIAN,
     .valid = {
         .min_access_size = 1,
         .max_access_size = 8,