Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memory.c Create Date:2022-07-28 14:41:33
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:apply_to_pte_range

Proto:static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd, unsigned long addr, unsigned long end, pte_fn_t fn, void *data, bool create)

Type:int

Parameter:

TypeParameterName
struct mm_struct *mm
pmd_t *pmd
unsigned longaddr
unsigned longend
pte_fn_tfn
void *data
boolcreate
2027  err = 0
2028  ptl = ptl
2030  If create Then
2031  pte = If mm == init_mm Then pte_alloc_kernel(pmd, addr) Else pte_alloc_map_lock(mm, pmd, addr, & ptl)
2034  If Not pte Then Return -ENOMEM
2036  Else
2037  pte = If mm == init_mm Then pte_offset_kernel(pmd, addr) Else pte_offset_map_lock(mm, pmd, addr, & ptl)
2042  BUG_ON(pmd_huge( * pmd))
2044  A facility to provide lazy MMU batching()
2046  Do
2047  If create || Not pte_none( * pte) Then
2048  err = fn(pte++, addr, data)
2049  If err Then Break
2052  When addr += PAGE_SIZE , addr != end cycle
2054  arch_leave_lazy_mmu_mode()
2056  If mm != init_mm Then pte_unmap_unlock(pte - 1, ptl)
2058  Return err
Caller
NameDescribe
apply_to_pmd_range