[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/57] target/hppa: Populate CPUClass.mmu_index
From: |
Richard Henderson |
Subject: |
[PULL 09/57] target/hppa: Populate CPUClass.mmu_index |
Date: |
Fri, 2 Feb 2024 15:49:48 +1000 |
Reviewed-by: Helge Deller <deller@gmx.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hppa/cpu.h | 7 ++-----
target/hppa/cpu.c | 12 ++++++++++++
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h
index 6a153405d2..04439f247d 100644
--- a/target/hppa/cpu.h
+++ b/target/hppa/cpu.h
@@ -281,16 +281,13 @@ static inline int HPPA_BTLB_ENTRIES(CPUHPPAState *env)
return hppa_is_pa20(env) ? 0 : PA10_BTLB_FIXED + PA10_BTLB_VARIABLE;
}
+int hppa_cpu_mmu_index(CPUState *cs, bool ifetch);
static inline int cpu_mmu_index(CPUHPPAState *env, bool ifetch)
{
#ifdef CONFIG_USER_ONLY
return MMU_USER_IDX;
#else
- if (env->psw & (ifetch ? PSW_C : PSW_D)) {
- return PRIV_P_TO_MMU_IDX(env->iaoq_f & 3, env->psw & PSW_P);
- }
- /* mmu disabled */
- return env->psw & PSW_W ? MMU_ABS_W_IDX : MMU_ABS_IDX;
+ return hppa_cpu_mmu_index(env_cpu(env), ifetch);
#endif
}
diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c
index 3c019855b4..fbb37e541e 100644
--- a/target/hppa/cpu.c
+++ b/target/hppa/cpu.c
@@ -94,6 +94,17 @@ static bool hppa_cpu_has_work(CPUState *cs)
return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI);
}
+int hppa_cpu_mmu_index(CPUState *cs, bool ifetch)
+{
+ CPUHPPAState *env = cpu_env(cs);
+
+ if (env->psw & (ifetch ? PSW_C : PSW_D)) {
+ return PRIV_P_TO_MMU_IDX(env->iaoq_f & 3, env->psw & PSW_P);
+ }
+ /* mmu disabled */
+ return env->psw & PSW_W ? MMU_ABS_W_IDX : MMU_ABS_IDX;
+}
+
static void hppa_cpu_disas_set_info(CPUState *cs, disassemble_info *info)
{
info->mach = bfd_mach_hppa20;
@@ -194,6 +205,7 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *data)
cc->class_by_name = hppa_cpu_class_by_name;
cc->has_work = hppa_cpu_has_work;
+ cc->mmu_index = hppa_cpu_mmu_index;
cc->dump_state = hppa_cpu_dump_state;
cc->set_pc = hppa_cpu_set_pc;
cc->get_pc = hppa_cpu_get_pc;
--
2.34.1
- [PULL 00/57] tcg patch queue, Richard Henderson, 2024/02/02
- [PULL 01/57] include/hw/core: Add mmu_index to CPUClass, Richard Henderson, 2024/02/02
- [PATCH] linux-user/aarch64: Add padding before __kernel_rt_sigreturn, Richard Henderson, 2024/02/02
- [PULL 02/57] target/alpha: Split out alpha_env_mmu_index, Richard Henderson, 2024/02/02
- [PULL 03/57] target/alpha: Populate CPUClass.mmu_index, Richard Henderson, 2024/02/02
- [PULL 04/57] target/arm: Split out arm_env_mmu_index, Richard Henderson, 2024/02/02
- [PULL 05/57] target/arm: Populate CPUClass.mmu_index, Richard Henderson, 2024/02/02
- [PULL 06/57] target/avr: Populate CPUClass.mmu_index, Richard Henderson, 2024/02/02
- [PULL 07/57] target/cris: Cache mem_index in DisasContext, Richard Henderson, 2024/02/02
- [PULL 08/57] target/cris: Populate CPUClass.mmu_index, Richard Henderson, 2024/02/02
- [PULL 09/57] target/hppa: Populate CPUClass.mmu_index,
Richard Henderson <=
- [PULL 10/57] target/i386: Populate CPUClass.mmu_index, Richard Henderson, 2024/02/02
- [PULL 11/57] target/loongarch: Populate CPUClass.mmu_index, Richard Henderson, 2024/02/02
- [PULL 12/57] target/loongarch: Rename MMU_IDX_*, Richard Henderson, 2024/02/02
- [PULL 13/57] target/m68k: Populate CPUClass.mmu_index, Richard Henderson, 2024/02/02
- [PULL 14/57] target/microblaze: Populate CPUClass.mmu_index, Richard Henderson, 2024/02/02
- [PULL 15/57] target/mips: Pass ptw_mmu_idx down from mips_cpu_tlb_fill, Richard Henderson, 2024/02/02
- [PULL 19/57] target/openrisc: Populate CPUClass.mmu_index, Richard Henderson, 2024/02/02
- [PULL 20/57] target/ppc: Split out ppc_env_mmu_index, Richard Henderson, 2024/02/02
- [PULL 21/57] target/ppc: Populate CPUClass.mmu_index, Richard Henderson, 2024/02/02
- [PULL 22/57] target/riscv: Rename riscv_cpu_mmu_index to riscv_env_mmu_index, Richard Henderson, 2024/02/02