函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__apply_to_page_range

函数原型:static int __apply_to_page_range(struct mm_struct *mm, unsigned long addr, unsigned long size, pte_fn_t fn, void *data, bool create)

返回类型:int

参数:

类型参数名称
struct mm_struct *mm
unsigned longaddr
unsigned longsize
pte_fn_tfn
void *data
boolcreate
2150  end等于addrsize
2151  err等于0
2153  如果WARN_ON(addr >= end)则返回:负EINVAL
2156  pgd等于a shortcut to get a pgd_t in a given mm(mm, addr)
2157  循环
2158  next等于When walking page tables, get the address of the next boundary,* or the end address of the range if that comes earlier. Although no* vma end wraps to 0, rounded up __boundary may wrap to 0 throughout.(addr, end)
2159  如果非createpgd_none_or_clear_bad(pgd)则继续下一循环
2161  err等于apply_to_p4d_range(mm, pgd, addr, next, fn, data, create)
2162  如果err退出
2164 pgd自加, addr等于next, addr不等于end循环
2166  返回:err
调用者
名称描述
apply_to_page_rangeScan a region of virtual memory, filling in page tables as necessary* and calling a provided function on each leaf page table.
apply_to_existing_page_rangeScan a region of virtual memory, calling a provided function on* each leaf page table where it exists.* Unlike apply_to_page_range, this does _not_ fill in page tables* where they are absent.