target-sh4: fix index of address read error exception
PATCH 1/1 target-sh4: fix index of address read error exception
Exception index of address read error should be 0x0e0.
--- target-sh4/helper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
target-sh4/helper.c +1 -1
@@ -479,7 +479,7 @@ int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw,break ;case MMU_IADDR_ERROR :case MMU_DADDR_ERROR_READ : - env->exception_index =0x0c0 ; + env->exception_index =0x0e0 ;break ;case MMU_DADDR_ERROR_WRITE : env->exception_index =0x100 ;
Signature · 1 line
1.7.3.5
PATCH 1/1 target-sh4: update PTEH upon MMU exception
Update the PTEH register to contain the VPN at which an MMU exception occured as specified by the SH4 reference.
--- target-sh4/helper.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
target-sh4/helper.c +3 -0
@@ -453,6 +453,9 @@ int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw,if (ret !=MMU_OK ) { env->tea = address; +if (ret !=MMU_DTLB_MULTIPLE && ret !=MMU_ITLB_MULTIPLE ) + env->pteh = (env->pteh &PTEH_ASID_MASK ) | + (address &PTEH_VPN_MASK );switch (ret) {case MMU_ITLB_MISS :case MMU_DTLB_MISS_READ :
Signature · 1 line
1.7.3.5
Aurelien Jarno
AppliedQuoted 10 lines · Alexandre Courbot
Exception index of address read error should be
0x0e0.--- target-sh4/helper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)target-sh4/helper.c +0
-0
target-sh4/helper.c int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw, · line 485
Quoted 8 lines
target-sh4/helper.c +1
-1@@ -479,7 +479,7 @@ int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw,break ;case MMU_IADDR_ERROR :case MMU_DADDR_ERROR_READ : - env->exception_index =0x0c0 ; + env->exception_index =0x0e0 ;break ;case MMU_DADDR_ERROR_WRITE : env->exception_index =0x100 ;
Thanks, applied.
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net
Re: [Qemu-devel] [PATCH] target-sh4: update PTEH upon MMU exception
In reply to Alexandre CourbotQuoted 11 lines · Alexandre Courbot
Update the PTEH register to contain the VPN at which an MMU exception occured as specified by the SH4 reference.
--- target-sh4/helper.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)target-sh4/helper.c +0
-0
target-sh4/helper.c int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw, · line 458
Quoted 6 lines
target-sh4/helper.c +3
-0@@ -453,6 +453,9 @@ int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw,if (ret !=MMU_OK ) { env->tea = address; +if (ret !=MMU_DTLB_MULTIPLE && ret !=MMU_ITLB_MULTIPLE ) + env->pteh = (env->pteh &PTEH_ASID_MASK ) | + (address &PTEH_VPN_MASK );
The code in itself is correct, however you should follow CODING_STYLE and write the if the following way:
if () {
}Quoted 8 lines
target-sh4/helper.c +0
-0switch (ret) {case MMU_ITLB_MISS :case MMU_DTLB_MISS_READ :Signature · 1 line
1.7.3.5
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net
PATCH v2 1/1 target-sh4: update PTEH upon MMU exception
Update the PTEH register to contain the VPN at which an MMU exception occured as specified by the SH4 reference.
--- target-sh4/helper.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
target-sh4/helper.c +4 -0
@@ -453,6 +453,10 @@ int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw,if (ret !=MMU_OK ) { env->tea = address; +if (ret !=MMU_DTLB_MULTIPLE && ret !=MMU_ITLB_MULTIPLE ) { + env->pteh = (env->pteh &PTEH_ASID_MASK ) | + (address &PTEH_VPN_MASK ); + }switch (ret) {case MMU_ITLB_MISS :case MMU_DTLB_MISS_READ :
Signature · 1 line
1.7.3.5
Aurelien Jarno
AppliedRe: [Qemu-devel] [PATCH v2] target-sh4: update PTEH upon MMU exception
Quoted 7 lines · Alexandre Courbot
Update the PTEH register to contain the VPN at which an MMU exception occured as specified by the SH4 reference.
Signed-off-by Alexandre Courbot <[email protected]>--- target-sh4/helper.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
Thanks, applied.
Quoted 20 lines
target-sh4/helper.c +4
-0@@ -453,6 +453,10 @@ int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw,if (ret !=MMU_OK ) { env->tea = address; +if (ret !=MMU_DTLB_MULTIPLE && ret !=MMU_ITLB_MULTIPLE ) { + env->pteh = (env->pteh &PTEH_ASID_MASK ) | + (address &PTEH_VPN_MASK ); + }switch (ret) {case MMU_ITLB_MISS :case MMU_DTLB_MISS_READ :Signature · 1 line
1.7.3.5
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net