Skip to content

Conversation

@bbolen
Copy link

@bbolen bbolen commented Nov 1, 2021

@ibirnbaum This adds a patch for renaming the cortex-r kconfig to include "aarch32" that stephanosio suggested in your cortex-a pull request.

@github-actions github-actions bot added area: API Changes to public APIs area: ARM ARM (32-bit) Architecture area: Kernel area: Modules area: Test Framework Issues related not to a particular test, but to the framework instead area: Tests Issues related to a particular existing or missing test labels Nov 1, 2021
@tejlmand
Copy link
Contributor

tejlmand commented Nov 8, 2021

@ibirnbaum This adds a patch for renaming the cortex-r kconfig to include "aarch32" that stephanosio suggested in your cortex-a pull request.

Could you please link the refered PR ?
Also, which commits of this PR should be reviewed ?
If this PR is not intended for review, please put it in draft and mention so in the PR message.

@bbolen
Copy link
Author

bbolen commented Nov 17, 2021

@ibirnbaum This adds a patch for renaming the cortex-r kconfig to include "aarch32" that stephanosio suggested in your cortex-a pull request.

Could you please link the refered PR ? Also, which commits of this PR should be reviewed ? If this PR is not intended for review, please put it in draft and mention so in the PR message.

#36983 (comment)

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.

@bbolen bbolen changed the title DNM: Cortex r mpufix Cortex r mpufix Nov 17, 2021
@bbolen bbolen changed the title Cortex r mpufix Cortex-R mpu fix Nov 17, 2021
@bbolen bbolen force-pushed the cortex_r_mpufix branch 3 times, most recently from 574b00f to 1336aa6 Compare December 6, 2021 14:55
@bbolen bbolen added this to the v3.0.0 milestone Dec 6, 2021
@carlescufi carlescufi requested a review from ibirnbaum December 10, 2021 14:43
@bbolen
Copy link
Author

bbolen commented Jan 11, 2022

@ibirnbaum Any chance you could take a look at this?

Copy link
Member

@ibirnbaum ibirnbaum left a 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.

@bbolen
Copy link
Author

bbolen commented Jan 27, 2022

@stephanosio Can you take a look at this?

Copy link
Member

@stephanosio stephanosio left a 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.

Bradley Bolen added 3 commits January 27, 2022 10:21
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: API Changes to public APIs area: ARM ARM (32-bit) Architecture area: Build System area: CMSIS-DSP area: Kernel area: Modules area: Test Framework Issues related not to a particular test, but to the framework instead area: Tests Issues related to a particular existing or missing test area: Testsuite Testsuite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants