Ensure that FPU state enables fpu on aarch32

When the FPU state is loaded from a thread for the first time the
uninitialised floating point exception register is 0 leading to the FPU
being disabled until an instruction fault occurs in that thread upon
re-entry.

Clearly, if we are loading the FPU state for a thread we want the FPU to
be enabled so we enable it whenever it is loaded.
This commit is contained in:
Curtis Millar
2019-07-15 13:23:48 +10:00
parent 89e53be40b
commit 05391acdf4

View File

@@ -198,8 +198,8 @@ static inline void loadFpuState(user_fpu_state_t *src)
/* Load FPSCR. */
VMSR(FPSCR, src->fpscr);
/* Restore FPEXC. */
VMSR(FPEXC, src->fpexc);
/* Restore FPEXC ensuring that it is enabled. */
VMSR(FPEXC, src->fpexc | BIT(FPEXC_EN_BIT));
}
#endif /* CONFIG_HAVE_FPU */