From aed74479fde702ea44888685ba10c84627aecfce Mon Sep 17 00:00:00 2001 From: joevt Date: Sun, 12 Nov 2023 22:52:41 -0800 Subject: [PATCH] ppcmmu: Handle undefined mmu mode. --- cpu/ppc/ppcmmu.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cpu/ppc/ppcmmu.cpp b/cpu/ppc/ppcmmu.cpp index a317b83..a3031d8 100644 --- a/cpu/ppc/ppcmmu.cpp +++ b/cpu/ppc/ppcmmu.cpp @@ -389,6 +389,10 @@ void mmu_change_mode() pCurITLB1 = &itlb1_mode2[0]; pCurITLB2 = &itlb2_mode2[0]; break; + case 1: + // user mode can't disable translations + LOG_F(ERROR, "instruction mmu mode 1 is invalid!"); + mmu_mode = 3; case 3: // user mode with instruction translation enabled pCurITLB1 = &itlb1_mode3[0]; pCurITLB2 = &itlb2_mode3[0]; @@ -410,6 +414,10 @@ void mmu_change_mode() pCurDTLB1 = &dtlb1_mode2[0]; pCurDTLB2 = &dtlb2_mode2[0]; break; + case 1: + // user mode can't disable translations + LOG_F(ERROR, "data mmu mode 1 is invalid!"); + mmu_mode = 3; case 3: // user mode with data translation enabled pCurDTLB1 = &dtlb1_mode3[0]; pCurDTLB2 = &dtlb2_mode3[0];