函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\mmap.c Create Date:2022-07-27 16:18:21
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:his is really a simplified "do_mmap". it only handles* anonymous maps. eventually we may be able to do some* brk-specific accounting here.

函数原型:static int do_brk_flags(unsigned long addr, unsigned long len, unsigned long flags, struct list_head *uf)

返回类型:int

参数:

类型参数名称
unsigned longaddr
unsigned longlen
unsigned longflags
struct list_head *uf
2972  mm等于mm
2975  pgoff等于addr右移PAGE_SHIFT determines the page size
2980  如果flags按位与VM_EXEC的反的值不等于0则返回:负EINVAL
2982  flags或等于VM_DATA_DEFAULT_FLAGS按位或Is a VM accounted object 按位或def_flags
2984  mapped_addr等于get_unmapped_area(NULL, addr, len, 0, Interpret addr exactly )
2985  如果IS_ERR_VALUE(mapped_addr)则返回:mapped_addr
2988  error等于mlock_future_check(mm, def_flags, len)
2989  如果error则返回:error
2995 find_vma_links(mm, addr, addr + len, & prev, & rb_link, & rb_parent)循环
2997  如果do_munmap(mm, addr, len, uf)则返回:负ENOMEM
3002  如果非Return true if the calling process may expand its vm space by the passed* number of pages则返回:负ENOMEM
3005  如果 number of VMAs 大于sysctl_max_map_count则返回:负ENOMEM
3008  如果security_vm_enough_memory_mm(mm, len >> PAGE_SHIFT determines the page size )则返回:负ENOMEM
3012  vma等于Given a mapping request (addr,end,vm_flags,file,pgoff), figure out* whether that can be merged with its predecessor or its successor
3014  如果vma则转到:out
3020  vma等于vm_area_alloc(mm)
3021  如果非vma
3022  vm_unacct_memory(len >> PAGE_SHIFT determines the page size )
3023  返回:负ENOMEM
3026  vma_set_anonymous(vma)
3027  Our start address within vm_mm. 等于addr
3028  The first byte after our end addresswithin vm_mm. 等于addrlen
3029  Offset (within vm_file) in PAGE_SIZEunits 等于pgoff
3030  Flags, see mm.h. 等于flags
3031  Access permissions of this VMA. 等于vm_get_page_prot(flags)
3032  vma_link(mm, vma, prev, rb_link, rb_parent)
3033  out :
3034  perf_event_mmap(vma)
3035  Total pages mapped 加等于len右移PAGE_SHIFT determines the page size
3036  VM_WRITE & ~VM_SHARED & ~VM_STACK 加等于len右移PAGE_SHIFT determines the page size
3037  如果flags按位与VM_LOCKED Pages that have PG_mlocked set 加等于len右移PAGE_SHIFT determines the page size
3039  Flags, see mm.h. 或等于VM_SOFTDIRTY
3040  返回:0
调用者
名称描述
SYSCALL_DEFINE1
vm_brk_flags