From db16393fd7f8c77151733be1abaf804d2b140425 Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Fri, 22 Jul 2022 17:25:44 +0200 Subject: [PATCH] Manually init FPU context in pte_clone. --- src/platform/redox/clone.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/platform/redox/clone.rs b/src/platform/redox/clone.rs index 62e2385d..ee2c8c8c 100644 --- a/src/platform/redox/clone.rs +++ b/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 -- GitLab