Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:kimage_load_normal_segment

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

Type:int

Parameter:

TypeParameterName
struct kimage *image
struct kexec_segment *segment
781  unsigned char __user * buf = NULL
782  unsigned char * kbuf = NULL
784  result = 0
785  If If set, we are using file mode kexec syscall Then kbuf = kbuf
787  Else buf = buf
789  ubytes = bufsz
790  mbytes = memsz
791  maddr = mem
793  result = kimage_set_destination(image, maddr)
794  If result < 0 Then Go to out
797  When mbytes cycle
802  page = kimage_alloc_page(image, GFP_HIGHUSER, maddr)
803  If Not page Then
804  result = -ENOMEM
805  Go to out
807  result = kimage_add_page(image, page_to_boot_pfn(page) << PAGE_SHIFT determines the page size )
809  If result < 0 Then Go to 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 = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(ubytes, mchunk)
821  If If set, we are using file mode kexec syscall Then No 3D Now!(ptr, kbuf, uchunk)
823  Else result = copy_from_user(ptr, buf, uchunk)
825  kunmap(page)
826  If result Then
827  result = -EFAULT
828  Go to out
830  ubytes -= uchunk
831  maddr += mchunk
832  If If set, we are using file mode kexec syscall Then kbuf += mchunk
834  Else buf += mchunk
836  mbytes -= mchunk
838  cond_resched()
840  out :
841  Return result
Caller
NameDescribe
kimage_load_segment