mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
target/openrisc: Populate CPUClass.mmu_index
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
498c7d78d3
commit
db8b41941a
2 changed files with 15 additions and 8 deletions
|
@ -361,16 +361,10 @@ static inline void cpu_get_tb_cpu_state(CPUOpenRISCState *env, vaddr *pc,
|
|||
| (env->sr & (SR_SM | SR_DME | SR_IME | SR_OVE));
|
||||
}
|
||||
|
||||
int openrisc_cpu_mmu_index(CPUState *cs, bool ifetch);
|
||||
static inline int cpu_mmu_index(CPUOpenRISCState *env, bool ifetch)
|
||||
{
|
||||
int ret = MMU_NOMMU_IDX; /* mmu is disabled */
|
||||
|
||||
if (env->sr & (ifetch ? SR_IME : SR_DME)) {
|
||||
/* The mmu is enabled; test supervisor state. */
|
||||
ret = env->sr & SR_SM ? MMU_SUPERVISOR_IDX : MMU_USER_IDX;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return openrisc_cpu_mmu_index(env_cpu(env), ifetch);
|
||||
}
|
||||
|
||||
static inline uint32_t cpu_get_sr(const CPUOpenRISCState *env)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue