1 /*
2  * Copyright (c) 2010-2014 Wind River Systems, Inc.
3  * Copyright (c) 2024 Intel Corporation
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 #include <zephyr/kernel.h>
8 #include <zephyr/internal/syscall_handler.h>
9 #include <kernel_arch_interface.h>
10 
z_impl_k_float_disable(struct k_thread * thread)11 int z_impl_k_float_disable(struct k_thread *thread)
12 {
13 #if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
14 	return arch_float_disable(thread);
15 #else
16 	ARG_UNUSED(thread);
17 	return -ENOTSUP;
18 #endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
19 }
20 
z_impl_k_float_enable(struct k_thread * thread,unsigned int options)21 int z_impl_k_float_enable(struct k_thread *thread, unsigned int options)
22 {
23 #if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
24 	return arch_float_enable(thread, options);
25 #else
26 	ARG_UNUSED(thread);
27 	ARG_UNUSED(options);
28 	return -ENOTSUP;
29 #endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
30 }
31 
32 #ifdef CONFIG_USERSPACE
z_vrfy_k_float_disable(struct k_thread * thread)33 static inline int z_vrfy_k_float_disable(struct k_thread *thread)
34 {
35 	K_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
36 	return z_impl_k_float_disable(thread);
37 }
38 #include <zephyr/syscalls/k_float_disable_mrsh.c>
39 
z_vrfy_k_float_enable(struct k_thread * thread,unsigned int options)40 static inline int z_vrfy_k_float_enable(struct k_thread *thread, unsigned int options)
41 {
42 	K_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
43 	return z_impl_k_float_enable(thread, options);
44 }
45 #include <zephyr/syscalls/k_float_enable_mrsh.c>
46 
47 #endif /* CONFIG_USERSPACE */
48