浏览代码

Manually init FPU context in pte_clone.

4lDO2 2 年之前
父节点
当前提交
db16393fd7
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      src/platform/redox/clone.rs

+ 9 - 1
src/platform/redox/clone.rs

@@ -296,7 +296,6 @@ fork_ret:
     .globl pte_clone_ret
     .type pte_clone_ret, @function
 pte_clone_ret:
-
     # Load registers
     pop rax
     pop rdi
@@ -306,6 +305,15 @@ pte_clone_ret:
     pop r8
     pop r9
 
+    sub rsp, 8
+
+    mov DWORD PTR [rsp], 0x00001F80
+    ldmxcsr [rsp]
+    mov WORD PTR [rsp], 0x031F
+    fldcw [rsp]
+
+    add rsp, 8
+
     # Call entry point
     call rax