diff options
author | jkim <jkim@FreeBSD.org> | 2012-02-15 23:33:22 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2012-02-15 23:33:22 +0000 |
commit | c13c2b79cf89ae77278f4504a1760066513b18f8 (patch) | |
tree | 52a4a402fa08f0d383233452bed8c1794d36cf43 /sys/amd64/amd64/mp_machdep.c | |
parent | 626117dcad75e9526ae6bc4c7b0e7d93aea9a8c1 (diff) | |
download | FreeBSD-src-c13c2b79cf89ae77278f4504a1760066513b18f8.zip FreeBSD-src-c13c2b79cf89ae77278f4504a1760066513b18f8.tar.gz |
Clean up RFLAG and CR3 register handling and nearby comments. For BSP, use
spinlock_enter()/spinlock_exit() to save/restore RFLAGS. We know interrupt
is disabled when returning from S3. For AP, we do not have to save/restore
it because IRET will do it for us any way. Do not save CR3 locally because
savectx() does it and BSP does not have to switch to kernel map for amd64.
Change contigmalloc(9) flag while I am in the neighborhood.
Diffstat (limited to 'sys/amd64/amd64/mp_machdep.c')
-rw-r--r-- | sys/amd64/amd64/mp_machdep.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index da1812d..2c52fd1 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -1414,20 +1414,17 @@ cpustop_handler(void) void cpususpend_handler(void) { - register_t cr3, rf; u_int cpu; cpu = PCPU_GET(cpuid); - rf = intr_disable(); - cr3 = rcr3(); - if (savectx(susppcbs[cpu])) { ctx_fpusave(suspfpusave[cpu]); wbinvd(); CPU_SET_ATOMIC(cpu, &stopped_cpus); } else { pmap_init_pat(); + load_cr3(susppcbs[cpu]->pcb_cr3); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); } @@ -1439,11 +1436,9 @@ cpususpend_handler(void) CPU_CLR_ATOMIC(cpu, &started_cpus); CPU_CLR_ATOMIC(cpu, &stopped_cpus); - /* Restore CR3 and enable interrupts */ - load_cr3(cr3); + /* Resume MCA and local APIC */ mca_resume(); lapic_setup(0); - intr_restore(rf); } /* |