Skip to content

Commit

Permalink
Fix incorrect return to physical address upon ITLB page fault exception
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fallen committed Jun 14, 2012
1 parent 4225524 commit 0b65466
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion software/mmu-bios/crt0.S
Expand Up @@ -122,11 +122,12 @@ _dtlb_miss_exception_handler:
_itlb_miss_exception_handler:
sw (sp+0), ra
calli .save_all
rcsr r1, itlbma /* get virtual address which caused the page fault */
mv ea, r1 /* when returning from exception we branch back to that virtual address */
calli itlb_miss_handler
bi .restore_all_and_eret
nop
nop
nop

macaddress:
.byte 0x10
Expand Down

0 comments on commit 0b65466

Please sign in to comment.