函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:insert_pfn

函数原型:static vm_fault_t insert_pfn(struct vm_area_struct *vma, unsigned long addr, pfn_t pfn, pgprot_t prot, bool mkwrite)

返回类型:vm_fault_t

参数:

类型参数名称
struct vm_area_struct *vma
unsigned longaddr
pfn_tpfn
pgprot_tprot
boolmkwrite
1602  mm等于The address space we belong to.
1606  pte等于get_locked_pte(mm, addr, & ptl)
1607  如果非pte则返回:VM_FAULT_OOM
1609  如果非pte_none( * pte)则
1610  如果mkwrite
1621  如果pte_pfn( * pte)不等于pfn_t_to_pfn(pfn)则
1623  转到:out_unlock
1625  entry等于pte_mkyoung( * pte)
1630  转到:out_unlock
1634  如果pfn_t_devmap(pfn)则entry等于pte_mkdevmap(pfn_t_pte(pfn, prot))
1636  否则entry等于pte_mkspecial(pfn_t_pte(pfn, prot))
1639  如果mkwrite
1640  entry等于pte_mkyoung(entry)
1641  entry等于Do pte_mkwrite, but only if the vma says VM_WRITE. We do this when* servicing faults for write access. In the normal case, do always want* pte_mkwrite. But get_user_pages can cause write faults for mappings
1644  set_pte_at(mm, addr, pte, entry)
1645  The x86 doesn't have any external MMU info: the kernel page* tables contain all the necessary information.
1647  out_unlock :
1648  pte_unmap_unlock(pte, ptl)
1649  返回:VM_FAULT_NOPAGE
调用者
名称描述
vmf_insert_pfn_protvmf_insert_pfn_prot - insert single pfn into user vma with specified pgprot*@vma: user vma to map to*@addr: target user address of this page*@pfn: source kernel pfn*@pgprot: pgprot flags for the inserted page* This is exactly like vmf_insert_pfn(), except
__vm_insert_mixed