Kernel: Save fpu state and flags in signal handler

This was causing some weird crashes :D
This commit is contained in:
2025-06-27 21:51:13 +03:00
parent 9e895e5286
commit f73bb242f3
3 changed files with 15 additions and 4 deletions

View File

@@ -30,8 +30,14 @@ signal_trampoline:
movq %rsp, %rbp
andq $-16, %rsp
subq $512, %rsp
fxsave64 (%rsp)
call *%rax
fxrstor64 (%rsp)
addq $512, %rsp
// restore stack
movq %rbp, %rsp
popq %r15
@@ -51,6 +57,7 @@ signal_trampoline:
popq %rax
addq $16, %rsp
popfq
// return over red-zone
ret $128