Page MenuHomeFreeBSD

D53804.1794188888.diff
No OneTemporary

Authored By
Unknown
Size
693 B
Referenced Files
None
Subscribers
None

D53804.1794188888.diff

diff --git a/sys/riscv/riscv/vm_machdep.c b/sys/riscv/riscv/vm_machdep.c
--- a/sys/riscv/riscv/vm_machdep.c
+++ b/sys/riscv/riscv/vm_machdep.c
@@ -48,6 +48,7 @@
#include <machine/riscvreg.h>
#include <machine/cpu.h>
+#include <machine/fpe.h>
#include <machine/cpufunc.h>
#include <machine/pcb.h>
#include <machine/frame.h>
@@ -91,7 +92,13 @@
if ((flags & RFPROC) == 0)
return;
- /* RISCVTODO: save the FPU state here */
+ /* Ensure the floating-point state is saved before copying the pcb. */
+ if ((td1->td_pcb->pcb_fpflags & PCB_FP_STARTED) != 0) {
+ MPASS(td1 == curthread);
+ critical_enter();
+ fpe_state_save(td1);
+ critical_exit();
+ }
cpu_set_pcb_frame(td2);

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 9, 1:48 AM (6 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41602900
Default Alt Text
D53804.1794188888.diff (693 B)

Event Timeline