Skip to content

Commit e7c353b

Browse files
allemanmhenrikbrixandersen
authored andcommitted
posix: fpu: Fix compiler error when enabling fpu on posix boards
Enabling CONFIG_FPU and CONFIG_FPU_SHARING requires the definition of `arch_float_disable` and `arch_float_enable`. Signed-off-by: Matthias Alleman <[email protected]>
1 parent 305ceba commit e7c353b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

arch/posix/core/thread.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,25 @@ void posix_arch_thread_entry(void *pa_thread_status)
9696
z_thread_entry(ptr->entry_point, ptr->arg1, ptr->arg2, ptr->arg3);
9797
}
9898

99+
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
100+
int arch_float_disable(struct k_thread *thread)
101+
{
102+
ARG_UNUSED(thread);
103+
104+
/* Posix always has FPU enabled so cannot be disabled */
105+
return -ENOTSUP;
106+
}
107+
108+
int arch_float_enable(struct k_thread *thread, unsigned int options)
109+
{
110+
ARG_UNUSED(thread);
111+
ARG_UNUSED(options);
112+
113+
/* Posix always has FPU enabled so nothing to do here */
114+
return 0;
115+
}
116+
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
117+
99118
#if defined(CONFIG_ARCH_HAS_THREAD_ABORT)
100119
void z_impl_k_thread_abort(k_tid_t thread)
101120
{

0 commit comments

Comments
 (0)