Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void machine_kexec(struct kimage *image)
- {
- unsigned long page_list;
- unsigned long reboot_code_buffer_phys;
- void *reboot_code_buffer;
- page_list = image->head & PAGE_MASK;
- /* we need both effective and real address here */
- reboot_code_buffer_phys =
- page_to_pfn(image->control_code_page) << PAGE_SHIFT;
- reboot_code_buffer = page_address(image->control_code_page);
- /* Prepare parameters for reboot_code_buffer*/
- kexec_start_address = image->start;
- kexec_indirection_page = page_list;
- kexec_mach_type = machine_arch_type;
- kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET;
- #ifdef CONFIG_KEXEC_HARDBOOT
- kexec_hardboot = image->hardboot;
- #endif
- /* copy our kernel relocation code to the control code page */
- memcpy(reboot_code_buffer,
- relocate_new_kernel, relocate_new_kernel_size);
- flush_icache_range((unsigned long) reboot_code_buffer,
- (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
- printk(KERN_INFO "Bye!\n");
- printk("exec 1\n");
- if (kexec_reinit)
- kexec_reinit();
- printk("exec 2\n");
- local_irq_disable();
- printk("exec 3\n");
- local_fiq_disable();
- printk("exec 4\n");
- setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/
- printk("exec 5\n");
- flush_cache_all();
- printk("exec 6\n");
- outer_flush_all();
- printk("exec 7\n");
- outer_disable();
- printk("exec 8\n");
- cpu_proc_fin();
- printk("exec 9\n");
- //outer_inv_all();
- //flush_cache_all();
- /* Must call cpu_reset via physical address since ARMv7 (& v6) stalls the
- * pipeline after disabling the MMU. */
- ((typeof(cpu_reset) *)virt_to_phys(cpu_reset))(reboot_code_buffer_phys);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement