Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\kexec.c Create Date:2022-07-28 11:03:29
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:kimage_alloc_init

Proto:static int kimage_alloc_init(struct kimage **rimage, unsigned long entry, unsigned long nr_segments, struct kexec_segment __user *segments, unsigned long flags)

Type:int

Parameter:

TypeParameterName
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  If kexec_on_panic Then
50  If entry < phys_to_boot_phys(start) || entry > phys_to_boot_phys(end) Then Return -EADDRNOTAVAIL
56  image = do_kimage_alloc_init()
57  If Not image Then Return -ENOMEM
60  start = entry
62  ret = copy_user_segment_list(image, nr_segments, segments)
63  If ret Then Go to out_free_image
66  If kexec_on_panic Then
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  If ret Then Go to 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  If Not control_code_page Then
85  pr_err("Could not allocate control_code_buffer\n")
86  Go to out_free_image
89  If Not kexec_on_panic Then
90  swap_page = kimage_alloc_control_pages(image, 0)
91  If Not swap_page Then
92  pr_err("Could not allocate swap buffer\n")
97  rimage = image
98  Return 0
99  out_free_control_pages :
100  kimage_free_page_list( & control_pages)
101  out_free_image :
102  kfree(image)
103  Return ret
Caller
NameDescribe
do_kexec_load