-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(trap): support atomic instructions emulation
Since HPM6360 dose not support execute atomic load/store with SDRAM address range, we need to emulation atomic instructions execute in trap handler then the Linux kernel can runs without any modifications and user space thread also is supported. For AMO instructions, they will trap into Store/AMO access fault exception during execution, so we can emulate it in store fault exception handler. For lr/sc instructions, lr will trap into Load access fault during execution but sc won't, however. So we need to replace sc into an illegal instruction which I use csrrw zero, time, zero here, then it will trap into Illegal instruction exception and gets be replaced back during exception handling. After replacing instructions we have to execute fence.i to make sure this data store is visible to the subsequent instruction fetch. Signed-off-by: tfx2001 <tfx2001@outlook.com>
- Loading branch information
Showing
5 changed files
with
238 additions
and
49 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters