mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-16 05:51:55 +00:00
Kernel: Save and restore FPU state on signal dispatch on i386/x86_64
This commit is contained in:
parent
e14e919b78
commit
88d7bf7362
Notes:
sideshowbarker
2024-07-17 17:57:06 +09:00
Author: https://github.com/alimpfard
Commit: 88d7bf7362
Pull-request: https://github.com/SerenityOS/serenity/pull/12762
3 changed files with 19 additions and 7 deletions
|
@ -85,7 +85,14 @@ ErrorOr<FlatPtr> Process::sys$sigreturn([[maybe_unused]] RegisterState& register
|
|||
auto stack_ptr = registers.userspace_sp();
|
||||
|
||||
// Stack state (created by the signal trampoline):
|
||||
// saved_ax, ucontext, signal_info.
|
||||
// saved_ax, ucontext, signal_info, fpu_state?.
|
||||
|
||||
#if ARCH(I386) || ARCH(X86_64)
|
||||
// The FPU state is at the top here, pop it off and restore it.
|
||||
Thread::current()->fpu_state() = TRY(copy_typed_from_user<FPUState>(stack_ptr));
|
||||
stack_ptr += sizeof(FPUState);
|
||||
#endif
|
||||
|
||||
stack_ptr += sizeof(siginfo); // We don't need this here.
|
||||
|
||||
auto ucontext = TRY(copy_typed_from_user<__ucontext>(stack_ptr));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue