FreeBSD/sys/x86/x86/mp_x86.c
/*
 * Handle an IPI_STOP by saving our current context and spinning until we
 * are resumed.
 */
Handle an IPI_STOP by saving our current context and spinning until we
are resumed.
Handle an IPI_STOP by saving our current context and spinning until we are resumed .
void
cpustop_handler(void)
{
	u_int cpu;
	cpu = PCPU_GET(cpuid);
	savectx(&stoppcbs[cpu]);
	CPU_SET_ATOMIC(cpu, &stopped_cpus);
	while (!CPU_ISSET(cpu, &started_cpus))
	    ia32_pause();
	CPU_CLR_ATOMIC(cpu, &started_cpus);
	CPU_CLR_ATOMIC(cpu, &stopped_cpus);
#if defined(__amd64__) && defined(DDB)
	amd64_db_resume_dbreg();
#endif
	if (cpu == 0 && cpustop_restartfunc != NULL) {
		cpustop_restartfunc();
		cpustop_restartfunc = NULL;
	}
}
void cpustop_handler ( void ) { u_int cpu ; cpu = PCPU_GET ( cpuid ) ; savectx ( & stoppcbs [ cpu ] ) ; CPU_SET_ATOMIC ( cpu , & stopped_cpus ) ; while ( ! CPU_ISSET ( cpu , & started_cpus ) ) ia32_pause ( ) ; CPU_CLR_ATOMIC ( cpu , & started_cpus ) ; CPU_CLR_ATOMIC ( cpu , & stopped_cpus ) ; #if defined ( __amd64__ ) && defined ( DDB ) amd64_db_resume_dbreg ( ) ; #endif if ( cpu == 0 && cpustop_restartfunc != NULL ) { cpustop_restartfunc ( ) ; cpustop_restartfunc = NULL ; } }
Handle an IPI_STOP by saving our current context and spinning until we
 are resumed.
Handle an IPI_STOP by saving our current context and spinning until we are resumed .
/* Indicate that we are stopped */ /* Wait for restart */