Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:do_kexec_load

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

Type:int

Parameter:

TypeParameterName
unsigned longentry
unsigned longnr_segments
struct kexec_segment __user *segments
unsigned longflags
113  If flags & kexec flags for different usage scenarios Then
114  dest_image = kexec_crash_image
115  If kexec_crash_image Then arch_kexec_unprotect_crashkres()
117  Else
118  dest_image = kexec_image
121  If nr_segments == 0 Then
123  kimage_free(xchg(dest_image, NULL))
124  Return 0
126  If flags & kexec flags for different usage scenarios Then
132  kimage_free(xchg( & kexec_crash_image, NULL))
135  ret = kimage_alloc_init( & image, entry, nr_segments, segments, flags)
136  If ret Then Return ret
139  If flags & KEXEC_PRESERVE_CONTEXT Then preserve_context = 1
142  ret = A architecture hook called to validate the* proposed image and prepare the control pages* as needed
143  If ret Then Go to out
150  ret = kimage_crash_copy_vmcoreinfo(image)
151  If ret Then Go to out
154  When i < nr_segments cycle
155  ret = kimage_load_segment(image, & segment[i])
156  If ret Then Go to out
160  kimage_terminate(image)
163  image = xchg(dest_image, image)
165  out :
166  If flags & kexec flags for different usage scenarios && kexec_crash_image Then Protection mechanism for crashkernel reserved memory after* the kdump kernel is loaded.* Provide an empty default implementation here -- architecture* code may override this
169  kimage_free(image)
170  Return ret
Caller
NameDescribe
SYSCALL_DEFINE4
COMPAT_SYSCALL_DEFINE4