-
Notifications
You must be signed in to change notification settings - Fork 7.6k
arch: arm: cortex_m: Update APIs to save and restore FPU context #93057
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
base: main
Are you sure you want to change the base?
Conversation
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.
Thank you for the change, could you please have a look at https://docs.zephyrproject.org/latest/contribute/guidelines.html#commit-message-guidelines and fix the commit message?
Added missing #include for used types uint32_t and bool in file fpu.h Signed-off-by: Michele Sardo <msmttchr@gmail.com>
a1ea5dd
to
88f56ef
Compare
Done. |
z_arm_save_fp_context and z_arm_restore_fp_context save and restore fpu context regardless of the CONFIG_FPU_SHARING setting. This modification is required to support suspend to ram use cases where save and restore of FPU state is needed to ensure proper bahaviour after wakeup. Signed-off-by: Michele Sardo <michele.sardo@st.com>
Following changes to arch/arm/core/cortex_m/fpu.c, the dependency on CONFIG_FPU_SHARING is moved into this file. Signed-off-by: Michele Sardo <michele.sardo@st.com>
88f56ef
to
4dd3bd6
Compare
|
Update API to save and restore FPU context to address suspend to ram use case.
The API is updated as follow:
z_arm_save_fp_context
andz_arm_restore_fp_context
have been changed to always save/restore FPU context regardless ofFPU_SHARING
settingI also noticed by reading code and ARM documentation that the FPU context is preserved across threads by hardware on Cortex-M devices (via the FPCCR.ASPEN register field).
See also #90001, #92847 (comment)