diff options
author | jkim <jkim@FreeBSD.org> | 2010-07-26 19:53:09 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2010-07-26 19:53:09 +0000 |
commit | 48a6a38cdceac157ad249834defe382c21e39f7d (patch) | |
tree | 9183d2c80109a896ebadce43f6a4516a52e9f275 /sys/amd64/amd64/cpu_switch.S | |
parent | 488a727a00e4e0a41095d9f56222741550a97d92 (diff) | |
download | FreeBSD-src-48a6a38cdceac157ad249834defe382c21e39f7d.zip FreeBSD-src-48a6a38cdceac157ad249834defe382c21e39f7d.tar.gz |
Re-implement FPU suspend/resume for amd64. This removes superfluous uses
of critical_enter(9) and critical_exit(9) by fpugetregs() and fpusetregs().
Also, we do not touch PCB flags any more.
MFC after: 1 month
Diffstat (limited to 'sys/amd64/amd64/cpu_switch.S')
-rw-r--r-- | sys/amd64/amd64/cpu_switch.S | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S index 6b5c663..bba435d 100644 --- a/sys/amd64/amd64/cpu_switch.S +++ b/sys/amd64/amd64/cpu_switch.S @@ -417,6 +417,13 @@ ENTRY(savectx2) leaq (%rax,%rdx),%rax movq %rax,XPCB_KGSBASE(%r8) + movq PCPU(FPCURTHREAD),%rax + testq %rax,%rax + je 1f + clts + fxsave PCB_USER_FPU(%r8) +1: + movl $1, %eax ret END(savectx2) |