Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:kimage_load_crash_segment

Proto:static int kimage_load_crash_segment(struct kimage *image, struct kexec_segment *segment)

Type:int

Parameter:

TypeParameterName
struct kimage *image
struct kexec_segment *segment
854  unsigned char __user * buf = NULL
855  unsigned char * kbuf = NULL
857  result = 0
858  If If set, we are using file mode kexec syscall Then kbuf = kbuf
860  Else buf = buf
862  ubytes = bufsz
863  mbytes = memsz
864  maddr = mem
865  When mbytes cycle
870  page = boot_pfn_to_page(maddr >> PAGE_SHIFT determines the page size )
871  If Not page Then
872  result = -ENOMEM
873  Go to 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 = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(ubytes, mchunk)
881  If mchunk > uchunk Then
883  memset(ptr + uchunk, 0, mchunk - uchunk)
887  If If set, we are using file mode kexec syscall Then No 3D Now!(ptr, kbuf, uchunk)
889  Else result = copy_from_user(ptr, buf, uchunk)
892  kunmap(page)
893  arch_kexec_pre_free_pages(page_address(page), 1)
894  If result Then
895  result = -EFAULT
896  Go to out
898  ubytes -= uchunk
899  maddr += mchunk
900  If If set, we are using file mode kexec syscall Then kbuf += mchunk
902  Else buf += mchunk
904  mbytes -= mchunk
906  cond_resched()
908  out :
909  Return result
Caller
NameDescribe
kimage_load_segment