aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2024-01-28 14:47:19 +1000
committerRichard Henderson <richard.henderson@linaro.org>2024-02-03 08:52:25 +1000
commit32a8ea12fab6b8f2959090819aa589c24b33715e (patch)
tree3dd4aebce09ad448512570b1db469b1665681a28 /target
parent343ed32dacd866e393a8fa4825c53bcd610330f5 (diff)
downloadqemu-32a8ea12fab6b8f2959090819aa589c24b33715e.zip
qemu-32a8ea12fab6b8f2959090819aa589c24b33715e.tar.gz
qemu-32a8ea12fab6b8f2959090819aa589c24b33715e.tar.bz2
target/alpha: Split out alpha_env_mmu_index
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target')
-rw-r--r--target/alpha/cpu.h7
-rw-r--r--target/alpha/translate.c2
2 files changed, 7 insertions, 2 deletions
diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h
index ce80658..3beff27 100644
--- a/target/alpha/cpu.h
+++ b/target/alpha/cpu.h
@@ -389,7 +389,7 @@ enum {
#define TB_FLAG_UNALIGN (1u << 1)
-static inline int cpu_mmu_index(CPUAlphaState *env, bool ifetch)
+static inline int alpha_env_mmu_index(CPUAlphaState *env)
{
int ret = env->flags & ENV_FLAG_PS_USER ? MMU_USER_IDX : MMU_KERNEL_IDX;
if (env->flags & ENV_FLAG_PAL_MODE) {
@@ -398,6 +398,11 @@ static inline int cpu_mmu_index(CPUAlphaState *env, bool ifetch)
return ret;
}
+static inline int cpu_mmu_index(CPUAlphaState *env, bool ifetch)
+{
+ return alpha_env_mmu_index(env);
+}
+
enum {
IR_V0 = 0,
IR_T0 = 1,
diff --git a/target/alpha/translate.c b/target/alpha/translate.c
index 134eb72..4b464f8 100644
--- a/target/alpha/translate.c
+++ b/target/alpha/translate.c
@@ -2875,7 +2875,7 @@ static void alpha_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu)
int64_t bound;
ctx->tbflags = ctx->base.tb->flags;
- ctx->mem_idx = cpu_mmu_index(env, false);
+ ctx->mem_idx = alpha_env_mmu_index(env);
ctx->implver = env->implver;
ctx->amask = env->amask;