Skip to content

Commit 0b65466

Browse files
committedJun 14, 2012
Fix incorrect return to physical address upon ITLB page fault exception
When returning from itlb page fault we need to return to the virtual address which caused the page fault and not the physical address. We therefore overwrite the content of "ea" (exception address) register with the result of rcsr ITLBMA.
1 parent 4225524 commit 0b65466

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

Diff for: ‎software/mmu-bios/crt0.S

+2-1
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,12 @@ _dtlb_miss_exception_handler:
122122
_itlb_miss_exception_handler:
123123
sw (sp+0), ra
124124
calli .save_all
125+
rcsr r1, itlbma /* get virtual address which caused the page fault */
126+
mv ea, r1 /* when returning from exception we branch back to that virtual address */
125127
calli itlb_miss_handler
126128
bi .restore_all_and_eret
127129
nop
128130
nop
129-
nop
130131

131132
macaddress:
132133
.byte 0x10

0 commit comments

Comments
 (0)
Please sign in to comment.