Skip to content
Permalink
Browse files

doc: reference: float: document ARM thread tag recommendation

This commit adds a short note in reference/kernel/other/float.
The note instructs to apply pre-tagging of ARM threads to
indicate that they indend to use the FP services.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
  • Loading branch information...
ioannisg authored and andrewboie committed Jun 18, 2019
1 parent 171272c commit 0bae5a48d459fe8d94b59f2b26ceb3b9594144af
Showing with 13 additions and 0 deletions.
  1. +13 −0 doc/reference/kernel/other/float.rst
@@ -77,6 +77,19 @@ This means that any thread is allowed to access the floating point registers.
The ARM kernel automatically detects that a given thread is using the floating
point registers the first time the thread accesses them.

Pretag a thread that intends to use the FP registers by
using one of the techniques listed below.

* A statically-created ARM thread can be pretagged by passing the
:c:macro:`K_FP_REGS` option to :c:macro:`K_THREAD_DEFINE`.

* A dynamically-created ARM thread can be pretagged by passing the
:c:macro:`K_FP_REGS` option to :cpp:func:`k_thread_create()`.

Pretagging a thread with the :c:macro:`K_FP_REGS` option instructs the
MPU-based stack protection mechanism to properly configure the size of
the thread's guard region to always guarantee stack overflow detection.

During thread context switching the ARM kernel saves the *callee-saved*
floating point registers, if the switched-out thread has been using them.
Additionally, the *caller-saved* floating point registers are saved on

0 comments on commit 0bae5a4

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