函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\sys_x86_64.c Create Date:2022-07-27 08:41:59
Last Modify:2022-05-18 16:45:21 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:arch_get_unmapped_area_topdown

函数原型:unsigned long arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, const unsigned long len, const unsigned long pgoff, const unsigned long flags)

返回类型:unsigned long

参数:

类型参数名称
struct file *filp
const unsigned longaddr0
const unsigned longlen
const unsigned longpgoff
const unsigned longflags
179  mm等于mm
180  addr等于addr0
183  addr等于mpx_unmapped_area_check(addr, len, flags)
184  如果IS_ERR_VALUE(addr)则返回:addr
188  如果len大于TASK_SIZE则返回:负ENOMEM
192  如果flags按位与Interpret addr exactly 则返回:addr
196  如果非in_32bit_syscall()且flags按位与ly give out 32bit addresses 则转到:bottomup
200  如果addr
201  addr与等于PAGE_MASK
202  如果非mmap_address_hint_valid(addr, len)则转到:get_unmapped_area
205  vma等于Look up the first VMA which satisfies addr < vm_end, NULL if none.
206  如果非vmaaddrlen小于等于vm_start_gap(vma)则返回:addr
209  get_unmapped_area :
211  flags等于VM_UNMAPPED_AREA_TOPDOWN
212  length等于len
213  low_limit等于PAGE_SIZE
214  high_limit等于get_mmap_base(0)
223  如果addr大于DEFAULT_MAP_WINDOW且非in_32bit_syscall()则high_limit加等于TASK_SIZE_MAXDEFAULT_MAP_WINDOW
226  align_mask等于0
227  align_offset等于pgoff左移PAGE_SHIFT determines the page size
228  如果filp
229  align_mask等于Align a virtual address to avoid aliasing in the I$ on AMD F15h.
230  align_offset加等于To avoid aliasing in the I$ on AMD F15h, the bits defined by the* va_align.bits, [12:upper_bit), are set to a random value instead of* zeroing them. This random value is computed once per boot. This form* of ASLR is known as "per-boot ASLR".
232  addr等于Search for an unmapped address range
233  如果非addr按位与PAGE_MASK的反的值则返回:addr
235  VM_BUG_ON(addr != - ENOMEM)
237  bottomup :
244  返回:arch_get_unmapped_area(filp, addr0, len, pgoff, flags)