forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arm: use BASEPRI_MAX instead of BASEPRI to mask interrupts
When locking interrupt in a critical session, it is safer to do MSR BASEPRI_MAX instead of BASEPRI. The rationale is that when writing to BASEPRI_MAX, the writing is conditional, and is only applied if the change is to a higher priority level. This commit replaces BASEPRI with BASEPRI_MAX in operations that aim to lock some specific interrupts: - irq_lock() - masking out PendSV So, for example, it is not possible to actually unmask any interrupts by doing an irq_lock operation. The commit does not introduce behavioral changes. However, it makes irq_lock() more robust against future changes to the IRQ locking mechanism. Signed-off-by: Ioannis Glaropoulos <[email protected]>
- Loading branch information
Showing
3 changed files
with
4 additions
and
4 deletions.
There are no files selected for viewing
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