mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
target-microblaze: Consolidate MMU enabled checks
Consolidate MMU enabled checks to cpu_mmu_index(). No functional changes. Suggested-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
This commit is contained in:
@@ -58,8 +58,7 @@ int mb_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int size, int rw,
|
||||
int prot;
|
||||
|
||||
/* Translate if the MMU is available and enabled. */
|
||||
if (cpu->cfg.use_mmu && (env->sregs[SR_MSR] & MSR_VM)
|
||||
&& mmu_idx != MMU_NOMMU_IDX) {
|
||||
if (mmu_idx != MMU_NOMMU_IDX) {
|
||||
uint32_t vaddr, paddr;
|
||||
struct microblaze_mmu_lookup lu;
|
||||
|
||||
@@ -270,9 +269,10 @@ hwaddr mb_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
|
||||
CPUMBState *env = &cpu->env;
|
||||
target_ulong vaddr, paddr = 0;
|
||||
struct microblaze_mmu_lookup lu;
|
||||
int mmu_idx = cpu_mmu_index(env, false);
|
||||
unsigned int hit;
|
||||
|
||||
if (env->sregs[SR_MSR] & MSR_VM) {
|
||||
if (mmu_idx != MMU_NOMMU_IDX) {
|
||||
hit = mmu_translate(&env->mmu, &lu, addr, 0, 0);
|
||||
if (hit) {
|
||||
vaddr = addr & TARGET_PAGE_MASK;
|
||||
|
||||
Reference in New Issue
Block a user