mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
target/microblaze: 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
a5a2d7f64f
commit
167d6cd0e8
2 changed files with 19 additions and 12 deletions
|
@ -118,6 +118,22 @@ static bool mb_cpu_has_work(CPUState *cs)
|
||||||
return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI);
|
return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int mb_cpu_mmu_index(CPUState *cs, bool ifetch)
|
||||||
|
{
|
||||||
|
CPUMBState *env = cpu_env(cs);
|
||||||
|
MicroBlazeCPU *cpu = env_archcpu(env);
|
||||||
|
|
||||||
|
/* Are we in nommu mode?. */
|
||||||
|
if (!(env->msr & MSR_VM) || !cpu->cfg.use_mmu) {
|
||||||
|
return MMU_NOMMU_IDX;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (env->msr & MSR_UM) {
|
||||||
|
return MMU_USER_IDX;
|
||||||
|
}
|
||||||
|
return MMU_KERNEL_IDX;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_USER_ONLY
|
#ifndef CONFIG_USER_ONLY
|
||||||
static void mb_cpu_ns_axi_dp(void *opaque, int irq, int level)
|
static void mb_cpu_ns_axi_dp(void *opaque, int irq, int level)
|
||||||
{
|
{
|
||||||
|
@ -415,7 +431,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
||||||
cc->class_by_name = mb_cpu_class_by_name;
|
cc->class_by_name = mb_cpu_class_by_name;
|
||||||
cc->has_work = mb_cpu_has_work;
|
cc->has_work = mb_cpu_has_work;
|
||||||
|
cc->mmu_index = mb_cpu_mmu_index;
|
||||||
cc->dump_state = mb_cpu_dump_state;
|
cc->dump_state = mb_cpu_dump_state;
|
||||||
cc->set_pc = mb_cpu_set_pc;
|
cc->set_pc = mb_cpu_set_pc;
|
||||||
cc->get_pc = mb_cpu_get_pc;
|
cc->get_pc = mb_cpu_get_pc;
|
||||||
|
|
|
@ -434,19 +434,10 @@ void mb_cpu_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr,
|
||||||
MemTxResult response, uintptr_t retaddr);
|
MemTxResult response, uintptr_t retaddr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int mb_cpu_mmu_index(CPUState *cs, bool ifetch);
|
||||||
static inline int cpu_mmu_index(CPUMBState *env, bool ifetch)
|
static inline int cpu_mmu_index(CPUMBState *env, bool ifetch)
|
||||||
{
|
{
|
||||||
MicroBlazeCPU *cpu = env_archcpu(env);
|
return mb_cpu_mmu_index(env_cpu(env), ifetch);
|
||||||
|
|
||||||
/* Are we in nommu mode?. */
|
|
||||||
if (!(env->msr & MSR_VM) || !cpu->cfg.use_mmu) {
|
|
||||||
return MMU_NOMMU_IDX;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (env->msr & MSR_UM) {
|
|
||||||
return MMU_USER_IDX;
|
|
||||||
}
|
|
||||||
return MMU_KERNEL_IDX;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_USER_ONLY
|
#ifndef CONFIG_USER_ONLY
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue