Lines Matching refs:image
137 static void free_transition_pgtable(struct kimage *image) in free_transition_pgtable() argument
139 free_page((unsigned long)image->arch.p4d); in free_transition_pgtable()
140 image->arch.p4d = NULL; in free_transition_pgtable()
141 free_page((unsigned long)image->arch.pud); in free_transition_pgtable()
142 image->arch.pud = NULL; in free_transition_pgtable()
143 free_page((unsigned long)image->arch.pmd); in free_transition_pgtable()
144 image->arch.pmd = NULL; in free_transition_pgtable()
145 free_page((unsigned long)image->arch.pte); in free_transition_pgtable()
146 image->arch.pte = NULL; in free_transition_pgtable()
149 static int init_transition_pgtable(struct kimage *image, pgd_t *pgd) in init_transition_pgtable() argument
160 paddr = __pa(page_address(image->control_code_page)+PAGE_SIZE); in init_transition_pgtable()
166 image->arch.p4d = p4d; in init_transition_pgtable()
174 image->arch.pud = pud; in init_transition_pgtable()
182 image->arch.pmd = pmd; in init_transition_pgtable()
190 image->arch.pte = pte; in init_transition_pgtable()
206 struct kimage *image = (struct kimage *)data; in alloc_pgt_page() local
210 page = kimage_alloc_control_pages(image, 0); in alloc_pgt_page()
219 static int init_pgtable(struct kimage *image, unsigned long start_pgtable) in init_pgtable() argument
223 .context = image, in init_pgtable()
259 for (i = 0; i < image->nr_segments; i++) { in init_pgtable()
260 mstart = image->segment[i].mem; in init_pgtable()
261 mend = mstart + image->segment[i].memsz; in init_pgtable()
282 return init_transition_pgtable(image, level4p); in init_pgtable()
297 int machine_kexec_prepare(struct kimage *image) in machine_kexec_prepare() argument
303 start_pgtable = page_to_pfn(image->control_code_page) << PAGE_SHIFT; in machine_kexec_prepare()
306 result = init_pgtable(image, start_pgtable); in machine_kexec_prepare()
313 void machine_kexec_cleanup(struct kimage *image) in machine_kexec_cleanup() argument
315 free_transition_pgtable(image); in machine_kexec_cleanup()
322 void machine_kexec(struct kimage *image) in machine_kexec() argument
336 if (image->preserve_context) in machine_kexec()
347 if (image->preserve_context) { in machine_kexec()
360 control_page = page_address(image->control_code_page) + PAGE_SIZE; in machine_kexec()
366 (unsigned long)__pa(page_address(image->control_code_page)); in machine_kexec()
368 if (image->type == KEXEC_TYPE_DEFAULT) in machine_kexec()
369 page_list[PA_SWAP_PAGE] = (page_to_pfn(image->swap_page) in machine_kexec()
391 image->start = relocate_kernel((unsigned long)image->head, in machine_kexec()
393 image->start, in machine_kexec()
394 image->preserve_context, in machine_kexec()
398 if (image->preserve_context) in machine_kexec()
535 int arch_kimage_file_post_load_cleanup(struct kimage *image) in arch_kimage_file_post_load_cleanup() argument
537 vfree(image->elf_headers); in arch_kimage_file_post_load_cleanup()
538 image->elf_headers = NULL; in arch_kimage_file_post_load_cleanup()
539 image->elf_headers_sz = 0; in arch_kimage_file_post_load_cleanup()
541 return kexec_image_post_load_cleanup_default(image); in arch_kimage_file_post_load_cleanup()