Skip to content
Permalink
Browse files

arch: arc: implement z_arch_float_enable

for arc, floating point support cannot be enabled
automatically, so k_float_enable is requred.

z_arch_float_enable is for k_float_enable

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
  • Loading branch information...
vonhust authored and andrewboie committed Jun 20, 2019
1 parent 8b04c7d commit a7845b10f050d1e8c16764e81ef41159b04c23ec
Showing with 17 additions and 0 deletions.
  1. +17 −0 arch/arc/core/thread.c
@@ -286,4 +286,21 @@ int z_arch_float_disable(struct k_thread *thread)

return 0;
}


int z_arch_float_enable(struct k_thread *thread)
{
unsigned int key;

/* Ensure a preemptive context switch does not occur */

key = irq_lock();

/* Enable all floating point capabilities for the thread */
thread->base.user_options |= K_FP_REGS;

irq_unlock(key);

return 0;
}
#endif /* CONFIG_FLOAT && CONFIG_FP_SHARING */

0 comments on commit a7845b1

Please sign in to comment.
You can’t perform that action at this time.