Kernel: Save and restore FPU state on signal dispatch on i386/x86_64

This commit is contained in:
Ali Mohammad Pur 2022-02-26 18:30:51 +03:30 committed by Andreas Kling
parent e14e919b78
commit 88d7bf7362
Notes: sideshowbarker 2024-07-17 17:57:06 +09:00
3 changed files with 19 additions and 7 deletions

View file

@ -1190,6 +1190,11 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal)
VERIFY(stack % 16 == 0);
#if ARCH(I386) || ARCH(X86_64)
// Save the FPU/SSE state
TRY(copy_value_on_user_stack(stack, fpu_state()));
#endif
#if ARCH(I386)
// Leave one empty slot to align the stack for a handler call.
TRY(push_value_on_user_stack(stack, 0));