函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:get_vaddr_frames() - map virtual addresses to pfns*@start: starting user address*@nr_frames: number of pages / pfns from start to map*@gup_flags: flags modifying lookup behaviour*@vec: structure which receives pages / pfns of the addresses mapped.

函数原型:int get_vaddr_frames(unsigned long start, unsigned int nr_frames, unsigned int gup_flags, struct frame_vector *vec)

返回类型:int

参数:

类型参数名称
unsigned longstart
unsigned intnr_frames
unsigned intgup_flags
struct frame_vector *vec
37  mm等于mm
39  ret等于0
43  如果nr_frames恒等于0则返回:0
46  如果WARN_ON_ONCE(nr_frames > Number of frames we have space for )则nr_frames等于Number of frames we have space for
49  start等于Architectures that support memory tagging (assigning tags to memory regions,* embedding these tags into addresses that point to these memory regions, and* checking that the memory and the pointer tags match on memory accesses)(start)
51  lock for reading
52  locked等于1
53  vma等于Look up the first VMA which intersects the interval start_addr..end_addr-1,NULL if none. Assume start_addr < end_addr.
54  如果非vma
55  ret等于负EFAULT
56  转到:out
67  如果vma_is_fsdax(vma)则
68  ret等于负EOPNOTSUPP
69  转到:out
72  如果非Flags, see mm.h. 按位与Memory mapped I/O or similar 按位或Page-ranges managed without "struct page", just pure PFN 的值的值则
73  Did we pin pages by getting page ref? = true
74  Does array contain pages or pfns? = false
75  ret等于We can leverage the VM_FAULT_RETRY functionality in the page fault* paths better by using either get_user_pages_locked() or* get_user_pages_unlocked().* get_user_pages_locked() is suitable to replace the form:* down_read(&mm->mmap_sem);* do_something()
77  转到:out
80  Did we pin pages by getting page ref? = false
81  Does array contain pages or pfns? = true
82  循环
83  nums等于frame_vector_pfns(vec)
87  如果err
88  如果ret恒等于0则ret等于err
90  转到:out
92  start加等于PAGE_SIZE
93  ret自加
99  如果ret大于等于nr_framesstart小于The first byte after our end addresswithin vm_mm. 退出
101  vma等于Look up the first VMA which intersects the interval start_addr..end_addr-1,NULL if none. Assume start_addr < end_addr.
102 vmaFlags, see mm.h. 按位与Memory mapped I/O or similar 按位或Page-ranges managed without "struct page", just pure PFN 的值循环
103  out :
104  如果lockedlease a read lock
106  如果非retret等于负EFAULT
108  如果ret大于0则Number of frames stored in ptrs array 等于ret
110  返回:ret