Lines Matching full:image
113 static void free_transition_pgtable(struct kimage *image) in free_transition_pgtable() argument
115 free_page((unsigned long)image->arch.p4d); in free_transition_pgtable()
116 image->arch.p4d = NULL; in free_transition_pgtable()
117 free_page((unsigned long)image->arch.pud); in free_transition_pgtable()
118 image->arch.pud = NULL; in free_transition_pgtable()
119 free_page((unsigned long)image->arch.pmd); in free_transition_pgtable()
120 image->arch.pmd = NULL; in free_transition_pgtable()
121 free_page((unsigned long)image->arch.pte); in free_transition_pgtable()
122 image->arch.pte = NULL; in free_transition_pgtable()
125 static int init_transition_pgtable(struct kimage *image, pgd_t *pgd) in init_transition_pgtable() argument
136 paddr = __pa(page_address(image->control_code_page)+PAGE_SIZE); in init_transition_pgtable()
142 image->arch.p4d = p4d; in init_transition_pgtable()
150 image->arch.pud = pud; in init_transition_pgtable()
158 image->arch.pmd = pmd; in init_transition_pgtable()
166 image->arch.pte = pte; in init_transition_pgtable()
182 struct kimage *image = (struct kimage *)data; in alloc_pgt_page() local
186 page = kimage_alloc_control_pages(image, 0); in alloc_pgt_page()
195 static int init_pgtable(struct kimage *image, unsigned long start_pgtable) in init_pgtable() argument
199 .context = image, in init_pgtable()
235 for (i = 0; i < image->nr_segments; i++) { in init_pgtable()
236 mstart = image->segment[i].mem; in init_pgtable()
237 mend = mstart + image->segment[i].memsz; in init_pgtable()
258 return init_transition_pgtable(image, level4p); in init_pgtable()
273 int machine_kexec_prepare(struct kimage *image) in machine_kexec_prepare() argument
279 start_pgtable = page_to_pfn(image->control_code_page) << PAGE_SHIFT; in machine_kexec_prepare()
282 result = init_pgtable(image, start_pgtable); in machine_kexec_prepare()
289 void machine_kexec_cleanup(struct kimage *image) in machine_kexec_cleanup() argument
291 free_transition_pgtable(image); in machine_kexec_cleanup()
298 void machine_kexec(struct kimage *image) in machine_kexec() argument
305 if (image->preserve_context) in machine_kexec()
316 if (image->preserve_context) { in machine_kexec()
329 control_page = page_address(image->control_code_page) + PAGE_SIZE; in machine_kexec()
335 (unsigned long)__pa(page_address(image->control_code_page)); in machine_kexec()
337 if (image->type == KEXEC_TYPE_DEFAULT) in machine_kexec()
338 page_list[PA_SWAP_PAGE] = (page_to_pfn(image->swap_page) in machine_kexec()
360 image->start = relocate_kernel((unsigned long)image->head, in machine_kexec()
362 image->start, in machine_kexec()
363 image->preserve_context, in machine_kexec()
367 if (image->preserve_context) in machine_kexec()
377 void *arch_kexec_kernel_image_load(struct kimage *image) in arch_kexec_kernel_image_load() argument
379 if (!image->fops || !image->fops->load) in arch_kexec_kernel_image_load()
382 return image->fops->load(image, image->kernel_buf, in arch_kexec_kernel_image_load()
383 image->kernel_buf_len, image->initrd_buf, in arch_kexec_kernel_image_load()
384 image->initrd_buf_len, image->cmdline_buf, in arch_kexec_kernel_image_load()
385 image->cmdline_buf_len); in arch_kexec_kernel_image_load()
515 int arch_kimage_file_post_load_cleanup(struct kimage *image) in arch_kimage_file_post_load_cleanup() argument
517 vfree(image->elf_headers); in arch_kimage_file_post_load_cleanup()
518 image->elf_headers = NULL; in arch_kimage_file_post_load_cleanup()
519 image->elf_headers_sz = 0; in arch_kimage_file_post_load_cleanup()
521 return kexec_image_post_load_cleanup_default(image); in arch_kimage_file_post_load_cleanup()