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

@@ -7,9 +7,6 @@
.global signal_trampoline
signal_trampoline:
pushl %ebp
movl %esp, %ebp
pusha
movl 40(%esp), %edi
@@ -19,16 +16,22 @@ signal_trampoline:
movl %esp, %ebp
andl $-16, %esp
subl $512, %esp
fxsave (%esp)
subl $12, %esp
pushl %edi
call *%eax
addl $16, %esp
fxrstor (%esp)
addl $512, %esp
// restore stack
movl %ebp, %esp
popa
leave
addl $8, %esp
popf
ret