函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:set up a private mapping or an anonymous shared mapping

函数原型:static int do_mmap_private(struct vm_area_struct *vma, struct vm_region *region, unsigned long len, unsigned long capabilities)

返回类型:int

参数:

类型参数名称
struct vm_area_struct *vma
struct vm_region *region
unsigned longlen
unsigned longcapabilities
1018  如果capabilities按位与NOMMU_MAP_DIRECT
1019  ret等于call_mmap(File we map to (can be NULL). , vma)
1020  如果ret恒等于0则
1023  vm_top等于vm_end
1024  返回:0
1026  如果ret不等于负ENOSYS则返回:ret
1039  order等于get_order - Determine the allocation order of a memory size*@size: The size for which to get the order* Determine the allocation order of a particular sized block of memory
1040  total等于1左移order
1041  point等于len右移PAGE_SHIFT determines the page size
1044  如果sysctl_nr_trim_pagestotalpoint大于等于sysctl_nr_trim_pagestotal等于point
1047  base等于alloc_pages_exact(total << PAGE_SHIFT determines the page size , GFP_KERNEL)
1048  如果非base则转到:enomem
1051  atomic_long_add(total, & mmap_pages_allocated)
1053  VMA vm_flags 等于Flags, see mm.h. 或等于VM_MAPPED_COPY
1054  start address of region 等于base
1055  gion initialised to here 等于start address of region len
1056  gion allocated to here 等于start address of region total左移PAGE_SHIFT determines the page size 位的值
1058  Our start address within vm_mm. 等于start address of region
1059  The first byte after our end addresswithin vm_mm. 等于start address of region len
1061  如果File we map to (can be NULL).
1065  fpos等于Offset (within vm_file) in PAGE_SIZEunits
1066  fpos左移等于PAGE_SHIFT determines the page size
1068  ret等于kernel_read(File we map to (can be NULL). , base, len, & fpos)
1069  如果ret小于0则转到:error_free
1073  如果ret小于lenmemset(base + ret, 0, len - ret)
1076  否则
1077  vma_set_anonymous(vma)
1080  返回:0
1082  error_free :
1083  a contiguous series of pages
1084  start address of region 等于Our start address within vm_mm. 等于0
1085  gion initialised to here 等于The first byte after our end addresswithin vm_mm. 等于0
1086  gion allocated to here 等于0
1087  返回:ret
1089  enomem :
1090  打印错误信息("Allocation of length %lu from process %d (%s) failed\n", len, pid, comm)
1092  Show free area list (used inside shift_scroll-lock stuff)* We also calculate the percentage fragmentation
1093  返回:负ENOMEM
调用者
名称描述
do_mmaphandle mapping creation for uClinux