Skip to content
Permalink
Browse files

arch: arm: remove FP activation in system boot

This commit removes the activation of the FP context
in ARM system boot. There is no need to do this, since
the FP context will be activated in the presence of
floating point instructions. We update the reference
documentation accordingly.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
  • Loading branch information...
ioannisg authored and nashif committed Apr 4, 2019
1 parent 2aa138b commit 1a2ef42973622ef1a6e4cadab2ab1d11ccf6592d
Showing with 7 additions and 14 deletions.
  1. +4 −12 arch/arm/core/cortex_m/prep_c.c
  2. +3 −2 doc/reference/kernel/other/float.rst
@@ -162,19 +162,11 @@ static inline void enable_floating_point(void)
__set_FPSCR(0);

/*
* Although automatic state preservation is enabled, the processor
* does not automatically save the volatile FP registers until they
* have first been touched. Perform a dummy move operation so that
* the stack frames are created as expected before any thread
* context switching can occur. It has to be surrounded by instruction
* synchronization barriers to ensure that the whole sequence is
* serialized.
* Note:
* The use of the FP register bank is enabled, however the FP context
* will be activated (FPCA bit on the CONTROL register) in the presence
* of floating point instructions.
*/
__asm__ volatile(
"isb;\n\t"
"vmov s0, s0;\n\t"
"isb;\n\t"
);
}
#else
static inline void enable_floating_point(void)
@@ -41,8 +41,9 @@ Unshared FP registers mode
This mode is used when the application has only a single thread
that uses floating point registers.

The kernel initializes the floating point registers so they can be used
by any thread. The floating point registers are left unchanged
On x86 platforms, the kernel initializes the floating point registers so they can
be used by any thread (initialization in skipped on ARM Cortex-M platforms).
The floating point registers are left unchanged
whenever a context switch occurs.

.. note::

0 comments on commit 1a2ef42

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