1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 16:24:59 +00:00

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
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));