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.93k stars 795 forks source link

RISCV fpu context save and restore according to the MSTATUS.FS #315

Open xuzihan351 opened 11 months ago

xuzihan351 commented 11 months ago

RISCV has a FS filed in MSTATUS, it indicates the status of the fpu. It can be initial, clean, dirty of off. When dealing with the fpu context save and restore, the FS filed may help to increase the preformence of the context switching. When the MSTATUS.FS is clean or off, the context saving and restoring can be skip. Is it possible to implement this feature in the future?

williamelamie commented 9 months ago

This is definitely possible... tx_thread_schedule.s, tx_thread_system_return.s, tx_thread_context_save.s, and tx_thread_context_restore.s are the likely places for the enhanced logic.

Alexbruliau commented 5 months ago

Did you find out any issues related to FPU when porting to RISC-V ?

xuzihan351 commented 5 months ago

No issues found at the moment

Alexbruliau commented 5 months ago

Not even this kind of https://github.com/eclipse-threadx/threadx/issues/389 ?

xuzihan351 commented 5 months ago

That is a bug, and I had fix it locally.

Alexbruliau commented 5 months ago

thanks you targeted a mpfs250 board?

xuzihan351 commented 5 months ago

Not that. I am targeting HPMicro series boards