Changeset View
Changeset View
Standalone View
Standalone View
head/sys/i386/i386/mp_machdep.c
Show First 20 Lines • Show All 743 Lines • ▼ Show 20 Lines | #endif | ||||
/* set up CPU registers and state */ | /* set up CPU registers and state */ | ||||
cpu_setregs(); | cpu_setregs(); | ||||
/* set up SSE/NX */ | /* set up SSE/NX */ | ||||
initializecpu(); | initializecpu(); | ||||
/* set up FPU state on the AP */ | /* set up FPU state on the AP */ | ||||
npxinit(); | npxinit(false); | ||||
if (cpu_ops.cpu_init) | if (cpu_ops.cpu_init) | ||||
cpu_ops.cpu_init(); | cpu_ops.cpu_init(); | ||||
/* A quick check from sanity claus */ | /* A quick check from sanity claus */ | ||||
cpuid = PCPU_GET(cpuid); | cpuid = PCPU_GET(cpuid); | ||||
if (PCPU_GET(apic_id) != lapic_id()) { | if (PCPU_GET(apic_id) != lapic_id()) { | ||||
printf("SMP: cpuid = %d\n", cpuid); | printf("SMP: cpuid = %d\n", cpuid); | ||||
▲ Show 20 Lines • Show All 746 Lines • ▼ Show 20 Lines | |||||
cpususpend_handler(void) | cpususpend_handler(void) | ||||
{ | { | ||||
u_int cpu; | u_int cpu; | ||||
mtx_assert(&smp_ipi_mtx, MA_NOTOWNED); | mtx_assert(&smp_ipi_mtx, MA_NOTOWNED); | ||||
cpu = PCPU_GET(cpuid); | cpu = PCPU_GET(cpuid); | ||||
if (savectx(&susppcbs[cpu]->sp_pcb)) { | if (savectx(&susppcbs[cpu]->sp_pcb)) { | ||||
npxsuspend(&susppcbs[cpu]->sp_fpususpend); | npxsuspend(susppcbs[cpu]->sp_fpususpend); | ||||
wbinvd(); | wbinvd(); | ||||
CPU_SET_ATOMIC(cpu, &suspended_cpus); | CPU_SET_ATOMIC(cpu, &suspended_cpus); | ||||
} else { | } else { | ||||
npxresume(&susppcbs[cpu]->sp_fpususpend); | npxresume(susppcbs[cpu]->sp_fpususpend); | ||||
pmap_init_pat(); | pmap_init_pat(); | ||||
initializecpu(); | initializecpu(); | ||||
PCPU_SET(switchtime, 0); | PCPU_SET(switchtime, 0); | ||||
PCPU_SET(switchticks, ticks); | PCPU_SET(switchticks, ticks); | ||||
/* Indicate that we are resumed */ | /* Indicate that we are resumed */ | ||||
CPU_CLR_ATOMIC(cpu, &suspended_cpus); | CPU_CLR_ATOMIC(cpu, &suspended_cpus); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 131 Lines • Show Last 20 Lines |