From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Max Filippov" <jcmvbkbc@gmail.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 1/2] target/xtensa: Implement xtensa_isa_is_big_endian()
Date: Fri, 6 Dec 2024 00:24:36 +0100 [thread overview]
Message-ID: <20241205232437.85235-2-philmd@linaro.org> (raw)
In-Reply-To: <20241205232437.85235-1-philmd@linaro.org>
Xtensa internal fields are opaque, only accessible by
the Xtensa libisa. Implement xtensa_isa_is_big_endian()
to get vCPU endianness. This should be implemented in
libisa, not QEMU, but I couldn't figure out where to
contribute this.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/xtensa/xtensa-isa.h | 1 +
target/xtensa/xtensa-isa.c | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/include/hw/xtensa/xtensa-isa.h b/include/hw/xtensa/xtensa-isa.h
index a289531bdc8..1cb8e6ccb66 100644
--- a/include/hw/xtensa/xtensa-isa.h
+++ b/include/hw/xtensa/xtensa-isa.h
@@ -829,6 +829,7 @@ const char *xtensa_funcUnit_name(xtensa_isa isa, xtensa_funcUnit fun);
int xtensa_funcUnit_num_copies(xtensa_isa isa, xtensa_funcUnit fun);
+bool xtensa_isa_is_big_endian(xtensa_isa isa);
#ifdef __cplusplus
}
diff --git a/target/xtensa/xtensa-isa.c b/target/xtensa/xtensa-isa.c
index 630b4f9da1b..36eb4bcf3d4 100644
--- a/target/xtensa/xtensa-isa.c
+++ b/target/xtensa/xtensa-isa.c
@@ -1741,3 +1741,10 @@ int xtensa_funcUnit_num_copies(xtensa_isa isa, xtensa_funcUnit fun)
CHECK_FUNCUNIT(intisa, fun, XTENSA_UNDEFINED);
return intisa->funcUnits[fun].num_copies;
}
+
+bool xtensa_isa_is_big_endian(xtensa_isa isa)
+{
+ xtensa_isa_internal *intisa = (xtensa_isa_internal *)isa;
+
+ return intisa->is_big_endian;
+}
--
2.45.2
next prev parent reply other threads:[~2024-12-05 23:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-05 23:24 [PATCH 0/2] target/xtensa: Remove tswap() calls in semihosting Philippe Mathieu-Daudé
2024-12-05 23:24 ` Philippe Mathieu-Daudé [this message]
2024-12-06 12:35 ` [PATCH 1/2] target/xtensa: Implement xtensa_isa_is_big_endian() Max Filippov
2025-11-27 9:37 ` Philippe Mathieu-Daudé
2024-12-05 23:24 ` [PATCH 2/2] target/xtensa: Remove tswap() calls in semihosting simcall() helper Philippe Mathieu-Daudé
2024-12-06 12:41 ` Max Filippov
2024-12-06 14:34 ` Philippe Mathieu-Daudé
2024-12-06 14:54 ` Peter Maydell
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=20241205232437.85235-2-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=jcmvbkbc@gmail.com \
--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).