-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Cortex-R mpu fix #39963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cortex-R mpu fix #39963
Conversation
Could you please link the refered PR ? |
I put in the DNM b/c I was gone for 2 weeks and wouldn't be able to respond to anything. I'll remove it. All 3 commits should be reviewed. |
574b00f to
1336aa6
Compare
1336aa6 to
a420819
Compare
|
@ibirnbaum Any chance you could take a look at this? |
ibirnbaum
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
|
@stephanosio Can you take a look at this? |
stephanosio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not done a comprehensive analysis on the Cortex-R syscall architecture change; but, it looks reasonable at first glance.
When calling a syscall, the SVC routine will now elevate the thread to privileged mode and exit the SVC setting the return address to the syscall handler. When the thread is swapped back in, it will be running z_do_arm_syscall in system mode. That function will run the syscall then automatically return the thread to usr mode. This allows running the syscall in sys mode on a thread so that we can use syscalls that sleep without doing unnatural things. The previous implementation would enable interrupts while still in the SVC call and do weird things with the nesting count. An interrupt could happen during this time when the syscall was still in the exception state, but the nested count had been decremented too soon. Correctness of the nested count is important for future floating point unit work. The Cortex-R behavior now matches that of Cortex-M. Signed-off-by: Bradley Bolen <[email protected]>
Replace CONFIG_CPU_CORTEX_R with CONFIG_ARMV7_R since it is clearer with respect to the difference between v7 and v8 Cortex-R. Signed-off-by: Bradley Bolen <[email protected]>
These functions help the code to be more self-documenting. Use them to make the code's intent clearer. Signed-off-by: Bradley Bolen <[email protected]>
a420819 to
29b665c
Compare
@ibirnbaum This adds a patch for renaming the cortex-r kconfig to include "aarch32" that stephanosio suggested in your cortex-a pull request.