Zephyr API Documentation 4.0.0-rc3
A Scalable Open Source RTOS
|
Functions | |
int | k_float_disable (struct k_thread *thread) |
Disable preservation of floating point context information. | |
int | k_float_enable (struct k_thread *thread, unsigned int options) |
Enable preservation of floating point context information. | |
int k_float_disable | ( | struct k_thread * | thread | ) |
#include <zephyr/kernel.h>
Disable preservation of floating point context information.
This routine informs the kernel that the specified thread will no longer be using the floating point registers.
thread | ID of thread. |
0 | On success. |
-ENOTSUP | If the floating point disabling is not implemented. -EINVAL If the floating point disabling could not be performed. |
#include <zephyr/kernel.h>
Enable preservation of floating point context information.
This routine informs the kernel that the specified thread will use the floating point registers.
Invoking this routine initializes the thread's floating point context info to that of an FPU that has been reset. The next time the thread is scheduled by z_swap() it will either inherit an FPU that is guaranteed to be in a "sane" state (if the most recent user of the FPU was cooperatively swapped out) or the thread's own floating point context will be loaded (if the most recent user of the FPU was preempted, or if this thread is the first user of the FPU). Thereafter, the kernel will protect the thread's FP context so that it is not altered during a preemptive context switch.
The options parameter indicates which floating point register sets will be used by the specified thread.
For x86 options:
thread | ID of thread. |
options | architecture dependent options |
0 | On success. |
-ENOTSUP | If the floating point enabling is not implemented. -EINVAL If the floating point enabling could not be performed. |