eclipse-threadx / threadx

Eclipse ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications.
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/threadx/index.md
MIT License
2.8k stars 767 forks source link

FPU support RISCV-64 #389

Open Alexbruliau opened 1 month ago

Alexbruliau commented 1 month ago

Describe the bug FPU is deactivated inside tx_thread_schedule.S v6.4.1

image

Is it the correct behavior ? I would expect the FS bit from the mstatus not to be reset to 0. Otherwise it will cause a trap if you try to access a FP register afterwards.

xuzihan351 commented 1 month ago

Oops, I had modified there as follow, and it work well:

ifdef __riscv_flen

li      t0, 0x3880                                  # Prepare MPIP

else

li      t0, 0x1880                                  # Prepare MPIP

endif