-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Pass core ID to port lock macros #1212
Pass core ID to port lock macros #1212
Conversation
Hi @felixvanoost - sorry for the late response. This looks great! I am going to ping someone with a bit more familiarity with SMP implementation to also take a look. The unit tests will need to be updated, but to save your time, I would wait on the other reviewer before updating them. Best, Jason Carroll |
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 verified this change with the unit test PR, and it works without issues. The PR can be found at FreeRTOS/FreeRTOS#1319.
Please note that this change is not backward compatible. Since all TASK and ISR spinlock port macros need to be implemented recursively, it makes sense to add the xCoreID parameter to these macros.
We should proceed to update the following ports for the port macros change:
portable/ThirdParty/Community-Supported-Ports/GCC/CORTEX_A53_64-bit_UltraScale_MPSoC/portmacro.h
portable/ThirdParty/Community-Supported-Ports/GCC/RP2350_ARM_NTZ/non_secure/portmacro.h
portable/ThirdParty/Community-Supported-Ports/GCC/RP2350_RISC-V/include/portmacro.h
portable/ThirdParty/Partner-Supported-Ports/TI/CORTEX_A53_64-BIT_TI_AM64_SMP/portmacro.h
@chinglee-iot I've created PRs in both repos with the corresponding changes. :) |
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.
Sorry could you fix the CMock unit tests?
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Quality Gate passedIssues Measures |
This is needed for PR - FreeRTOS/FreeRTOS-Kernel#1212.
@chinglee-iot addressed unit tests in this PR - FreeRTOS/FreeRTOS#1319. |
Requested changes has been done.
@felixvanoost Thank you for your contribution! |
Description
Passes the core ID as an argument to the SMP lock macros
port{GET/RELEASE}_{TASK/ISR}_LOCK
intasks.c
. Since #1206, the functions calling these macros keep track of the core ID, so the port-specific spinlock function implementations can eliminate their internal calls toportGET_CORE_ID()
to reduce the number of unnecessary, and generally slow, accesses to a peripheral register. This benefits the following FreeRTOS functions:portGET_CORE_ID()
prvCheckForRunStateChange()
vTaskSwitchContext()
vTaskEnterCritical()
vTaskEnterCriticalFromISR()
vTaskExitCritical()
vTaskExitCriticalFromISR()
I've updated the spinlock definitions for two of the three SMP-compatible ports (F1Kx and RP2040). The XCOREAI port spinlocks are implemented elsewhere in their toolchain so I've just cast the new argument to
void
.Test Steps
Timing analysis coming shortly.
Checklist:
Related Issue
Closes #1204
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.