diff options
Diffstat (limited to 'cpukit/score/cpu/riscv/riscv-context-initialize.c')
-rw-r--r-- | cpukit/score/cpu/riscv/riscv-context-initialize.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cpukit/score/cpu/riscv/riscv-context-initialize.c b/cpukit/score/cpu/riscv/riscv-context-initialize.c index 9f51d05008..c6bd99ebbd 100644 --- a/cpukit/score/cpu/riscv/riscv-context-initialize.c +++ b/cpukit/score/cpu/riscv/riscv-context-initialize.c @@ -33,7 +33,7 @@ #include "config.h" #endif -#include <rtems/score/cpu.h> +#include <rtems/score/cpuimpl.h> #include <rtems/score/address.h> #include <rtems/score/tls.h> @@ -56,6 +56,15 @@ void _CPU_Context_Initialize( context->sp = (uintptr_t) stack; context->isr_dispatch_disable = 0; +#if __riscv_flen > 0 + /* + * According to C11 section 7.6 "Floating-point environment <fenv.h>" the + * floating-point environment shall be initialized to the current state of + * the creating thread. + */ + context->fcsr = _RISCV_Read_FCSR(); +#endif + if ( tls_area != NULL ) { void *tls_block; |