-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix portSET_INTERRUPT_MASK_FROM_ISR definition for atomic operation #940
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #940 +/- ##
=======================================
Coverage 93.78% 93.78%
=======================================
Files 6 6
Lines 3186 3186
Branches 885 885
=======================================
Hits 2988 2988
Misses 91 91
Partials 107 107
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@chinglee-iot This fix looks right to me. However, I noticed it introduces a "new" requirement for developers not to use the atomic interface from ISRs on ports that don't support nested interrupts. Since there is no need for ISRs to use the atomic interface on those ports, the "new" requirement seems harmless enough. Do you think some additional comments added to atomic.h would help provide clarity? The atomic interface is intended for use outside of ISRs, on all ports, and also for use inside ISRs on ports that support nested interrupts. However, the atomic interface must not be used from ISRs on ports without support for nested interrupts. ISR code on these ports is already atomic. Alternatively, the atomic interface could add |
Co-authored-by: Gaurav-Aggarwal-AWS <[email protected]>
Co-authored-by: Gaurav-Aggarwal-AWS <[email protected]>
Co-authored-by: Gaurav-Aggarwal-AWS <[email protected]>
Co-authored-by: Gaurav-Aggarwal-AWS <[email protected]>
Co-authored-by: Gaurav-Aggarwal-AWS <[email protected]>
|
…unning again. Fixed a typo in a file. Added a section to the link file (FreeRTOS#940) Co-authored-by: Soren Ptak <[email protected]>
Fix portSET_INTERRUPT_MASK_FROM_ISR definition for atomic operation
Description
In FreeRTOS.h, portSET_INTERRUPT_MASK_FROM_ISR is always defined to 0 if left undefined.
This cause the following code in atomic.h always been evaluated to true by preprocessor.
In this PR
portHAS_NESTED_INTERRUPTS
to 1 if portSET_INTERRUPT_MASK_FROM_ISR and portCLEAR_INTERRUPT_MASK_FROM_ISR are defined by the port.#if ( portHAS_NESTED_INTERRUPTS == 1 )
instead.Test Steps
Not define
portSET/CLEAR_INTERRUPT_MASK_FROM_ISR
in portmacro.h, the following defines are declared in atomic.h:Define
portSET/CLEAR_INTERRUPT_MASK_FROM_ISR
in portmacro.h, the following defines are declared in atomic.h:Checklist:
Related Issue
#936
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.