Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:kexec_elf_load - load ELF executable image*@lowest_load_addr: On return, will be the address where the first PT_LOAD* section will be loaded in memory.* Return:* 0 on success, negative value on failure.

Proto:int kexec_elf_load(struct kimage *image, struct elf64_hdr *ehdr, struct kexec_elf_info *elf_info, struct kexec_buf *kbuf, unsigned long *lowest_load_addr)

Type:int

Parameter:

TypeParameterName
struct kimage *image
struct elf64_hdr *ehdr
struct kexec_elf_info *elf_info
struct kexec_buf *kbuf
unsigned long *lowest_load_addr
393  lowest_addr = UINT_MAX
398  When i < e_phnum cycle
403  phdr = proghdrs[i]
404  If p_type != PT_LOAD Then Continue
407  size = Segment size in file
408  If size > Segment size in memory Then size = Segment size in memory
411  buffer = buffer + Segment file offset
412  bufsz = size
413  memsz = Segment size in memory
414  buf_align = Segment alignment, file & memory
415  buf_min = Segment physical address
416  mem = If kexec_buf.mem is set to this value, kexec_locate_mem_hole()* will try to allocate free memory. Arch may overwrite it.
417  ret = kexec_add_buffer - place a buffer in a kexec segment*@kbuf: Buffer contents and memory parameters.* This function assumes that kexec_mutex is held.* On successful return, @kbuf->mem will have the physical address of* the buffer in memory.
418  If ret Then Go to out
420  load_addr = mem
422  If load_addr < lowest_addr Then lowest_addr = load_addr
426  lowest_load_addr = lowest_addr
427  ret = 0
428  out :
429  Return ret