Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:This mmap-allocator allocates new areas top-down from below the* stack's low limit (the base):

Proto:unsigned long arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags)

Type:unsigned long

Parameter:

TypeParameterName
struct file *filp
unsigned longaddr
unsigned longlen
unsigned longpgoff
unsigned longflags
2122  mm = mm
2124  mmap_end = arch_get_mmap_end(addr)
2127  If len > mmap_end - mmap_min_addr Then Return -ENOMEM
2130  If flags & Interpret addr exactly Then Return addr
2134  If addr Then
2135  addr = align the pointer to the (next) page boundary (addr)
2136  vma = Same as find_vma, but also return a pointer to the previous VMA in *pprev.
2137  If mmap_end - len >= addr && addr >= mmap_min_addr && ( Not vma || addr + len <= vm_start_gap(vma) ) && ( Not prev || addr >= vm_end_gap(prev) ) Then Return addr
2143  flags = VM_UNMAPPED_AREA_TOPDOWN
2144  length = len
2145  low_limit = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(PAGE_SIZE, mmap_min_addr)
2146  high_limit = arch_get_mmap_base(addr, base of mmap area )
2147  align_mask = 0
2148  addr = Search for an unmapped address range
2156  If offset_in_page(addr) Then
2157  VM_BUG_ON(addr != - ENOMEM)
2158  flags = 0
2159  low_limit = TASK_UNMAPPED_BASE
2160  high_limit = mmap_end
2161  addr = Search for an unmapped address range
2164  Return addr