aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-09-26 19:06:02 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-10-15 12:13:59 -0300
commit3e10be75790df93ba2cdb10435860de214128da8 (patch)
tree56232b330b5753d03044df5711ca174aaa02fccc
parente99072b6ecd842558c68672f4601b4f6aeecdc2a (diff)
downloadqemu-3e10be75790df93ba2cdb10435860de214128da8.zip
qemu-3e10be75790df93ba2cdb10435860de214128da8.tar.gz
qemu-3e10be75790df93ba2cdb10435860de214128da8.tar.bz2
target/mips: Introduce mo_endian_env() helper
Introduce mo_endian_env() which returns the endian MemOp corresponding to the vCPU env. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Tested-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20241010215015.44326-4-philmd@linaro.org>
-rw-r--r--target/mips/internal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/target/mips/internal.h b/target/mips/internal.h
index 84c8e5e..91c786c 100644
--- a/target/mips/internal.h
+++ b/target/mips/internal.h
@@ -230,6 +230,11 @@ static inline bool mips_env_is_bigendian(CPUMIPSState *env)
return extract32(env->CP0_Config0, CP0C0_BE, 1);
}
+static inline MemOp mo_endian_env(CPUMIPSState *env)
+{
+ return mips_env_is_bigendian(env) ? MO_BE : MO_LE;
+}
+
static inline void restore_pamask(CPUMIPSState *env)
{
if (env->hflags & MIPS_HFLAG_ELPA) {