函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:kimage_load_normal_segment

函数原型:static int kimage_load_normal_segment(struct kimage *image, struct kexec_segment *segment)

返回类型:int

参数:

类型参数名称
struct kimage *image
struct kexec_segment *segment
781  unsigned char __user * buf = NULL
782  unsigned char * kbuf = NULL
784  result等于0
785  如果 If set, we are using file mode kexec syscall kbuf等于kbuf
787  否则buf等于buf
789  ubytes等于bufsz
790  mbytes等于memsz
791  maddr等于mem
793  result等于kimage_set_destination(image, maddr)
794  如果result小于0则转到:out
797 mbytes循环
802  page等于kimage_alloc_page(image, GFP_HIGHUSER, maddr)
803  如果非page
804  result等于负ENOMEM
805  转到:out
807  result等于kimage_add_page(image, page_to_boot_pfn(page) << PAGE_SHIFT determines the page size )
809  如果result小于0则转到:out
812  ptr等于kmap(page)
814  clear_page(ptr)
815  ptr加等于maddr按位与PAGE_MASK的反
816  mchunk等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(size_t, mbytes, PAGE_SIZE - (maddr & ~PAGE_MASK))
818  uchunk等于两数取小(ubytes, mchunk)
821  如果 If set, we are using file mode kexec syscall 内存复制(ptr, kbuf, uchunk)
823  否则result等于copy_from_user(ptr, buf, uchunk)
825  kunmap(page)
826  如果result
827  result等于负EFAULT
828  转到:out
830  ubytes减等于uchunk
831  maddr加等于mchunk
832  如果 If set, we are using file mode kexec syscall kbuf加等于mchunk
834  否则buf加等于mchunk
836  mbytes减等于mchunk
838  cond_resched()
840  out :
841  返回:result
调用者
名称描述
kimage_load_segment