函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\kexec.c Create Date:2022-07-27 12:04:54
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:kimage_alloc_init

函数原型:static int kimage_alloc_init(struct kimage **rimage, unsigned long entry, unsigned long nr_segments, struct kexec_segment __user *segments, unsigned long flags)

返回类型:int

参数:

类型参数名称
struct kimage **rimage
unsigned longentry
unsigned longnr_segments
struct kexec_segment __user *segments
unsigned longflags
46  kexec_on_panic等于flags按位与kexec flags for different usage scenarios
48  如果kexec_on_panic
50  如果entry小于phys_to_boot_phys(start)或entry大于phys_to_boot_phys(end)则返回:负EADDRNOTAVAIL
56  image等于do_kimage_alloc_init()
57  如果非image则返回:负ENOMEM
60  start等于entry
62  ret等于copy_user_segment_list(image, nr_segments, segments)
63  如果ret则转到:out_free_image
66  如果kexec_on_panic
68  Address of next control page to allocate for crash kernels. 等于start
69  Flags to indicate special processing 等于KEXEC_TYPE_CRASH
72  ret等于sanity_check_segment_list(image)
73  如果ret则转到:out_free_image
81  ret等于负ENOMEM
82  control_code_page等于kimage_alloc_control_pages(image, get_order - Determine the allocation order of a memory size*@size: The size for which to get the order* Determine the allocation order of a particular sized block of memory)
84  如果非control_code_page
85  打印错误信息("Could not allocate control_code_buffer\n")
86  转到:out_free_image
89  如果非kexec_on_panic
90  swap_page等于kimage_alloc_control_pages(image, 0)
91  如果非swap_page
92  打印错误信息("Could not allocate swap buffer\n")
97  rimage等于image
98  返回:0
99  out_free_control_pages :
100  kimage_free_page_list( & control_pages)
101  out_free_image :
102  kfree(image)
103  返回:ret
调用者
名称描述
do_kexec_load