diff options
author | jhb <jhb@FreeBSD.org> | 2014-09-06 15:23:28 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2014-09-06 15:23:28 +0000 |
commit | 3a8cf1a38b96c596b62254406e9a4599340dea51 (patch) | |
tree | 4b6d323d2c22200ffbb3107e8dc814b6c1d9cf1d /sys/amd64/amd64/mp_machdep.c | |
parent | cd70b067cc30d9b2494dffc0658705e127c96c2c (diff) | |
download | FreeBSD-src-3a8cf1a38b96c596b62254406e9a4599340dea51.zip FreeBSD-src-3a8cf1a38b96c596b62254406e9a4599340dea51.tar.gz |
Create a separate structure for per-CPU state saved across suspend and
resume that is a superset of a pcb. Move the FPU state out of the pcb and
into this new structure. As part of this, move the FPU resume code on
amd64 into a C function. This allows resumectx() to still operate only on
a pcb and more closely mirrors the i386 code.
Reviewed by: kib (earlier version)
Diffstat (limited to 'sys/amd64/amd64/mp_machdep.c')
-rw-r--r-- | sys/amd64/amd64/mp_machdep.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 9b12449..15d3a7b 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -102,7 +102,7 @@ char *nmi_stack; void *dpcpu; struct pcb stoppcbs[MAXCPU]; -struct pcb **susppcbs; +struct susppcb **susppcbs; /* Variables needed for SMP tlb shootdown. */ vm_offset_t smp_tlb_addr2; @@ -1461,11 +1461,12 @@ cpususpend_handler(void) mtx_assert(&smp_ipi_mtx, MA_NOTOWNED); cpu = PCPU_GET(cpuid); - if (savectx(susppcbs[cpu])) { - fpususpend(susppcbs[cpu]->pcb_fpususpend); + if (savectx(&susppcbs[cpu]->sp_pcb)) { + fpususpend(susppcbs[cpu]->sp_fpususpend); wbinvd(); CPU_SET_ATOMIC(cpu, &suspended_cpus); } else { + fpuresume(susppcbs[cpu]->sp_fpususpend); pmap_init_pat(); initializecpu(); PCPU_SET(switchtime, 0); |