Prevent double faults when either PC or SP is invalid

This commit is contained in:
TuxSH
2016-07-14 20:08:31 +02:00
parent d5190cd788
commit 004f0652c9
9 changed files with 80 additions and 8 deletions

View File

@@ -116,3 +116,14 @@ cleanInvalidateDCacheAndDMB:
mcr p15,0,r0,c7,c14,0 @ Clean and Invalidate Entire Data Cache
mcr p15,0,r0,c7,c10,4 @ Drain Memory Barrier
bx lr
.global cannotAccessVA
.type cannotAccessVA, %function
cannotAccessVA:
@ Thanks yellows8 for the hint
lsr r0, #12
lsl r0, #12
mcr p15,0,r0,c7,c8,0 @ VA to PA translation with privileged read permission check
mrc p15,0,r0,c7,c4,0 @ read PA register
and r0, #1 @ failure bit
bx lr