From 48a6a38cdceac157ad249834defe382c21e39f7d Mon Sep 17 00:00:00 2001 From: jkim Date: Mon, 26 Jul 2010 19:53:09 +0000 Subject: 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 --- sys/amd64/amd64/mp_machdep.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sys/amd64/amd64/mp_machdep.c') diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 02e7505..0bda9fe 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -1329,20 +1329,17 @@ cpustop_handler(void) void cpususpend_handler(void) { - struct savefpu *stopfpu; register_t cr3, rf; int cpu = PCPU_GET(cpuid); int cpumask = PCPU_GET(cpumask); rf = intr_disable(); cr3 = rcr3(); - stopfpu = &stopxpcbs[cpu]->xpcb_pcb.pcb_user_save; + if (savectx2(stopxpcbs[cpu])) { - fpugetregs(curthread, stopfpu); wbinvd(); atomic_set_int(&stopped_cpus, cpumask); - } else - fpusetregs(curthread, stopfpu); + } /* Wait for resume */ while (!(started_cpus & cpumask)) -- cgit v1.1