函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:SYSCALL_DEFINE5

函数原型:SYSCALL_DEFINE5(kexec_file_load, int, kernel_fd, int, initrd_fd, unsigned long, cmdline_len, const char __user *, cmdline_ptr, unsigned long, flags)

返回类型:

参数:

374  ret等于0
378  如果非操作权限检查kexec_load_disabled则返回:负EPERM
382  如果prefix, newline flags 不等于prefix, newline flags 按位与List of defined/legal kexec file flags 的值则返回:负EINVAL
385  image = NULL
387  如果非mutex_trylock - try to acquire the mutex, without waiting*@lock: the mutex to be acquired* Try to acquire the mutex atomically则返回:负EBUSY
390  dest_image等于kexec_image
391  如果prefix, newline flags 按位与KEXEC_FILE_ON_CRASH
392  dest_image等于kexec_crash_image
393  如果kexec_crash_imagearch_kexec_unprotect_crashkres()
397  如果prefix, newline flags 按位与Kexec file load interface flags.* KEXEC_FILE_UNLOAD : Unload already loaded kexec/kdump image.* KEXEC_FILE_ON_CRASH : Load/unload operation belongs to kdump image.* KEXEC_FILE_NO_INITRAMFS : No initramfs is being loaded. Ignore the initrd* fd field.则转到:exchange
405  如果prefix, newline flags 按位与KEXEC_FILE_ON_CRASHkimage_free(xchg( & kexec_crash_image, NULL))
408  ret等于kimage_file_alloc_init( & image, kernel_fd, initrd_fd, cmdline_ptr, cmdline_len, prefix, newline flags )
410  如果ret则转到:out
413  ret等于A architecture hook called to validate the* proposed image and prepare the control pages* as needed
414  如果ret则转到:out
421  ret等于kimage_crash_copy_vmcoreinfo(image)
422  如果ret则转到:out
425  ret等于kexec_calculate_store_digests(image)
426  如果ret则转到:out
429 i小于nr_segments循环
432  ksegment等于segment[i]
433  pr_debug("Loading segment %d: buf=0x%p bufsz=0x%zx mem=0x%lx memsz=0x%zx\n", i, buf, bufsz, mem, memsz)
437  ret等于kimage_load_segment(image, & segment[i])
438  如果ret则转到:out
442  kimage_terminate(image)
448  Free up memory used by kernel, initrd, and command line. This is temporary* memory allocation which is not needed any more after these buffers have* been loaded into separate segments and have been copied elsewhere.
449  exchange :
450  image等于xchg(dest_image, image)
451  out :
452  如果prefix, newline flags 按位与KEXEC_FILE_ON_CRASHkexec_crash_imageProtection mechanism for crashkernel reserved memory after* the kdump kernel is loaded.* Provide an empty default implementation here -- architecture* code may override this
455  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
456  kimage_free(image)
457  返回:ret