mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:17:35 +00:00
Kernel: Save/restore the SSE context on context switch.
This commit is contained in:
parent
44e1e7423f
commit
e9f2cc3595
4 changed files with 10 additions and 15 deletions
|
@ -190,14 +190,14 @@ void exception_7_handler(RegisterDump& regs)
|
|||
if (g_last_fpu_thread == current)
|
||||
return;
|
||||
if (g_last_fpu_thread) {
|
||||
asm volatile("fnsave %0":"=m"(g_last_fpu_thread->fpu_state()));
|
||||
asm volatile("fxsave %0":"=m"(g_last_fpu_thread->fpu_state()));
|
||||
} else {
|
||||
asm volatile("fnclex");
|
||||
}
|
||||
g_last_fpu_thread = current;
|
||||
|
||||
if (current->has_used_fpu()) {
|
||||
asm volatile("frstor %0"::"m"(current->fpu_state()));
|
||||
asm volatile("fxrstor %0"::"m"(current->fpu_state()));
|
||||
} else {
|
||||
asm volatile("fninit");
|
||||
current->set_has_used_fpu(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue