blob: fa81edf8829d78a05c0c1d895e06080db9cc102c [file] [log] [blame]
Anas Nashif3dc0c452024-02-27 08:48:37 -05001/*
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
11int 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
21int 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
33static 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}
Yong Cong Sinbbe5e1e2024-01-24 17:35:04 +080038#include <zephyr/syscalls/k_float_disable_mrsh.c>
Anas Nashif3dc0c452024-02-27 08:48:37 -050039
40static 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}
Yong Cong Sinbbe5e1e2024-01-24 17:35:04 +080045#include <zephyr/syscalls/k_float_enable_mrsh.c>
Anas Nashif3dc0c452024-02-27 08:48:37 -050046
47#endif /* CONFIG_USERSPACE */