函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:kimage_load_crash_segment

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

返回类型:int

参数:

类型参数名称
struct kimage *image
struct kexec_segment *segment
854  unsigned char __user * buf = NULL
855  unsigned char * kbuf = NULL
857  result等于0
858  如果 If set, we are using file mode kexec syscall kbuf等于kbuf
860  否则buf等于buf
862  ubytes等于bufsz
863  mbytes等于memsz
864  maddr等于mem
865 mbytes循环
870  page等于boot_pfn_to_page(maddr >> PAGE_SHIFT determines the page size )
871  如果非page
872  result等于负ENOMEM
873  转到:out
875  arch_kexec_post_alloc_pages(page_address(page), 1, 0)
876  ptr等于kmap(page)
877  ptr加等于maddr按位与PAGE_MASK的反
878  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))
880  uchunk等于两数取小(ubytes, mchunk)
881  如果mchunk大于uchunk
883  memset(ptr + uchunk, 0, mchunk - uchunk)
887  如果 If set, we are using file mode kexec syscall 内存复制(ptr, kbuf, uchunk)
889  否则result等于copy_from_user(ptr, buf, uchunk)
892  kunmap(page)
893  arch_kexec_pre_free_pages(page_address(page), 1)
894  如果result
895  result等于负EFAULT
896  转到:out
898  ubytes减等于uchunk
899  maddr加等于mchunk
900  如果 If set, we are using file mode kexec syscall kbuf加等于mchunk
902  否则buf加等于mchunk
904  mbytes减等于mchunk
906  cond_resched()
908  out :
909  返回:result
调用者
名称描述
kimage_load_segment