From 0ea9debfceacb9e1989cdfc2572695a67a2a8116 Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Thu, 27 Jul 2023 11:05:19 +0300 Subject: [PATCH] riscv/riscv_fpu: Clear the full FPU status/control register on boot Instead of clearing the fields individually, just wipe the whole register. This can be done because flags and rm are just parts of the fcsr. 31 8 5 0 +--------------+--------+-----------+ | | | | | RESERVED | FRM | FSTATUS | | | | | +--------------+--------+-----------+ FCSR --- arch/risc-v/src/common/riscv_fpu.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/risc-v/src/common/riscv_fpu.S b/arch/risc-v/src/common/riscv_fpu.S index 9d5feb9390..cc88e769dd 100644 --- a/arch/risc-v/src/common/riscv_fpu.S +++ b/arch/risc-v/src/common/riscv_fpu.S @@ -69,8 +69,7 @@ riscv_fpuconfig: li a0, MSTATUS_FS_INIT csrs CSR_STATUS, a0 - fsflags zero - fsrm zero + fscsr zero fence.i ret