diff options
author | iwasaki <iwasaki@FreeBSD.org> | 2012-06-09 00:37:26 +0000 |
---|---|---|
committer | iwasaki <iwasaki@FreeBSD.org> | 2012-06-09 00:37:26 +0000 |
commit | 861bb3822c41d848219eb72645189b964249c326 (patch) | |
tree | d545096ae7b18322fd63d055e098b158b8862a01 /sys/amd64/amd64/mp_machdep.c | |
parent | ccb8c35eab6b0cfd93a0939fbf01b0d77682dd41 (diff) | |
download | FreeBSD-src-861bb3822c41d848219eb72645189b964249c326.zip FreeBSD-src-861bb3822c41d848219eb72645189b964249c326.tar.gz |
Add x86/acpica/acpi_wakeup.c for amd64 and i386. Difference of
suspend/resume procedures are minimized among them.
common:
- Add global cpuset suspended_cpus to indicate APs are suspended/resumed.
- Remove acpi_waketag and acpi_wakemap from acpivar.h (no longer used).
- Add some variables in acpi_wakecode.S in order to minimize the difference
among amd64 and i386.
- Disable load_cr3() because now CR3 is restored in resumectx().
amd64:
- Add suspend/resume related members (such as MSR) in PCB.
- Modify savectx() for above new PCB members.
- Merge acpi_switch.S into cpu_switch.S as resumectx().
i386:
- Merge(and remove) suspendctx() into savectx() in order to match with
amd64 code.
Reviewed by: attilio@, acpi@
Diffstat (limited to 'sys/amd64/amd64/mp_machdep.c')
-rw-r--r-- | sys/amd64/amd64/mp_machdep.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 3d07f24..903163e 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -100,7 +100,6 @@ void *dpcpu; struct pcb stoppcbs[MAXCPU]; struct pcb **susppcbs; -void **suspfpusave; /* Variables needed for SMP tlb shootdown. */ vm_offset_t smp_tlb_addr1; @@ -1415,15 +1414,19 @@ cpususpend_handler(void) cpu = PCPU_GET(cpuid); if (savectx(susppcbs[cpu])) { - ctx_fpusave(suspfpusave[cpu]); + ctx_fpusave(susppcbs[cpu]->pcb_fpususpend); wbinvd(); CPU_SET_ATOMIC(cpu, &stopped_cpus); + CPU_SET_ATOMIC(cpu, &suspended_cpus); } else { pmap_init_pat(); +#if 0 load_cr3(susppcbs[cpu]->pcb_cr3); +#endif initializecpu(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); + CPU_CLR_ATOMIC(cpu, &suspended_cpus); } /* Wait for resume */ |