FreeRTOS / FreeRTOS-Kernel

FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.
https://www.FreeRTOS.org
MIT License
2.51k stars 1.05k forks source link

Add configUSE_TASK_FPU_SUPPORT to AARCH64 port #1048

Closed StefanBalt closed 2 months ago

StefanBalt commented 2 months ago

Description

NEON SIMD is required by standard AARCH64 and its registers are frequently utilized by standard functions such as memcpy(). This means that even simple tasks that do not use any floating point arithmetics may still alter the contents of the FPU registers.

For this reason it makes sense to add support for configUSE_TASK_FPU_SUPPORT to be able to enforce FPU register saving and restoring globally.

Without configUSE_TASK_FPU_SUPPORT it is not possible to enforce this for some library tasks.

This pull request partially fixes this issue: https://forums.freertos.org/t/zynq-ultrascale-mpsoc-task-floating-point-corruption/9121

For a full fix portASM.S also needs to be adapted to save/restore all FPU registers at interrupt entry/exit. Maybe I will find time to contribute this in another pull request.

Checklist:

Related Issue

My colleague did already something similar for the ARM Cortex R5 port: GH-584

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

aggarg commented 2 months ago

@StefanBalt Thank you for your contribution.