/* The transition from "FP supporting" to "non-FP supporting" must be done atomically to avoid confusing the floating point logic used by z_swap(), so this routine locks interrupts to ensure that a context switch does not occur. The locking isn't really needed when the routine is called by a cooperative thread (since context switching can't occur), but it is harmless.  */
int z_float_disable(struct k_thread *thread)
/* The transition from "FP supporting" to "non-FP supporting" must be done atomically to avoid confusing the floating point logic used by z_swap(), so this routine locks interrupts to ensure that a context switch does not occur. The locking isn't really needed when the routine is called by a cooperative thread (since context switching can't occur), but it is harmless.  */
int z_float_disable(struct k_thread *thread)
{
	unsigned int imask;
	imask = irq_lock();
	thread->base.user_options &= ~_FP_USER_MASK;
	if (thread == _current) {
		z_FpAccessDisable();
		_kernel.current_fp = (struct k_thread *)0;
	} else {
		if (_kernel.current_fp == thread) {
			_kernel.current_fp = (struct k_thread *)0;
		}
	}
	irq_unlock(imask);
	return 0;
}