Esempio n. 1
0
static void
kexec_halt_all_cpus(void *kernel_image)
{
	static atomic_t cpuid = ATOMIC_INIT(-1);
	int cpu;
	struct kimage *image;
	relocate_kernel_t data_mover;

#ifdef CONFIG_PFAULT
	if (MACHINE_IS_VM)
		pfault_fini();
#endif

	if (atomic_cmpxchg(&cpuid, -1, smp_processor_id()) != -1)
		signal_processor(smp_processor_id(), sigp_stop);

	/* Wait for all other cpus to enter stopped state */
	for_each_online_cpu(cpu) {
		if (cpu == smp_processor_id())
			continue;
		while (!smp_cpu_not_running(cpu))
			cpu_relax();
	}

	image = (struct kimage *) kernel_image;
	data_mover = (relocate_kernel_t)
		(page_to_pfn(image->control_code_page) << PAGE_SHIFT);

	/* Call the moving routine */
	(*data_mover) (&image->head, image->start);
}
Esempio n. 2
0
static void do_machine_power_off_nonsmp(void)
{
        if (MACHINE_IS_VM && strlen(vmpoff_cmd) > 0)
		__cpcmd(vmpoff_cmd, NULL, 0, NULL);
        signal_processor(smp_processor_id(), sigp_stop_and_store_status);
}