static void smp_halt(void) { int cpuid = safe_smp_processor_id(); static int first_entry = 1; if (reboot_force) return; if (first_entry) { first_entry = 0; smp_call_function((void *)machine_restart, NULL, 1, 0); } smp_stop_cpu(); /* AP calling this. Just halt */ if (cpuid != boot_cpu_id) { for (;;) asm("hlt"); } /* Wait for all other CPUs to have run smp_stop_cpu */ while (!cpus_empty(cpu_online_map)) rep_nop(); }
void smp_send_stop(void) { int nolock = 0; /* Don't deadlock on the call lock in panic */ if (!spin_trylock(&call_lock)) { /* ignore locking because we have paniced anyways */ nolock = 1; } __smp_call_function(smp_really_stop_cpu, NULL, 0, 0); if (!nolock) spin_unlock(&call_lock); smp_stop_cpu(); }
void smp_send_stop(void) { smp_call_function(smp_really_stop_cpu, NULL, 1, 0); smp_stop_cpu(); }
static void smp_really_stop_cpu(void *dummy) { smp_stop_cpu(); for (;;) asm("hlt"); }
static void smp_really_stop_cpu(void *dummy) { smp_stop_cpu(); for (;;) halt(); }