Skip to content
Permalink
Browse files

arch: arm: clear FPSCR before main()

Initialize the Floating Point Status and Control Register when in
Unshared FP Registers mode (In Shared FP Registers mode, FPSCR is
initialized at thread creation for threads that make use of the FP).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
  • Loading branch information...
ioannisg authored and nashif committed May 2, 2019
1 parent 1a2ef42 commit 2d6f6d218a0b48a8bf5dc9bd4bcd18f07f67bd6d
Showing with 8 additions and 0 deletions.
  1. +8 −0 arch/arm/include/kernel_arch_func.h
@@ -47,6 +47,14 @@ z_arch_switch_to_main_thread(struct k_thread *main_thread,
k_thread_stack_t *main_stack,
size_t main_stack_size, k_thread_entry_t _main)
{
#if defined(CONFIG_FLOAT) && !defined(CONFIG_FP_SHARING)
/* Initialize the Floating Point Status and Control Register when in
* Unshared FP Registers mode (In Shared FP Registers mode, FPSCR is
* initialized at thread creation for threads that make use of the FP).
*/
__set_FPSCR(0);
#endif

#ifdef CONFIG_ARM_MPU
/* Configure static memory map. This will program MPU regions,
* to set up access permissions for fixed memory sections, such

0 comments on commit 2d6f6d2

Please sign in to comment.
You can’t perform that action at this time.