aboutsummaryrefslogtreecommitdiff
path: root/machine
diff options
context:
space:
mode:
Diffstat (limited to 'machine')
-rw-r--r--machine/minit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/machine/minit.c b/machine/minit.c
index 0a87633..32c6fd7 100644
--- a/machine/minit.c
+++ b/machine/minit.c
@@ -197,6 +197,10 @@ void enter_supervisor_mode(void (*fn)(uintptr_t), uintptr_t arg0, uintptr_t arg1
mstatus = INSERT_FIELD(mstatus, MSTATUS_MPIE, 0);
write_csr(mstatus, mstatus);
write_csr(mscratch, MACHINE_STACK_TOP() - MENTRY_FRAME_SIZE);
+#ifndef __riscv_flen
+ uintptr_t *p_fcsr = MACHINE_STACK_TOP() - MENTRY_FRAME_SIZE; // the x0's save slot
+ *p_fcsr = 0;
+#endif
write_csr(mepc, fn);
register uintptr_t a0 asm ("a0") = arg0;