Skip to content

Commit

Permalink
posix: fpu: Fix compiler error when enabling fpu on posix boards
Browse files Browse the repository at this point in the history
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]>
(cherry picked from commit e7c353b)
  • Loading branch information
allemanm authored and github-actions[bot] committed Nov 26, 2024
1 parent 9f82428 commit 9840520
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions arch/posix/core/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,25 @@ void posix_arch_thread_entry(void *pa_thread_status)
z_thread_entry(ptr->entry_point, ptr->arg1, ptr->arg2, ptr->arg3);
}

#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
int arch_float_disable(struct k_thread *thread)
{
ARG_UNUSED(thread);

/* Posix always has FPU enabled so cannot be disabled */
return -ENOTSUP;
}

int arch_float_enable(struct k_thread *thread, unsigned int options)
{
ARG_UNUSED(thread);
ARG_UNUSED(options);

/* Posix always has FPU enabled so nothing to do here */
return 0;
}
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */

#if defined(CONFIG_ARCH_HAS_THREAD_ABORT)
void z_impl_k_thread_abort(k_tid_t thread)
{
Expand Down

0 comments on commit 9840520

Please sign in to comment.