-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add port-optimised task selection for ARMv8-M #703
Add port-optimised task selection for ARMv8-M #703
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #703 +/- ##
==========================================
+ Coverage 94.35% 94.43% +0.08%
==========================================
Files 6 6
Lines 2428 2428
Branches 596 596
==========================================
+ Hits 2291 2293 +2
+ Misses 87 85 -2
Partials 50 50
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Also tested this on https://github.com/FreeRTOS/iot-reference-stm32u5 just now and it works. |
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
@aggarg Great catch on the default setting. Thanks! |
Add port-optimised task selection for ARMv8-M
Description
Add port-optimised task selection for ARMv8-M, patterned after the existing implementation on ARMv7-M. Include a compile-time error for baseline implementations of ARMv8-M like CM23 (without the "main" extension described in the Architecture Reference Manual) attempting to use configPORT_OPTIMISED_TASK_SELECTION. Those CPUs do not support the
clz
instruction used in the implementation of port-optimised task selection.During the migration of this feature from ARMv7-M to ARMv8-M, the helper function
ucPortCountLeadingZeros()
becameulPortCountLeadingZeros()
(returning a uint32_t, not a uint8_t) to stop forcing the compiler to generate an unnecessaryuxtb
instruction to clear out the upper 24 bits of the register. Theclz
instruction always writes a full 32-bit value to the destination register.Test Steps
Copy the port files from this PR into a local clone of the full FreeRTOS distribution. Then:
clz
in vTaskSwitchContext().Copy the port and kernel files from this PR into a local clone of https://github.com/jefftenney/LPTIM-Tick-U5/ (for STM32U585, CM33). Then:
clz
in disassembly for vTaskSwitchContext().Checklist:
[X] I have tested my changes. No regression in existing tests.
[X] I have modified and/or added unit-tests to cover the code changes in this Pull Request.(N/A)Related Issues
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.