Skip to content

Commit cc12f0f

Browse files
committed
arch: arm: cortex_m: Modifed FPU save and restore helpers
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>
1 parent df48ea2 commit cc12f0f

File tree

1 file changed

+2
-2
lines changed
  • arch/arm/core/cortex_m

1 file changed

+2
-2
lines changed

arch/arm/core/cortex_m/fpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
void z_arm_save_fp_context(struct fpu_ctx_full *buffer)
1818
{
19-
#if defined(CONFIG_FPU_SHARING)
19+
#if defined(CONFIG_FPU)
2020
__ASSERT_NO_MSG(buffer != NULL);
2121

2222
uint32_t CONTROL = __get_CONTROL();
@@ -44,7 +44,7 @@ void z_arm_save_fp_context(struct fpu_ctx_full *buffer)
4444

4545
void z_arm_restore_fp_context(const struct fpu_ctx_full *buffer)
4646
{
47-
#if defined(CONFIG_FPU_SHARING)
47+
#if defined(CONFIG_FPU)
4848
if (buffer->ctx_saved) {
4949
/* Set FPCA first so it is set even if an interrupt happens
5050
* during restoration.

0 commit comments

Comments
 (0)