From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Peter Xu" <peterx@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [PATCH] system/memory: Remove DEVICE_HOST_ENDIAN definition
Date: Wed, 23 Apr 2025 13:16:25 +0200 [thread overview]
Message-ID: <20250423111625.10424-1-philmd@linaro.org> (raw)
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>
---
Based-on: <20250422192819.302784-1-richard.henderson@linaro.org>
---
include/exec/cpu-common.h | 6 ------
system/memory-internal.h | 3 ---
system/memory.c | 2 +-
3 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 9b83fd7ac88..dab1e7e5809 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -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;
diff --git a/system/memory-internal.h b/system/memory-internal.h
index 085e81a9fe4..ed5d75de24b 100644
--- a/system/memory-internal.h
+++ b/system/memory-internal.h
@@ -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_words_bigendian();
}
diff --git a/system/memory.c b/system/memory.c
index 7e2f16f4e95..b398f656c2f 100644
--- a/system/memory.c
+++ b/system/memory.c
@@ -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,
--
2.47.1
next reply other threads:[~2025-04-23 11:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 11:16 Philippe Mathieu-Daudé [this message]
2025-04-23 11:48 ` [PATCH] system/memory: Remove DEVICE_HOST_ENDIAN definition David Hildenbrand
2025-04-23 14:39 ` Richard Henderson
2025-04-25 10:43 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250423111625.10424-1-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=david@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).