void native_machine_crash_shutdown(struct pt_regs *regs)
{ /* Nothing to do for UP, but definitely broken for SMP.. */
}
/* * Do what every setup is needed on image and the * reboot code buffer to allow us to avoid allocations * later.
*/ int machine_kexec_prepare(struct kimage *image)
{ return 0;
}
staticvoid kexec_info(struct kimage *image)
{ int i;
printk("kexec information\n"); for (i = 0; i < image->nr_segments; i++) {
printk(" segment[%d]: 0x%08x - 0x%08x (0x%08x)\n",
i,
(unsignedint)image->segment[i].mem,
(unsignedint)image->segment[i].mem +
image->segment[i].memsz,
(unsignedint)image->segment[i].memsz);
}
printk(" start : 0x%08x\n\n", (unsignedint)image->start);
}
/* * Do not allocate memory (or fail in any way) in machine_kexec(). * We are past the point of no return, committed to rebooting now.
*/ void machine_kexec(struct kimage *image)
{ unsignedlong page_list; unsignedlong reboot_code_buffer;
relocate_new_kernel_t rnk; unsignedlong entry; unsignedlong *ptr; int save_ftrace_enabled;
/* * Nicked from the mips version of machine_kexec(): * The generic kexec code builds a page list with physical * addresses. Use phys_to_virt() to convert them to virtual.
*/ for (ptr = &image->head; (entry = *ptr) && !(entry & IND_DONE);
ptr = (entry & IND_INDIRECTION) ?
phys_to_virt(entry & PAGE_MASK) : ptr + 1) { if (*ptr & IND_SOURCE || *ptr & IND_INDIRECTION ||
*ptr & IND_DESTINATION)
*ptr = (unsignedlong) phys_to_virt(*ptr);
}
#ifdef CONFIG_KEXEC_JUMP if (image->preserve_context)
save_processor_state(); #endif
save_ftrace_enabled = __ftrace_enabled_save();
/* Interrupts aren't acceptable while we reboot */
local_irq_disable();
page_list = image->head;
/* we need both effective and real address here */
reboot_code_buffer =
(unsignedlong)page_address(image->control_code_page);
/* copy our kernel relocation code to the control code page */
memcpy((void *)reboot_code_buffer, relocate_new_kernel,
relocate_new_kernel_size);
kexec_info(image);
flush_cache_all();
sh_bios_vbr_reload();
/* now call it */
rnk = (relocate_new_kernel_t) reboot_code_buffer;
(*rnk)(page_list, reboot_code_buffer,
(unsignedlong)phys_to_virt(image->start));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.